aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/oss/Kconfig5
-rw-r--r--sound/oss/Makefile13
-rw-r--r--sound/oss/ac97.c432
-rw-r--r--sound/oss/ac97.h201
-rw-r--r--sound/oss/aci.c712
-rw-r--r--sound/oss/aci.h57
-rw-r--r--sound/oss/ad1816.c1368
-rw-r--r--sound/oss/ad1889.c1101
-rw-r--r--sound/oss/ad1889.h135
-rw-r--r--sound/oss/adlib_card.c73
-rw-r--r--sound/oss/cs461x.h1691
-rw-r--r--sound/oss/cs461x_image.h322
-rw-r--r--sound/oss/cs46xx.c5444
-rw-r--r--sound/oss/cs46xx_wrapper-24.h56
-rw-r--r--sound/oss/cs46xxpm.h70
-rw-r--r--sound/oss/emu10k1/8010.h737
-rw-r--r--sound/oss/emu10k1/Makefile17
-rw-r--r--sound/oss/emu10k1/audio.c1595
-rw-r--r--sound/oss/emu10k1/audio.h44
-rw-r--r--sound/oss/emu10k1/cardmi.c832
-rw-r--r--sound/oss/emu10k1/cardmi.h97
-rw-r--r--sound/oss/emu10k1/cardmo.c229
-rw-r--r--sound/oss/emu10k1/cardmo.h62
-rw-r--r--sound/oss/emu10k1/cardwi.c384
-rw-r--r--sound/oss/emu10k1/cardwi.h91
-rw-r--r--sound/oss/emu10k1/cardwo.c643
-rw-r--r--sound/oss/emu10k1/cardwo.h90
-rw-r--r--sound/oss/emu10k1/ecard.c157
-rw-r--r--sound/oss/emu10k1/ecard.h113
-rw-r--r--sound/oss/emu10k1/efxmgr.c220
-rw-r--r--sound/oss/emu10k1/efxmgr.h270
-rw-r--r--sound/oss/emu10k1/emuadxmg.c104
-rw-r--r--sound/oss/emu10k1/hwaccess.c507
-rw-r--r--sound/oss/emu10k1/hwaccess.h247
-rw-r--r--sound/oss/emu10k1/icardmid.h163
-rw-r--r--sound/oss/emu10k1/icardwav.h53
-rw-r--r--sound/oss/emu10k1/irqmgr.c113
-rw-r--r--sound/oss/emu10k1/irqmgr.h52
-rw-r--r--sound/oss/emu10k1/main.c1471
-rw-r--r--sound/oss/emu10k1/midi.c614
-rw-r--r--sound/oss/emu10k1/midi.h78
-rw-r--r--sound/oss/emu10k1/mixer.c690
-rw-r--r--sound/oss/emu10k1/passthrough.c240
-rw-r--r--sound/oss/emu10k1/passthrough.h99
-rw-r--r--sound/oss/emu10k1/recmgr.c147
-rw-r--r--sound/oss/emu10k1/recmgr.h48
-rw-r--r--sound/oss/emu10k1/timer.c176
-rw-r--r--sound/oss/emu10k1/timer.h54
-rw-r--r--sound/oss/emu10k1/voicemgr.c398
-rw-r--r--sound/oss/emu10k1/voicemgr.h103
-rw-r--r--sound/oss/mpu401.c7
-rw-r--r--sound/oss/nm256.h292
-rw-r--r--sound/oss/nm256_audio.c1662
-rw-r--r--sound/oss/nm256_coeff.h4697
-rw-r--r--sound/oss/opl3.c14
-rw-r--r--sound/oss/opl3.h5
-rw-r--r--sound/oss/opl3sa2.c1020
57 files changed, 11 insertions, 30304 deletions
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig
index 4b30ae6d8ba5..314477909f82 100644
--- a/sound/oss/Kconfig
+++ b/sound/oss/Kconfig
@@ -348,7 +348,7 @@ config MSND_FIFOSIZE
348 348
349config SOUND_VIA82CXXX 349config SOUND_VIA82CXXX
350 tristate "VIA 82C686 Audio Codec" 350 tristate "VIA 82C686 Audio Codec"
351 depends on SOUND_PRIME && PCI && OSS_OBSOLETE 351 depends on SOUND_PRIME && PCI && OSS_OBSOLETE && VIRT_TO_BUS
352 help 352 help
353 Say Y here to include support for the audio codec found on VIA 353 Say Y here to include support for the audio codec found on VIA
354 82Cxxx-based chips. Typically these are built into a motherboard. 354 82Cxxx-based chips. Typically these are built into a motherboard.
@@ -368,7 +368,7 @@ config MIDI_VIA82CXXX
368 368
369config SOUND_OSS 369config SOUND_OSS
370 tristate "OSS sound modules" 370 tristate "OSS sound modules"
371 depends on SOUND_PRIME && ISA_DMA_API 371 depends on SOUND_PRIME && ISA_DMA_API && VIRT_TO_BUS
372 help 372 help
373 OSS is the Open Sound System suite of sound card drivers. They make 373 OSS is the Open Sound System suite of sound card drivers. They make
374 sound programming easier since they provide a common API. Say Y or 374 sound programming easier since they provide a common API. Say Y or
@@ -417,6 +417,7 @@ config SOUND_CS4232
417config SOUND_SSCAPE 417config SOUND_SSCAPE
418 tristate "Ensoniq SoundScape support" 418 tristate "Ensoniq SoundScape support"
419 depends on SOUND_OSS 419 depends on SOUND_OSS
420 depends on VIRT_TO_BUS
420 help 421 help
421 Answer Y if you have a sound card based on the Ensoniq SoundScape 422 Answer Y if you have a sound card based on the Ensoniq SoundScape
422 chipset. Such cards are being manufactured at least by Ensoniq, Spea 423 chipset. Such cards are being manufactured at least by Ensoniq, Spea
diff --git a/sound/oss/Makefile b/sound/oss/Makefile
index 2489bd6bb085..7a2f9ae7b7c5 100644
--- a/sound/oss/Makefile
+++ b/sound/oss/Makefile
@@ -18,20 +18,15 @@ obj-$(CONFIG_SOUND_TRIX) += trix.o ad1848.o sb_lib.o uart401.o
18obj-$(CONFIG_SOUND_SSCAPE) += sscape.o ad1848.o mpu401.o 18obj-$(CONFIG_SOUND_SSCAPE) += sscape.o ad1848.o mpu401.o
19obj-$(CONFIG_SOUND_CS4232) += cs4232.o uart401.o 19obj-$(CONFIG_SOUND_CS4232) += cs4232.o uart401.o
20obj-$(CONFIG_SOUND_MSS) += ad1848.o 20obj-$(CONFIG_SOUND_MSS) += ad1848.o
21obj-$(CONFIG_SOUND_OPL3SA2) += opl3sa2.o ad1848.o mpu401.o
22obj-$(CONFIG_SOUND_PAS) += pas2.o sb.o sb_lib.o uart401.o 21obj-$(CONFIG_SOUND_PAS) += pas2.o sb.o sb_lib.o uart401.o
23obj-$(CONFIG_SOUND_SB) += sb.o sb_lib.o uart401.o 22obj-$(CONFIG_SOUND_SB) += sb.o sb_lib.o uart401.o
24obj-$(CONFIG_SOUND_KAHLUA) += kahlua.o 23obj-$(CONFIG_SOUND_KAHLUA) += kahlua.o
25obj-$(CONFIG_SOUND_MPU401) += mpu401.o 24obj-$(CONFIG_SOUND_MPU401) += mpu401.o
26obj-$(CONFIG_SOUND_UART6850) += uart6850.o 25obj-$(CONFIG_SOUND_UART6850) += uart6850.o
27obj-$(CONFIG_SOUND_ADLIB) += adlib_card.o opl3.o
28obj-$(CONFIG_SOUND_YM3812) += opl3.o 26obj-$(CONFIG_SOUND_YM3812) += opl3.o
29obj-$(CONFIG_SOUND_VMIDI) += v_midi.o 27obj-$(CONFIG_SOUND_VMIDI) += v_midi.o
30obj-$(CONFIG_SOUND_VIDC) += vidc_mod.o 28obj-$(CONFIG_SOUND_VIDC) += vidc_mod.o
31obj-$(CONFIG_SOUND_WAVEARTIST) += waveartist.o 29obj-$(CONFIG_SOUND_WAVEARTIST) += waveartist.o
32obj-$(CONFIG_SOUND_AD1816) += ad1816.o
33obj-$(CONFIG_SOUND_AD1889) += ad1889.o ac97_codec.o
34obj-$(CONFIG_SOUND_ACI_MIXER) += aci.o
35 30
36obj-$(CONFIG_SOUND_VIA82CXXX) += via82cxxx_audio.o ac97_codec.o 31obj-$(CONFIG_SOUND_VIA82CXXX) += via82cxxx_audio.o ac97_codec.o
37ifeq ($(CONFIG_MIDI_VIA82CXXX),y) 32ifeq ($(CONFIG_MIDI_VIA82CXXX),y)
@@ -40,24 +35,16 @@ endif
40obj-$(CONFIG_SOUND_MSNDCLAS) += msnd.o msnd_classic.o 35obj-$(CONFIG_SOUND_MSNDCLAS) += msnd.o msnd_classic.o
41obj-$(CONFIG_SOUND_MSNDPIN) += msnd.o msnd_pinnacle.o 36obj-$(CONFIG_SOUND_MSNDPIN) += msnd.o msnd_pinnacle.o
42obj-$(CONFIG_SOUND_VWSND) += vwsnd.o 37obj-$(CONFIG_SOUND_VWSND) += vwsnd.o
43obj-$(CONFIG_SOUND_NM256) += nm256_audio.o ac97.o
44obj-$(CONFIG_SOUND_ICH) += i810_audio.o ac97_codec.o 38obj-$(CONFIG_SOUND_ICH) += i810_audio.o ac97_codec.o
45obj-$(CONFIG_SOUND_ES1371) += es1371.o ac97_codec.o 39obj-$(CONFIG_SOUND_ES1371) += es1371.o ac97_codec.o
46obj-$(CONFIG_SOUND_VRC5477) += nec_vrc5477.o ac97_codec.o 40obj-$(CONFIG_SOUND_VRC5477) += nec_vrc5477.o ac97_codec.o
47obj-$(CONFIG_SOUND_AU1550_AC97) += au1550_ac97.o ac97_codec.o 41obj-$(CONFIG_SOUND_AU1550_AC97) += au1550_ac97.o ac97_codec.o
48obj-$(CONFIG_SOUND_FUSION) += cs46xx.o ac97_codec.o
49obj-$(CONFIG_SOUND_TRIDENT) += trident.o ac97_codec.o 42obj-$(CONFIG_SOUND_TRIDENT) += trident.o ac97_codec.o
50obj-$(CONFIG_SOUND_EMU10K1) += ac97_codec.o
51obj-$(CONFIG_SOUND_BCM_CS4297A) += swarm_cs4297a.o 43obj-$(CONFIG_SOUND_BCM_CS4297A) += swarm_cs4297a.o
52obj-$(CONFIG_SOUND_BT878) += btaudio.o 44obj-$(CONFIG_SOUND_BT878) += btaudio.o
53 45
54obj-$(CONFIG_SOUND_WM97XX) += ac97_plugin_wm97xx.o 46obj-$(CONFIG_SOUND_WM97XX) += ac97_plugin_wm97xx.o
55 47
56ifeq ($(CONFIG_MIDI_EMU10K1),y)
57 obj-$(CONFIG_SOUND_EMU10K1) += sound.o
58endif
59
60obj-$(CONFIG_SOUND_EMU10K1) += emu10k1/
61obj-$(CONFIG_DMASOUND) += dmasound/ 48obj-$(CONFIG_DMASOUND) += dmasound/
62 49
63# Declare multi-part drivers. 50# Declare multi-part drivers.
diff --git a/sound/oss/ac97.c b/sound/oss/ac97.c
deleted file mode 100644
index 72cf4ed77937..000000000000
--- a/sound/oss/ac97.c
+++ /dev/null
@@ -1,432 +0,0 @@
1#include <linux/module.h>
2#include <linux/kernel.h>
3#include <linux/init.h>
4#include "ac97.h"
5
6/* Flag for mono controls. */
7#define MO 0
8/* And for stereo. */
9#define ST 1
10
11/* Whether or not the bits in the channel are inverted. */
12#define INV 1
13#define NINV 0
14
15static struct ac97_chn_desc {
16 int ac97_regnum;
17 int oss_channel;
18 int maxval;
19 int is_stereo;
20 int oss_mask;
21 int recordNum;
22 u16 regmask;
23 int is_inverted;
24} mixerRegs[] = {
25 { AC97_MASTER_VOL_STEREO, SOUND_MIXER_VOLUME, 0x3f, ST, SOUND_MASK_VOLUME, 5, 0x0000, INV },
26 { AC97_MASTER_VOL_MONO, SOUND_MIXER_PHONEOUT, 0x3f, MO, SOUND_MASK_PHONEOUT, 6, 0x0000, INV },
27 { AC97_MASTER_TONE, SOUND_MIXER_TREBLE, 0x0f, MO, SOUND_MASK_TREBLE, -1, 0x00ff, INV },
28 { AC97_MASTER_TONE, SOUND_MIXER_BASS, 0x0f, MO, SOUND_MASK_BASS, -1, 0xff00, INV },
29 { AC97_PCBEEP_VOL, SOUND_MIXER_SPEAKER, 0x0f, MO, SOUND_MASK_SPEAKER, -1, 0x001e, INV },
30 { AC97_PHONE_VOL, SOUND_MIXER_PHONEIN, 0x1f, MO, SOUND_MASK_PHONEIN, 7, 0x0000, INV },
31 { AC97_MIC_VOL, SOUND_MIXER_MIC, 0x1f, MO, SOUND_MASK_MIC, 0, 0x0000, INV },
32 { AC97_LINEIN_VOL, SOUND_MIXER_LINE, 0x1f, ST, SOUND_MASK_LINE, 4, 0x0000, INV },
33 { AC97_CD_VOL, SOUND_MIXER_CD, 0x1f, ST, SOUND_MASK_CD, 1, 0x0000, INV },
34 { AC97_VIDEO_VOL, SOUND_MIXER_VIDEO, 0x1f, ST, SOUND_MASK_VIDEO, 2, 0x0000, INV },
35 { AC97_AUX_VOL, SOUND_MIXER_LINE1, 0x1f, ST, SOUND_MASK_LINE1, 3, 0x0000, INV },
36 { AC97_PCMOUT_VOL, SOUND_MIXER_PCM, 0x1f, ST, SOUND_MASK_PCM, -1, 0x0000, INV },
37 { AC97_RECORD_GAIN, SOUND_MIXER_IGAIN, 0x0f, ST, SOUND_MASK_IGAIN, -1, 0x0000, NINV },
38 { -1, -1, 0xff, 0, 0, -1, 0x0000, 0 },
39};
40
41static struct ac97_chn_desc *
42ac97_find_chndesc (struct ac97_hwint *dev, int oss_channel)
43{
44 int x;
45
46 for (x = 0; mixerRegs[x].oss_channel != -1; x++) {
47 if (mixerRegs[x].oss_channel == oss_channel)
48 return mixerRegs + x;
49 }
50
51 return NULL;
52}
53
54static inline int
55ac97_is_valid_channel (struct ac97_hwint *dev, struct ac97_chn_desc *chn)
56{
57 return (dev->last_written_mixer_values[chn->ac97_regnum / 2]
58 != AC97_REG_UNSUPPORTED);
59}
60
61int
62ac97_init (struct ac97_hwint *dev)
63{
64 int x;
65 int reg0;
66
67 /* Clear out the arrays of cached values. */
68 for (x = 0; x < AC97_REG_CNT; x++)
69 dev->last_written_mixer_values[x] = AC97_REGVAL_UNKNOWN;
70
71 for (x = 0; x < SOUND_MIXER_NRDEVICES; x++)
72 dev->last_written_OSS_values[x] = AC97_REGVAL_UNKNOWN;
73
74 /* Clear the device masks. */
75 dev->mixer_devmask = 0;
76 dev->mixer_stereomask = 0;
77 dev->mixer_recmask = 0;
78
79 /* ??? Do a "standard reset" via register 0? */
80
81 /* Hardware-dependent reset. */
82 if (dev->reset_device (dev))
83 return -1;
84
85 /* Check the mixer device capabilities. */
86 reg0 = dev->read_reg (dev, AC97_RESET);
87
88 if (reg0 < 0)
89 return -1;
90
91 /* Check for support for treble/bass controls. */
92 if (! (reg0 & 4)) {
93 dev->last_written_mixer_values[AC97_MASTER_TONE / 2]
94 = AC97_REG_UNSUPPORTED;
95 }
96
97 /* ??? There may be other tests here? */
98
99 /* Fill in the device masks. */
100 for (x = 0; mixerRegs[x].ac97_regnum != -1; x++) {
101 if (ac97_is_valid_channel (dev, mixerRegs + x)) {
102 dev->mixer_devmask |= mixerRegs[x].oss_mask;
103
104 if (mixerRegs[x].is_stereo)
105 dev->mixer_stereomask |= mixerRegs[x].oss_mask;
106
107 if (mixerRegs[x].recordNum != -1)
108 dev->mixer_recmask |= mixerRegs[x].oss_mask;
109 }
110 }
111
112 return 0;
113}
114
115/* Return the contents of register REG; use the cache if the value in it
116 is valid. Returns a negative error code on failure. */
117static int
118ac97_get_register (struct ac97_hwint *dev, u8 reg)
119{
120 if (reg > 127 || (reg & 1))
121 return -EINVAL;
122
123 /* See if it's in the cache, or if it's just plain invalid. */
124 switch (dev->last_written_mixer_values[reg / 2]) {
125 case AC97_REG_UNSUPPORTED:
126 return -EINVAL;
127 break;
128 case AC97_REGVAL_UNKNOWN:
129 dev->last_written_mixer_values[reg / 2] = dev->read_reg (dev, reg);
130 break;
131 default:
132 break;
133 }
134 return dev->last_written_mixer_values[reg / 2];
135}
136
137/* Write VALUE to AC97 register REG, and cache its value in the last-written
138 cache. Returns a negative error code on failure, or 0 on success. */
139int
140ac97_put_register (struct ac97_hwint *dev, u8 reg, u16 value)
141{
142 if (reg > 127 || (reg & 1))
143 return -EINVAL;
144
145 if (dev->last_written_mixer_values[reg / 2] == AC97_REG_UNSUPPORTED)
146 return -EINVAL;
147 else {
148 int res = dev->write_reg (dev, reg, value);
149 if (res >= 0) {
150 dev->last_written_mixer_values[reg / 2] = value;
151 return 0;
152 }
153 else
154 return res;
155 }
156}
157
158/* Scale VALUE (a value fro 0 to MAXVAL) to a value from 0-100. If
159 IS_STEREO is set, VALUE is a stereo value; the left channel value
160 is in the lower 8 bits, and the right channel value is in the upper
161 8 bits.
162
163 A negative error code is returned on failure, or the unsigned
164 scaled value on success. */
165
166static int
167ac97_scale_to_oss_val (int value, int maxval, int is_stereo, int inv)
168{
169 /* Muted? */
170 if (value & AC97_MUTE)
171 return 0;
172
173 if (is_stereo)
174 return (ac97_scale_to_oss_val (value & 255, maxval, 0, inv) << 8)
175 | (ac97_scale_to_oss_val ((value >> 8) & 255, maxval, 0, inv) << 0);
176 else {
177 int i;
178
179 /* Inverted. */
180 if (inv)
181 value = maxval - value;
182
183 i = (value * 100 + (maxval / 2)) / maxval;
184 if (i > 100)
185 i = 100;
186 if (i < 0)
187 i = 0;
188 return i;
189 }
190}
191
192static int
193ac97_scale_from_oss_val (int value, int maxval, int is_stereo, int inv)
194{
195 if (is_stereo)
196 return (ac97_scale_from_oss_val (value & 255, maxval, 0, inv) << 8)
197 | (ac97_scale_from_oss_val ((value >> 8) & 255, maxval, 0, inv) << 0);
198 else {
199 int i = ((value & 255) * maxval + 50) / 100;
200 if (inv)
201 i = maxval - i;
202 if (i < 0)
203 i = 0;
204 if (i > maxval)
205 i = maxval;
206 return i;
207 }
208}
209
210static int
211ac97_set_mixer (struct ac97_hwint *dev, int oss_channel, u16 oss_value)
212{
213 int scaled_value;
214 struct ac97_chn_desc *channel = ac97_find_chndesc (dev, oss_channel);
215 int result;
216
217 if (channel == NULL)
218 return -ENODEV;
219 if (! ac97_is_valid_channel (dev, channel))
220 return -ENODEV;
221 scaled_value = ac97_scale_from_oss_val (oss_value, channel->maxval,
222 channel->is_stereo,
223 channel->is_inverted);
224 if (scaled_value < 0)
225 return scaled_value;
226
227 if (channel->regmask != 0) {
228 int mv;
229
230 int oldval = ac97_get_register (dev, channel->ac97_regnum);
231 if (oldval < 0)
232 return oldval;
233
234 for (mv = channel->regmask; ! (mv & 1); mv >>= 1)
235 scaled_value <<= 1;
236
237 scaled_value &= channel->regmask;
238 scaled_value |= (oldval & ~channel->regmask);
239 }
240 result = ac97_put_register (dev, channel->ac97_regnum, scaled_value);
241 if (result == 0)
242 dev->last_written_OSS_values[oss_channel] = oss_value;
243 return result;
244}
245
246static int
247ac97_get_mixer_scaled (struct ac97_hwint *dev, int oss_channel)
248{
249 struct ac97_chn_desc *channel = ac97_find_chndesc (dev, oss_channel);
250 int regval;
251
252 if (channel == NULL)
253 return -ENODEV;
254
255 if (! ac97_is_valid_channel (dev, channel))
256 return -ENODEV;
257
258 regval = ac97_get_register (dev, channel->ac97_regnum);
259
260 if (regval < 0)
261 return regval;
262
263 if (channel->regmask != 0) {
264 int mv;
265
266 regval &= channel->regmask;
267
268 for (mv = channel->regmask; ! (mv & 1); mv >>= 1)
269 regval >>= 1;
270 }
271 return ac97_scale_to_oss_val (regval, channel->maxval,
272 channel->is_stereo,
273 channel->is_inverted);
274}
275
276static int
277ac97_get_recmask (struct ac97_hwint *dev)
278{
279 int recReg = ac97_get_register (dev, AC97_RECORD_SELECT);
280
281 if (recReg < 0)
282 return recReg;
283 else {
284 int x;
285 for (x = 0; mixerRegs[x].ac97_regnum >= 0; x++) {
286 if (mixerRegs[x].recordNum == (recReg & 7))
287 return mixerRegs[x].oss_mask;
288 }
289 return -ENODEV;
290 }
291}
292
293static int
294ac97_set_recmask (struct ac97_hwint *dev, int oss_recmask)
295{
296 int x;
297
298 if (oss_recmask == 0)
299 oss_recmask = SOUND_MIXER_MIC;
300
301 for (x = 0; mixerRegs[x].ac97_regnum >= 0; x++) {
302 if ((mixerRegs[x].recordNum >= 0)
303 && (oss_recmask & mixerRegs[x].oss_mask))
304 break;
305 }
306 if (mixerRegs[x].ac97_regnum < 0)
307 return -ENODEV;
308 else {
309 int regval = (mixerRegs[x].recordNum << 8) | mixerRegs[x].recordNum;
310 int res = ac97_put_register (dev, AC97_RECORD_SELECT, regval);
311 if (res == 0)
312 return ac97_get_recmask (dev);
313 else
314 return res;
315 }
316}
317
318/* Set the mixer DEV to the list of values in VALUE_LIST. Return 0 on
319 success, or a negative error code. */
320int
321ac97_set_values (struct ac97_hwint *dev,
322 struct ac97_mixer_value_list *value_list)
323{
324 int x;
325
326 for (x = 0; value_list[x].oss_channel != -1; x++) {
327 int chnum = value_list[x].oss_channel;
328 struct ac97_chn_desc *chent = ac97_find_chndesc (dev, chnum);
329 if (chent != NULL) {
330 u16 val;
331 int res;
332
333 if (chent->is_stereo)
334 val = (value_list[x].value.stereo.right << 8)
335 | value_list[x].value.stereo.left;
336 else {
337 /* We do this so the returned value looks OK in the
338 mixer app. It's not necessary otherwise. */
339 val = (value_list[x].value.mono << 8)
340 | value_list[x].value.mono;
341 }
342 res = ac97_set_mixer (dev, chnum, val);
343 if (res < 0)
344 return res;
345 }
346 else
347 return -ENODEV;
348 }
349 return 0;
350}
351
352int
353ac97_mixer_ioctl (struct ac97_hwint *dev, unsigned int cmd, void __user *arg)
354{
355 int ret;
356
357 switch (cmd) {
358 case SOUND_MIXER_READ_RECSRC:
359 ret = ac97_get_recmask (dev);
360 break;
361
362 case SOUND_MIXER_WRITE_RECSRC:
363 {
364 if (get_user (ret, (int __user *) arg))
365 ret = -EFAULT;
366 else
367 ret = ac97_set_recmask (dev, ret);
368 }
369 break;
370
371 case SOUND_MIXER_READ_CAPS:
372 ret = SOUND_CAP_EXCL_INPUT;
373 break;
374
375 case SOUND_MIXER_READ_DEVMASK:
376 ret = dev->mixer_devmask;
377 break;
378
379 case SOUND_MIXER_READ_RECMASK:
380 ret = dev->mixer_recmask;
381 break;
382
383 case SOUND_MIXER_READ_STEREODEVS:
384 ret = dev->mixer_stereomask;
385 break;
386
387 default:
388 /* Read or write request. */
389 ret = -EINVAL;
390 if (_IOC_TYPE (cmd) == 'M') {
391 int dir = _SIOC_DIR (cmd);
392 int channel = _IOC_NR (cmd);
393
394 if (channel >= 0 && channel < SOUND_MIXER_NRDEVICES) {
395 ret = 0;
396 if (dir & _SIOC_WRITE) {
397 int val;
398 if (get_user (val, (int __user *) arg) == 0)
399 ret = ac97_set_mixer (dev, channel, val);
400 else
401 ret = -EFAULT;
402 }
403 if (ret >= 0 && (dir & _SIOC_READ)) {
404 if (dev->last_written_OSS_values[channel]
405 == AC97_REGVAL_UNKNOWN)
406 dev->last_written_OSS_values[channel]
407 = ac97_get_mixer_scaled (dev, channel);
408 ret = dev->last_written_OSS_values[channel];
409 }
410 }
411 }
412 break;
413 }
414
415 if (ret < 0)
416 return ret;
417 else
418 return put_user(ret, (int __user *) arg);
419}
420
421EXPORT_SYMBOL(ac97_init);
422EXPORT_SYMBOL(ac97_set_values);
423EXPORT_SYMBOL(ac97_put_register);
424EXPORT_SYMBOL(ac97_mixer_ioctl);
425MODULE_LICENSE("GPL");
426
427
428/*
429 * Local variables:
430 * c-basic-offset: 4
431 * End:
432 */
diff --git a/sound/oss/ac97.h b/sound/oss/ac97.h
deleted file mode 100644
index 01837a9d7d6e..000000000000
--- a/sound/oss/ac97.h
+++ /dev/null
@@ -1,201 +0,0 @@
1/*
2 * ac97.h
3 *
4 * definitions for the AC97, Intel's Audio Codec 97 Spec
5 * also includes support for a generic AC97 interface
6 */
7
8#ifndef _AC97_H_
9#define _AC97_H_
10#include "sound_config.h"
11#include "sound_calls.h"
12
13#define AC97_RESET 0x0000 //
14#define AC97_MASTER_VOL_STEREO 0x0002 // Line Out
15#define AC97_HEADPHONE_VOL 0x0004 //
16#define AC97_MASTER_VOL_MONO 0x0006 // TAD Output
17#define AC97_MASTER_TONE 0x0008 //
18#define AC97_PCBEEP_VOL 0x000a // none
19#define AC97_PHONE_VOL 0x000c // TAD Input (mono)
20#define AC97_MIC_VOL 0x000e // MIC Input (mono)
21#define AC97_LINEIN_VOL 0x0010 // Line Input (stereo)
22#define AC97_CD_VOL 0x0012 // CD Input (stereo)
23#define AC97_VIDEO_VOL 0x0014 // none
24#define AC97_AUX_VOL 0x0016 // Aux Input (stereo)
25#define AC97_PCMOUT_VOL 0x0018 // Wave Output (stereo)
26#define AC97_RECORD_SELECT 0x001a //
27#define AC97_RECORD_GAIN 0x001c
28#define AC97_RECORD_GAIN_MIC 0x001e
29#define AC97_GENERAL_PURPOSE 0x0020
30#define AC97_3D_CONTROL 0x0022
31#define AC97_MODEM_RATE 0x0024
32#define AC97_POWER_CONTROL 0x0026
33
34/* registers 0x0028 - 0x0058 are reserved */
35
36/* AC'97 2.0 */
37#define AC97_EXTENDED_ID 0x0028 /* Extended Audio ID */
38#define AC97_EXTENDED_STATUS 0x002A /* Extended Audio Status */
39#define AC97_PCM_FRONT_DAC_RATE 0x002C /* PCM Front DAC Rate */
40#define AC97_PCM_SURR_DAC_RATE 0x002E /* PCM Surround DAC Rate */
41#define AC97_PCM_LFE_DAC_RATE 0x0030 /* PCM LFE DAC Rate */
42#define AC97_PCM_LR_ADC_RATE 0x0032 /* PCM LR DAC Rate */
43#define AC97_PCM_MIC_ADC_RATE 0x0034 /* PCM MIC ADC Rate */
44#define AC97_CENTER_LFE_MASTER 0x0036 /* Center + LFE Master Volume */
45#define AC97_SURROUND_MASTER 0x0038 /* Surround (Rear) Master Volume */
46#define AC97_RESERVED_3A 0x003A /* Reserved */
47/* range 0x3c-0x58 - MODEM */
48
49/* registers 0x005a - 0x007a are vendor reserved */
50
51#define AC97_VENDOR_ID1 0x007c
52#define AC97_VENDOR_ID2 0x007e
53
54/* volume control bit defines */
55
56#define AC97_MUTE 0x8000
57#define AC97_MICBOOST 0x0040
58#define AC97_LEFTVOL 0x3f00
59#define AC97_RIGHTVOL 0x003f
60
61/* record mux defines */
62
63#define AC97_RECMUX_MIC 0x0000
64#define AC97_RECMUX_CD 0x0101
65#define AC97_RECMUX_VIDEO 0x0202 /* not used */
66#define AC97_RECMUX_AUX 0x0303
67#define AC97_RECMUX_LINE 0x0404
68#define AC97_RECMUX_STEREO_MIX 0x0505
69#define AC97_RECMUX_MONO_MIX 0x0606
70#define AC97_RECMUX_PHONE 0x0707
71
72
73/* general purpose register bit defines */
74
75#define AC97_GP_LPBK 0x0080 /* Loopback mode */
76#define AC97_GP_MS 0x0100 /* Mic Select 0=Mic1, 1=Mic2 */
77#define AC97_GP_MIX 0x0200 /* Mono output select 0=Mix, 1=Mic */
78#define AC97_GP_RLBK 0x0400 /* Remote Loopback - Modem line codec */
79#define AC97_GP_LLBK 0x0800 /* Local Loopback - Modem Line codec */
80#define AC97_GP_LD 0x1000 /* Loudness 1=on */
81#define AC97_GP_3D 0x2000 /* 3D Enhancement 1=on */
82#define AC97_GP_ST 0x4000 /* Stereo Enhancement 1=on */
83#define AC97_GP_POP 0x8000 /* Pcm Out Path, 0=pre 3D, 1=post 3D */
84
85
86/* powerdown control and status bit defines */
87
88/* status */
89#define AC97_PWR_MDM 0x0010 /* Modem section ready */
90#define AC97_PWR_REF 0x0008 /* Vref nominal */
91#define AC97_PWR_ANL 0x0004 /* Analog section ready */
92#define AC97_PWR_DAC 0x0002 /* DAC section ready */
93#define AC97_PWR_ADC 0x0001 /* ADC section ready */
94
95/* control */
96#define AC97_PWR_PR0 0x0100 /* ADC and Mux powerdown */
97#define AC97_PWR_PR1 0x0200 /* DAC powerdown */
98#define AC97_PWR_PR2 0x0400 /* Output mixer powerdown (Vref on) */
99#define AC97_PWR_PR3 0x0800 /* Output mixer powerdown (Vref off) */
100#define AC97_PWR_PR4 0x1000 /* AC-link powerdown */
101#define AC97_PWR_PR5 0x2000 /* Internal Clk disable */
102#define AC97_PWR_PR6 0x4000 /* HP amp powerdown */
103#define AC97_PWR_PR7 0x8000 /* Modem off - if supported */
104
105/* useful power states */
106#define AC97_PWR_D0 0x0000 /* everything on */
107#define AC97_PWR_D1 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR4
108#define AC97_PWR_D2 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4
109#define AC97_PWR_D3 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4
110#define AC97_PWR_ANLOFF AC97_PWR_PR2|AC97_PWR_PR3 /* analog section off */
111
112/* Total number of defined registers. */
113#define AC97_REG_CNT 64
114
115/* Generic AC97 mixer interface. */
116
117/* Structure describing access to the hardware. */
118struct ac97_hwint
119{
120 /* Perform any hardware-specific reset and initialization. Returns
121 0 on success, or a negative error code. */
122 int (*reset_device) (struct ac97_hwint *dev);
123
124 /* Returns the contents of the specified register REG. The caller
125 should check to see if the desired contents are available in
126 the cache first, if applicable. Returns a positive unsigned value
127 representing the contents of the register, or a negative error
128 code. */
129 int (*read_reg) (struct ac97_hwint *dev, u8 reg);
130
131 /* Writes VALUE to register REG. Returns 0 on success, or a
132 negative error code. */
133 int (*write_reg) (struct ac97_hwint *dev, u8 reg, u16 value);
134
135 /* Hardware-specific information. */
136 void *driver_private;
137
138 /* Three OSS masks. */
139 int mixer_devmask;
140 int mixer_stereomask;
141 int mixer_recmask;
142
143 /* The mixer cache. The indices correspond to the AC97 hardware register
144 number / 2, since the register numbers are always an even number.
145
146 Unknown values are set to -1; unsupported registers contain a
147 -2. */
148 int last_written_mixer_values[AC97_REG_CNT];
149
150 /* A cache of values written via OSS; we need these so we can return
151 the values originally written by the user.
152
153 Why the original user values? Because the real-world hardware
154 has less precision, and some existing applications assume that
155 they will get back the exact value that they wrote (aumix).
156
157 A -1 value indicates that no value has been written to this mixer
158 channel via OSS. */
159 int last_written_OSS_values[SOUND_MIXER_NRDEVICES];
160};
161
162/* Values stored in the register cache. */
163#define AC97_REGVAL_UNKNOWN -1
164#define AC97_REG_UNSUPPORTED -2
165
166struct ac97_mixer_value_list
167{
168 /* Mixer channel to set. List is terminated by a value of -1. */
169 int oss_channel;
170 /* The scaled value to set it to; values generally range from 0-100. */
171 union {
172 struct {
173 u8 left, right;
174 } stereo;
175 u8 mono;
176 } value;
177};
178
179/* Initialize the ac97 mixer by resetting it. */
180extern int ac97_init (struct ac97_hwint *dev);
181
182/* Sets the mixer DEV to the values in VALUE_LIST. Returns 0 on success,
183 or a negative error code. */
184extern int ac97_set_values (struct ac97_hwint *dev,
185 struct ac97_mixer_value_list *value_list);
186
187/* Writes the specified VALUE to the AC97 register REG in the mixer.
188 Takes care of setting the last-written cache as well. */
189extern int ac97_put_register (struct ac97_hwint *dev, u8 reg, u16 value);
190
191/* Default ioctl. */
192extern int ac97_mixer_ioctl (struct ac97_hwint *dev, unsigned int cmd,
193 void __user * arg);
194
195#endif
196
197/*
198 * Local variables:
199 * c-basic-offset: 4
200 * End:
201 */
diff --git a/sound/oss/aci.c b/sound/oss/aci.c
deleted file mode 100644
index 3bfac375dbdb..000000000000
--- a/sound/oss/aci.c
+++ /dev/null
@@ -1,712 +0,0 @@
1/*
2 * Audio Command Interface (ACI) driver (sound/aci.c)
3 *
4 * ACI is a protocol used to communicate with the microcontroller on
5 * some sound cards produced by miro, e.g. the miroSOUND PCM12 and
6 * PCM20. The ACI has been developed for miro by Norberto Pellicci
7 * <pellicci@home.com>. Special thanks to both him and miro for
8 * providing the ACI specification.
9 *
10 * The main function of the ACI is to control the mixer and to get a
11 * product identification. On the PCM20, ACI also controls the radio
12 * tuner on this card, this is supported in the Video for Linux
13 * miropcm20 driver.
14 * -
15 * This is a fullfeatured implementation. Unsupported features
16 * are bugs... (:
17 *
18 * It is not longer necessary to load the mad16 module first. The
19 * user is currently responsible to set the mad16 mixer correctly.
20 *
21 * To toggle the solo mode for full duplex operation just use the OSS
22 * record switch for the pcm ('wave') controller. Robert
23 * -
24 *
25 * Revision history:
26 *
27 * 1995-11-10 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
28 * First version written.
29 * 1995-12-31 Markus Kuhn
30 * Second revision, general code cleanup.
31 * 1996-05-16 Hannu Savolainen
32 * Integrated with other parts of the driver.
33 * 1996-05-28 Markus Kuhn
34 * Initialize CS4231A mixer, make ACI first mixer,
35 * use new private mixer API for solo mode.
36 * 1998-08-18 Ruurd Reitsma <R.A.Reitsma@wbmt.tudelft.nl>
37 * Small modification to export ACI functions and
38 * complete modularisation.
39 * 2000-06-20 Robert Siemer <Robert.Siemer@gmx.de>
40 * Don't initialize the CS4231A mixer anymore, so the code is
41 * working again, and other small changes to fit in todays
42 * kernels.
43 * 2000-08-26 Robert Siemer
44 * Clean up and rewrite for 2.4.x. Maybe it's SMP safe now... (:
45 * ioctl bugfix, and integration of solo-mode into OSS-API,
46 * added (OSS-limited) equalizer support, return value bugfix,
47 * changed param aci_reset to reset, new params: ide, wss.
48 * 2001-04-20 Robert Siemer
49 * even more cleanups...
50 * 2001-10-08 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
51 * Get rid of check_region, .bss optimizations, use set_current_state
52 */
53
54#include <linux/kernel.h>
55#include <linux/init.h>
56#include <linux/module.h>
57#include <linux/proc_fs.h>
58#include <linux/slab.h>
59#include <linux/mutex.h>
60
61#include <asm/io.h>
62#include <asm/uaccess.h>
63#include "sound_config.h"
64
65int aci_port; /* as determined by bit 4 in the OPTi 929 MC4 register */
66static int aci_idcode[2]; /* manufacturer and product ID */
67int aci_version; /* ACI firmware version */
68
69EXPORT_SYMBOL(aci_port);
70EXPORT_SYMBOL(aci_version);
71
72#include "aci.h"
73
74
75static int aci_solo; /* status bit of the card that can't be *
76 * checked with ACI versions prior to 0xb0 */
77static int aci_amp; /* status bit for power-amp/line-out level
78 but I have no docs about what is what... */
79static int aci_micpreamp=3; /* microphone preamp-level that can't be *
80 * checked with ACI versions prior to 0xb0 */
81
82static int mixer_device;
83static struct mutex aci_mutex;
84
85#ifdef MODULE
86static int reset;
87module_param(reset, bool, 0);
88MODULE_PARM_DESC(reset,"When set to 1, reset aci mixer.");
89#else
90static int reset = 1;
91#endif
92
93static int ide=-1;
94module_param(ide, int, 0);
95MODULE_PARM_DESC(ide,"1 enable, 0 disable ide-port - untested"
96 " default: do nothing");
97static int wss=-1;
98module_param(wss, int, 0);
99MODULE_PARM_DESC(wss,"change between ACI/WSS-mixer; use 0 and 1 - untested"
100 " default: do nothing; for PCM1-pro only");
101
102#ifdef DEBUG
103static void print_bits(unsigned char c)
104{
105 int j;
106 printk(KERN_DEBUG "aci: ");
107
108 for (j=7; j>=0; j--) {
109 printk("%d", (c >> j) & 0x1);
110 }
111
112 printk("\n");
113}
114#endif
115
116/*
117 * This busy wait code normally requires less than 15 loops and
118 * practically always less than 100 loops on my i486/DX2 66 MHz.
119 *
120 * Warning: Waiting on the general status flag after reseting the MUTE
121 * function can take a VERY long time, because the PCM12 does some kind
122 * of fade-in effect. For this reason, access to the MUTE function has
123 * not been implemented at all.
124 *
125 * - The OSS interface has no mute option. It takes about 3 seconds to
126 * fade-in on my PCM20. busy_wait() handles it great now... Robert
127 */
128
129static int busy_wait(void)
130{
131 #define MINTIME 500
132 long timeout;
133 unsigned char byte;
134
135 for (timeout = 1; timeout <= MINTIME+30; timeout++) {
136 if (((byte=inb(BUSY_REGISTER)) & 1) == 0) {
137 if (timeout >= MINTIME)
138 printk(KERN_DEBUG "aci: Got READYFLAG in round %ld.\n", timeout-MINTIME);
139 return byte;
140 }
141 if (timeout >= MINTIME) {
142 long out=10*HZ;
143 switch (timeout-MINTIME) {
144 case 0 ... 9:
145 out /= 10;
146 case 10 ... 19:
147 out /= 10;
148 case 20 ... 30:
149 out /= 10;
150 default:
151 set_current_state(TASK_UNINTERRUPTIBLE);
152 schedule_timeout(out);
153 break;
154 }
155 }
156 }
157 printk(KERN_WARNING "aci: busy_wait() time out.\n");
158 return -EBUSY;
159}
160
161/* The four ACI command types are fucked up. [-:
162 * implied is: 1w - special case for INIT
163 * write is: 2w1r
164 * read is: x(1w1r) where x is 1 or 2 (1 CHECK_SIG, 1 CHECK_STER,
165 * 1 VERSION, 2 IDCODE)
166 * the command is only in the first write, rest is protocol overhead
167 *
168 * indexed is technically a write and used for STATUS
169 * and the special case for TUNE is: 3w1r
170 *
171 * Here the new general sheme: TUNE --> aci_rw_cmd(x, y, z)
172 * indexed and write --> aci_rw_cmd(x, y, -1)
173 * implied and read (x=1) --> aci_rw_cmd(x, -1, -1)
174 *
175 * Read (x>=2) is not implemented (only used during initialization).
176 * Use aci_idcode[2] and aci_version... Robert
177 */
178
179/* Some notes for error detection: theoretically it is possible.
180 * But it doubles the I/O-traffic from ww(r) to wwwrw(r) in the normal
181 * case and doesn't seem to be designed for that... Robert
182 */
183
184static inline int aci_rawwrite(unsigned char byte)
185{
186 if (busy_wait() >= 0) {
187#ifdef DEBUG
188 printk(KERN_DEBUG "aci_rawwrite(%d)\n", byte);
189#endif
190 outb(byte, COMMAND_REGISTER);
191 return 0;
192 } else
193 return -EBUSY;
194}
195
196static inline int aci_rawread(void)
197{
198 unsigned char byte;
199
200 if (busy_wait() >= 0) {
201 byte=inb(STATUS_REGISTER);
202#ifdef DEBUG
203 printk(KERN_DEBUG "%d = aci_rawread()\n", byte);
204#endif
205 return byte;
206 } else
207 return -EBUSY;
208}
209
210
211int aci_rw_cmd(int write1, int write2, int write3)
212{
213 int write[] = {write1, write2, write3};
214 int read = -EINTR, i;
215
216 if (mutex_lock_interruptible(&aci_mutex))
217 goto out;
218
219 for (i=0; i<3; i++) {
220 if (write[i]< 0 || write[i] > 255)
221 break;
222 else {
223 read = aci_rawwrite(write[i]);
224 if (read < 0)
225 goto out_up;
226 }
227
228 }
229
230 read = aci_rawread();
231out_up: mutex_unlock(&aci_mutex);
232out: return read;
233}
234
235EXPORT_SYMBOL(aci_rw_cmd);
236
237static int setvolume(int __user *arg,
238 unsigned char left_index, unsigned char right_index)
239{
240 int vol, ret, uservol, buf;
241
242 __get_user(uservol, arg);
243
244 /* left channel */
245 vol = uservol & 0xff;
246 if (vol > 100)
247 vol = 100;
248 vol = SCALE(100, 0x20, vol);
249 if ((buf=aci_write_cmd(left_index, 0x20 - vol))<0)
250 return buf;
251 ret = SCALE(0x20, 100, vol);
252
253
254 /* right channel */
255 vol = (uservol >> 8) & 0xff;
256 if (vol > 100)
257 vol = 100;
258 vol = SCALE(100, 0x20, vol);
259 if ((buf=aci_write_cmd(right_index, 0x20 - vol))<0)
260 return buf;
261 ret |= SCALE(0x20, 100, vol) << 8;
262
263 __put_user(ret, arg);
264
265 return 0;
266}
267
268static int getvolume(int __user *arg,
269 unsigned char left_index, unsigned char right_index)
270{
271 int vol;
272 int buf;
273
274 /* left channel */
275 if ((buf=aci_indexed_cmd(ACI_STATUS, left_index))<0)
276 return buf;
277 vol = SCALE(0x20, 100, buf < 0x20 ? 0x20-buf : 0);
278
279 /* right channel */
280 if ((buf=aci_indexed_cmd(ACI_STATUS, right_index))<0)
281 return buf;
282 vol |= SCALE(0x20, 100, buf < 0x20 ? 0x20-buf : 0) << 8;
283
284 __put_user(vol, arg);
285
286 return 0;
287}
288
289
290/* The equalizer is somewhat strange on the ACI. From -12dB to +12dB
291 * write: 0xff..down.to..0x80==0x00..up.to..0x7f
292 */
293
294static inline unsigned int eq_oss2aci(unsigned int vol)
295{
296 int boost=0;
297 unsigned int ret;
298
299 if (vol > 100)
300 vol = 100;
301 if (vol > 50) {
302 vol -= 51;
303 boost=1;
304 }
305 if (boost)
306 ret=SCALE(49, 0x7e, vol)+1;
307 else
308 ret=0xff - SCALE(50, 0x7f, vol);
309 return ret;
310}
311
312static inline unsigned int eq_aci2oss(unsigned int vol)
313{
314 if (vol < 0x80)
315 return SCALE(0x7f, 50, vol) + 50;
316 else
317 return SCALE(0x7f, 50, 0xff-vol);
318}
319
320
321static int setequalizer(int __user *arg,
322 unsigned char left_index, unsigned char right_index)
323{
324 int buf;
325 unsigned int vol;
326
327 __get_user(vol, arg);
328
329 /* left channel */
330 if ((buf=aci_write_cmd(left_index, eq_oss2aci(vol & 0xff)))<0)
331 return buf;
332
333 /* right channel */
334 if ((buf=aci_write_cmd(right_index, eq_oss2aci((vol>>8) & 0xff)))<0)
335 return buf;
336
337 /* the ACI equalizer is more precise */
338 return 0;
339}
340
341static int getequalizer(int __user *arg,
342 unsigned char left_index, unsigned char right_index)
343{
344 int buf;
345 unsigned int vol;
346
347 /* left channel */
348 if ((buf=aci_indexed_cmd(ACI_STATUS, left_index))<0)
349 return buf;
350 vol = eq_aci2oss(buf);
351
352 /* right channel */
353 if ((buf=aci_indexed_cmd(ACI_STATUS, right_index))<0)
354 return buf;
355 vol |= eq_aci2oss(buf) << 8;
356
357 __put_user(vol, arg);
358
359 return 0;
360}
361
362static int aci_mixer_ioctl (int dev, unsigned int cmd, void __user * arg)
363{
364 int vol, buf;
365 int __user *p = arg;
366
367 switch (cmd) {
368 case SOUND_MIXER_WRITE_VOLUME:
369 return setvolume(p, 0x01, 0x00);
370 case SOUND_MIXER_WRITE_CD:
371 return setvolume(p, 0x3c, 0x34);
372 case SOUND_MIXER_WRITE_MIC:
373 return setvolume(p, 0x38, 0x30);
374 case SOUND_MIXER_WRITE_LINE:
375 return setvolume(p, 0x39, 0x31);
376 case SOUND_MIXER_WRITE_SYNTH:
377 return setvolume(p, 0x3b, 0x33);
378 case SOUND_MIXER_WRITE_PCM:
379 return setvolume(p, 0x3a, 0x32);
380 case MIXER_WRITE(SOUND_MIXER_RADIO): /* fall through */
381 case SOUND_MIXER_WRITE_LINE1: /* AUX1 or radio */
382 return setvolume(p, 0x3d, 0x35);
383 case SOUND_MIXER_WRITE_LINE2: /* AUX2 */
384 return setvolume(p, 0x3e, 0x36);
385 case SOUND_MIXER_WRITE_BASS: /* set band one and two */
386 if (aci_idcode[1]=='C') {
387 if ((buf=setequalizer(p, 0x48, 0x40)) ||
388 (buf=setequalizer(p, 0x49, 0x41)));
389 return buf;
390 }
391 break;
392 case SOUND_MIXER_WRITE_TREBLE: /* set band six and seven */
393 if (aci_idcode[1]=='C') {
394 if ((buf=setequalizer(p, 0x4d, 0x45)) ||
395 (buf=setequalizer(p, 0x4e, 0x46)));
396 return buf;
397 }
398 break;
399 case SOUND_MIXER_WRITE_IGAIN: /* MIC pre-amp */
400 if (aci_idcode[1]=='B' || aci_idcode[1]=='C') {
401 __get_user(vol, p);
402 vol = vol & 0xff;
403 if (vol > 100)
404 vol = 100;
405 vol = SCALE(100, 3, vol);
406 if ((buf=aci_write_cmd(ACI_WRITE_IGAIN, vol))<0)
407 return buf;
408 aci_micpreamp = vol;
409 vol = SCALE(3, 100, vol);
410 vol |= (vol << 8);
411 __put_user(vol, p);
412 return 0;
413 }
414 break;
415 case SOUND_MIXER_WRITE_OGAIN: /* Power-amp/line-out level */
416 if (aci_idcode[1]=='A' || aci_idcode[1]=='B') {
417 __get_user(buf, p);
418 buf = buf & 0xff;
419 if (buf > 50)
420 vol = 1;
421 else
422 vol = 0;
423 if ((buf=aci_write_cmd(ACI_SET_POWERAMP, vol))<0)
424 return buf;
425 aci_amp = vol;
426 if (aci_amp)
427 buf = (100 || 100<<8);
428 else
429 buf = 0;
430 __put_user(buf, p);
431 return 0;
432 }
433 break;
434 case SOUND_MIXER_WRITE_RECSRC:
435 /* handle solo mode control */
436 __get_user(buf, p);
437 /* unset solo when RECSRC for PCM is requested */
438 if (aci_idcode[1]=='B' || aci_idcode[1]=='C') {
439 vol = !(buf & SOUND_MASK_PCM);
440 if ((buf=aci_write_cmd(ACI_SET_SOLOMODE, vol))<0)
441 return buf;
442 aci_solo = vol;
443 }
444 buf = (SOUND_MASK_CD| SOUND_MASK_MIC| SOUND_MASK_LINE|
445 SOUND_MASK_SYNTH| SOUND_MASK_LINE2);
446 if (aci_idcode[1] == 'C') /* PCM20 radio */
447 buf |= SOUND_MASK_RADIO;
448 else
449 buf |= SOUND_MASK_LINE1;
450 if (!aci_solo)
451 buf |= SOUND_MASK_PCM;
452 __put_user(buf, p);
453 return 0;
454 case SOUND_MIXER_READ_DEVMASK:
455 buf = (SOUND_MASK_VOLUME | SOUND_MASK_CD |
456 SOUND_MASK_MIC | SOUND_MASK_LINE |
457 SOUND_MASK_SYNTH | SOUND_MASK_PCM |
458 SOUND_MASK_LINE2);
459 switch (aci_idcode[1]) {
460 case 'C': /* PCM20 radio */
461 buf |= (SOUND_MASK_RADIO | SOUND_MASK_IGAIN |
462 SOUND_MASK_BASS | SOUND_MASK_TREBLE);
463 break;
464 case 'B': /* PCM12 */
465 buf |= (SOUND_MASK_LINE1 | SOUND_MASK_IGAIN |
466 SOUND_MASK_OGAIN);
467 break;
468 case 'A': /* PCM1-pro */
469 buf |= (SOUND_MASK_LINE1 | SOUND_MASK_OGAIN);
470 break;
471 default:
472 buf |= SOUND_MASK_LINE1;
473 }
474 __put_user(buf, p);
475 return 0;
476 case SOUND_MIXER_READ_STEREODEVS:
477 buf = (SOUND_MASK_VOLUME | SOUND_MASK_CD |
478 SOUND_MASK_MIC | SOUND_MASK_LINE |
479 SOUND_MASK_SYNTH | SOUND_MASK_PCM |
480 SOUND_MASK_LINE2);
481 switch (aci_idcode[1]) {
482 case 'C': /* PCM20 radio */
483 buf |= (SOUND_MASK_RADIO |
484 SOUND_MASK_BASS | SOUND_MASK_TREBLE);
485 break;
486 default:
487 buf |= SOUND_MASK_LINE1;
488 }
489 __put_user(buf, p);
490 return 0;
491 case SOUND_MIXER_READ_RECMASK:
492 buf = (SOUND_MASK_CD| SOUND_MASK_MIC| SOUND_MASK_LINE|
493 SOUND_MASK_SYNTH| SOUND_MASK_LINE2| SOUND_MASK_PCM);
494 if (aci_idcode[1] == 'C') /* PCM20 radio */
495 buf |= SOUND_MASK_RADIO;
496 else
497 buf |= SOUND_MASK_LINE1;
498
499 __put_user(buf, p);
500 return 0;
501 case SOUND_MIXER_READ_RECSRC:
502 buf = (SOUND_MASK_CD | SOUND_MASK_MIC | SOUND_MASK_LINE |
503 SOUND_MASK_SYNTH | SOUND_MASK_LINE2);
504 /* do we need aci_solo or can I get it from the ACI? */
505 switch (aci_idcode[1]) {
506 case 'B': /* PCM12 */
507 case 'C': /* PCM20 radio */
508 if (aci_version >= 0xb0) {
509 if ((vol=aci_rw_cmd(ACI_STATUS,
510 ACI_S_GENERAL, -1))<0)
511 return vol;
512 if (vol & 0x20)
513 buf |= SOUND_MASK_PCM;
514 }
515 else
516 if (!aci_solo)
517 buf |= SOUND_MASK_PCM;
518 break;
519 default:
520 buf |= SOUND_MASK_PCM;
521 }
522 if (aci_idcode[1] == 'C') /* PCM20 radio */
523 buf |= SOUND_MASK_RADIO;
524 else
525 buf |= SOUND_MASK_LINE1;
526
527 __put_user(buf, p);
528 return 0;
529 case SOUND_MIXER_READ_CAPS:
530 __put_user(0, p);
531 return 0;
532 case SOUND_MIXER_READ_VOLUME:
533 return getvolume(p, 0x04, 0x03);
534 case SOUND_MIXER_READ_CD:
535 return getvolume(p, 0x0a, 0x09);
536 case SOUND_MIXER_READ_MIC:
537 return getvolume(p, 0x06, 0x05);
538 case SOUND_MIXER_READ_LINE:
539 return getvolume(p, 0x08, 0x07);
540 case SOUND_MIXER_READ_SYNTH:
541 return getvolume(p, 0x0c, 0x0b);
542 case SOUND_MIXER_READ_PCM:
543 return getvolume(p, 0x0e, 0x0d);
544 case MIXER_READ(SOUND_MIXER_RADIO): /* fall through */
545 case SOUND_MIXER_READ_LINE1: /* AUX1 */
546 return getvolume(p, 0x11, 0x10);
547 case SOUND_MIXER_READ_LINE2: /* AUX2 */
548 return getvolume(p, 0x13, 0x12);
549 case SOUND_MIXER_READ_BASS: /* get band one */
550 if (aci_idcode[1]=='C') {
551 return getequalizer(p, 0x23, 0x22);
552 }
553 break;
554 case SOUND_MIXER_READ_TREBLE: /* get band seven */
555 if (aci_idcode[1]=='C') {
556 return getequalizer(p, 0x2f, 0x2e);
557 }
558 break;
559 case SOUND_MIXER_READ_IGAIN: /* MIC pre-amp */
560 if (aci_idcode[1]=='B' || aci_idcode[1]=='C') {
561 /* aci_micpreamp or ACI? */
562 if (aci_version >= 0xb0) {
563 if ((buf=aci_indexed_cmd(ACI_STATUS,
564 ACI_S_READ_IGAIN))<0)
565 return buf;
566 }
567 else
568 buf=aci_micpreamp;
569 vol = SCALE(3, 100, buf <= 3 ? buf : 3);
570 vol |= vol << 8;
571 __put_user(vol, p);
572 return 0;
573 }
574 break;
575 case SOUND_MIXER_READ_OGAIN:
576 if (aci_amp)
577 buf = (100 || 100<<8);
578 else
579 buf = 0;
580 __put_user(buf, p);
581 return 0;
582 }
583 return -EINVAL;
584}
585
586static struct mixer_operations aci_mixer_operations =
587{
588 .owner = THIS_MODULE,
589 .id = "ACI",
590 .ioctl = aci_mixer_ioctl
591};
592
593/*
594 * There is also an internal mixer in the codec (CS4231A or AD1845),
595 * that deserves no purpose in an ACI based system which uses an
596 * external ACI controlled stereo mixer. Make sure that this codec
597 * mixer has the AUX1 input selected as the recording source, that the
598 * input gain is set near maximum and that the other channels going
599 * from the inputs to the codec output are muted.
600 */
601
602static int __init attach_aci(void)
603{
604 char *boardname;
605 int i, rc = -EBUSY;
606
607 mutex_init(&aci_mutex);
608
609 outb(0xE3, 0xf8f); /* Write MAD16 password */
610 aci_port = (inb(0xf90) & 0x10) ?
611 0x344: 0x354; /* Get aci_port from MC4_PORT */
612
613 if (!request_region(aci_port, 3, "sound mixer (ACI)")) {
614 printk(KERN_NOTICE
615 "aci: I/O area 0x%03x-0x%03x already used.\n",
616 aci_port, aci_port+2);
617 goto out;
618 }
619
620 /* force ACI into a known state */
621 rc = -EFAULT;
622 for (i=0; i<3; i++)
623 if (aci_rw_cmd(ACI_ERROR_OP, -1, -1)<0)
624 goto out_release_region;
625
626 /* official this is one aci read call: */
627 rc = -EFAULT;
628 if ((aci_idcode[0]=aci_rw_cmd(ACI_READ_IDCODE, -1, -1))<0 ||
629 (aci_idcode[1]=aci_rw_cmd(ACI_READ_IDCODE, -1, -1))<0) {
630 printk(KERN_ERR "aci: Failed to read idcode on 0x%03x.\n",
631 aci_port);
632 goto out_release_region;
633 }
634
635 if ((aci_version=aci_rw_cmd(ACI_READ_VERSION, -1, -1))<0) {
636 printk(KERN_ERR "aci: Failed to read version on 0x%03x.\n",
637 aci_port);
638 goto out_release_region;
639 }
640
641 if (aci_idcode[0] == 'm') {
642 /* It looks like a miro sound card. */
643 switch (aci_idcode[1]) {
644 case 'A':
645 boardname = "PCM1 pro / early PCM12";
646 break;
647 case 'B':
648 boardname = "PCM12";
649 break;
650 case 'C':
651 boardname = "PCM20 radio";
652 break;
653 default:
654 boardname = "unknown miro";
655 }
656 } else {
657 printk(KERN_WARNING "aci: Warning: unsupported card! - "
658 "no hardware, no specs...\n");
659 boardname = "unknown Cardinal Technologies";
660 }
661
662 printk(KERN_INFO "<ACI 0x%02x, id %02x/%02x \"%c/%c\", (%s)> at 0x%03x\n",
663 aci_version,
664 aci_idcode[0], aci_idcode[1],
665 aci_idcode[0], aci_idcode[1],
666 boardname, aci_port);
667
668 rc = -EBUSY;
669 if (reset) {
670 /* first write()s after reset fail with my PCM20 */
671 if (aci_rw_cmd(ACI_INIT, -1, -1)<0 ||
672 aci_rw_cmd(ACI_ERROR_OP, ACI_ERROR_OP, ACI_ERROR_OP)<0 ||
673 aci_rw_cmd(ACI_ERROR_OP, ACI_ERROR_OP, ACI_ERROR_OP)<0)
674 goto out_release_region;
675 }
676
677 /* the PCM20 is muted after reset (and reboot) */
678 if (aci_rw_cmd(ACI_SET_MUTE, 0x00, -1)<0)
679 goto out_release_region;
680
681 if (ide>=0)
682 if (aci_rw_cmd(ACI_SET_IDE, !ide, -1)<0)
683 goto out_release_region;
684
685 if (wss>=0 && aci_idcode[1]=='A')
686 if (aci_rw_cmd(ACI_SET_WSS, !!wss, -1)<0)
687 goto out_release_region;
688
689 mixer_device = sound_install_mixer(MIXER_DRIVER_VERSION, boardname,
690 &aci_mixer_operations,
691 sizeof(aci_mixer_operations), NULL);
692 rc = 0;
693 if (mixer_device < 0) {
694 printk(KERN_ERR "aci: Failed to install mixer.\n");
695 rc = mixer_device;
696 goto out_release_region;
697 } /* else Maybe initialize the CS4231A mixer here... */
698out: return rc;
699out_release_region:
700 release_region(aci_port, 3);
701 goto out;
702}
703
704static void __exit unload_aci(void)
705{
706 sound_unload_mixerdev(mixer_device);
707 release_region(aci_port, 3);
708}
709
710module_init(attach_aci);
711module_exit(unload_aci);
712MODULE_LICENSE("GPL");
diff --git a/sound/oss/aci.h b/sound/oss/aci.h
deleted file mode 100644
index 20102ee088eb..000000000000
--- a/sound/oss/aci.h
+++ /dev/null
@@ -1,57 +0,0 @@
1#ifndef _ACI_H_
2#define _ACI_H_
3
4extern int aci_port;
5extern int aci_version; /* ACI firmware version */
6extern int aci_rw_cmd(int write1, int write2, int write3);
7
8#define aci_indexed_cmd(a, b) aci_rw_cmd(a, b, -1)
9#define aci_write_cmd(a, b) aci_rw_cmd(a, b, -1)
10#define aci_read_cmd(a) aci_rw_cmd(a,-1, -1)
11
12#define COMMAND_REGISTER (aci_port) /* write register */
13#define STATUS_REGISTER (aci_port + 1) /* read register */
14#define BUSY_REGISTER (aci_port + 2) /* also used for rds */
15
16#define RDS_REGISTER BUSY_REGISTER
17
18#define ACI_SET_MUTE 0x0d
19#define ACI_SET_POWERAMP 0x0f
20#define ACI_SET_TUNERMUTE 0xa3
21#define ACI_SET_TUNERMONO 0xa4
22#define ACI_SET_IDE 0xd0
23#define ACI_SET_WSS 0xd1
24#define ACI_SET_SOLOMODE 0xd2
25#define ACI_WRITE_IGAIN 0x03
26#define ACI_WRITE_TUNE 0xa7
27#define ACI_READ_TUNERSTEREO 0xa8
28#define ACI_READ_TUNERSTATION 0xa9
29#define ACI_READ_VERSION 0xf1
30#define ACI_READ_IDCODE 0xf2
31#define ACI_INIT 0xff
32#define ACI_STATUS 0xf0
33#define ACI_S_GENERAL 0x00
34#define ACI_S_READ_IGAIN 0x21
35#define ACI_ERROR_OP 0xdf
36
37/*
38 * The following macro SCALE can be used to scale one integer volume
39 * value into another one using only integer arithmetic. If the input
40 * value x is in the range 0 <= x <= xmax, then the result will be in
41 * the range 0 <= SCALE(xmax,ymax,x) <= ymax.
42 *
43 * This macro has for all xmax, ymax > 0 and all 0 <= x <= xmax the
44 * following nice properties:
45 *
46 * - SCALE(xmax,ymax,xmax) = ymax
47 * - SCALE(xmax,ymax,0) = 0
48 * - SCALE(xmax,ymax,SCALE(ymax,xmax,SCALE(xmax,ymax,x))) = SCALE(xmax,ymax,x)
49 *
50 * In addition, the rounding error is minimal and nicely distributed.
51 * The proofs are left as an exercise to the reader.
52 */
53
54#define SCALE(xmax,ymax,x) (((x)*(ymax)+(xmax)/2)/(xmax))
55
56
57#endif /* _ACI_H_ */
diff --git a/sound/oss/ad1816.c b/sound/oss/ad1816.c
deleted file mode 100644
index caabf31193f7..000000000000
--- a/sound/oss/ad1816.c
+++ /dev/null
@@ -1,1368 +0,0 @@
1/*
2 *
3 * AD1816 lowlevel sound driver for Linux 2.6.0 and above
4 *
5 * Copyright (C) 1998-2003 by Thorsten Knabe <linux@thorsten-knabe.de>
6 *
7 * Based on the CS4232/AD1848 driver Copyright (C) by Hannu Savolainen 1993-1996
8 *
9 *
10 * version: 1.5
11 * status: beta
12 * date: 2003/07/15
13 *
14 * Changes:
15 * Oleg Drokin: Some cleanup of load/unload functions. 1998/11/24
16 *
17 * Thorsten Knabe: attach and unload rewritten,
18 * some argument checks added 1998/11/30
19 *
20 * Thorsten Knabe: Buggy isa bridge workaround added 1999/01/16
21 *
22 * David Moews/Thorsten Knabe: Introduced options
23 * parameter. Added slightly modified patch from
24 * David Moews to disable dsp audio sources by setting
25 * bit 0 of options parameter. This seems to be
26 * required by some Aztech/Newcom SC-16 cards. 1999/04/18
27 *
28 * Christoph Hellwig: Adapted to module_init/module_exit. 2000/03/03
29 *
30 * Christoph Hellwig: Added isapnp support 2000/03/15
31 *
32 * Arnaldo Carvalho de Melo: get rid of check_region 2001/10/07
33 *
34 * Thorsten Knabe: Compiling with CONFIG_PNP enabled
35 * works again. It is now possible to use more than one
36 * AD1816 sound card. Sample rate now may be changed during
37 * playback/capture. printk() uses log levels everywhere.
38 * SMP fixes. DMA handling fixes.
39 * Other minor code cleanup. 2003/07/15
40 *
41 */
42
43
44#include <linux/module.h>
45#include <linux/init.h>
46#include <linux/interrupt.h>
47#include <linux/isapnp.h>
48#include <linux/stddef.h>
49#include <linux/spinlock.h>
50#include "sound_config.h"
51
52#define DEBUGNOISE(x)
53
54#define CHECK_FOR_POWER { int timeout=100; \
55 while (timeout > 0 && (inb(devc->base)&0x80)!= 0x80) {\
56 timeout--; \
57 } \
58 if (timeout==0) {\
59 printk(KERN_WARNING "ad1816: Check for power failed in %s line: %d\n",__FILE__,__LINE__); \
60 } \
61}
62
63/* structure to hold device specific information */
64typedef struct
65{
66 int base; /* set in attach */
67 int irq;
68 int dma_playback;
69 int dma_capture;
70
71 int opened; /* open */
72 int speed;
73 int channels;
74 int audio_format;
75 int audio_mode;
76
77 int recmask; /* setup */
78 unsigned char format_bits;
79 int supported_devices;
80 int supported_rec_devices;
81 unsigned short levels[SOUND_MIXER_NRDEVICES];
82 /* misc */
83 struct pnp_dev *pnpdev; /* configured via pnp */
84 int dev_no; /* this is the # in audio_devs and NOT
85 in ad1816_info */
86 spinlock_t lock;
87} ad1816_info;
88
89static int nr_ad1816_devs;
90static int ad1816_clockfreq = 33000;
91static int options;
92
93/* supported audio formats */
94static int ad_format_mask =
95AFMT_U8 | AFMT_S16_LE | AFMT_S16_BE | AFMT_MU_LAW | AFMT_A_LAW;
96
97/* array of device info structures */
98static ad1816_info dev_info[MAX_AUDIO_DEV];
99
100
101/* ------------------------------------------------------------------- */
102
103/* functions for easier access to inderect registers */
104
105static int ad_read (ad1816_info * devc, int reg)
106{
107 int result;
108
109 CHECK_FOR_POWER;
110 outb ((unsigned char) (reg & 0x3f), devc->base+0);
111 result = inb(devc->base+2);
112 result+= inb(devc->base+3)<<8;
113 return (result);
114}
115
116
117static void ad_write (ad1816_info * devc, int reg, int data)
118{
119 CHECK_FOR_POWER;
120 outb ((unsigned char) (reg & 0xff), devc->base+0);
121 outb ((unsigned char) (data & 0xff),devc->base+2);
122 outb ((unsigned char) ((data>>8)&0xff),devc->base+3);
123}
124
125/* ------------------------------------------------------------------- */
126
127/* function interface required by struct audio_driver */
128
129static void ad1816_halt_input (int dev)
130{
131 unsigned long flags;
132 ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc;
133 unsigned char buffer;
134
135 DEBUGNOISE(printk(KERN_DEBUG "ad1816: halt_input called\n"));
136
137 spin_lock_irqsave(&devc->lock,flags);
138
139 if(!isa_dma_bridge_buggy) {
140 disable_dma(audio_devs[dev]->dmap_in->dma);
141 }
142
143 buffer=inb(devc->base+9);
144 if (buffer & 0x01) {
145 /* disable capture */
146 outb(buffer & ~0x01,devc->base+9);
147 }
148
149 if(!isa_dma_bridge_buggy) {
150 enable_dma(audio_devs[dev]->dmap_in->dma);
151 }
152
153 /* Clear interrupt status */
154 outb (~0x40, devc->base+1);
155
156 devc->audio_mode &= ~PCM_ENABLE_INPUT;
157 spin_unlock_irqrestore(&devc->lock,flags);
158}
159
160static void ad1816_halt_output (int dev)
161{
162 unsigned long flags;
163 ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc;
164
165 unsigned char buffer;
166
167 DEBUGNOISE(printk(KERN_DEBUG "ad1816: halt_output called!\n"));
168
169 spin_lock_irqsave(&devc->lock,flags);
170 /* Mute pcm output */
171 ad_write(devc, 4, ad_read(devc,4)|0x8080);
172
173 if(!isa_dma_bridge_buggy) {
174 disable_dma(audio_devs[dev]->dmap_out->dma);
175 }
176
177 buffer=inb(devc->base+8);
178 if (buffer & 0x01) {
179 /* disable capture */
180 outb(buffer & ~0x01,devc->base+8);
181 }
182
183 if(!isa_dma_bridge_buggy) {
184 enable_dma(audio_devs[dev]->dmap_out->dma);
185 }
186
187 /* Clear interrupt status */
188 outb ((unsigned char)~0x80, devc->base+1);
189
190 devc->audio_mode &= ~PCM_ENABLE_OUTPUT;
191 spin_unlock_irqrestore(&devc->lock,flags);
192}
193
194static void ad1816_output_block (int dev, unsigned long buf,
195 int count, int intrflag)
196{
197 unsigned long flags;
198 unsigned long cnt;
199 ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc;
200
201 DEBUGNOISE(printk(KERN_DEBUG "ad1816: output_block called buf=%ld count=%d flags=%d\n",buf,count,intrflag));
202
203 cnt = count/4 - 1;
204
205 spin_lock_irqsave(&devc->lock,flags);
206
207 /* set transfer count */
208 ad_write (devc, 8, cnt & 0xffff);
209
210 devc->audio_mode |= PCM_ENABLE_OUTPUT;
211 spin_unlock_irqrestore(&devc->lock,flags);
212}
213
214
215static void ad1816_start_input (int dev, unsigned long buf, int count,
216 int intrflag)
217{
218 unsigned long flags;
219 unsigned long cnt;
220 ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc;
221
222 DEBUGNOISE(printk(KERN_DEBUG "ad1816: start_input called buf=%ld count=%d flags=%d\n",buf,count,intrflag));
223
224 cnt = count/4 - 1;
225
226 spin_lock_irqsave(&devc->lock,flags);
227
228 /* set transfer count */
229 ad_write (devc, 10, cnt & 0xffff);
230 devc->audio_mode |= PCM_ENABLE_INPUT;
231 spin_unlock_irqrestore(&devc->lock,flags);
232}
233
234static int ad1816_prepare_for_input (int dev, int bsize, int bcount)
235{
236 unsigned long flags;
237 unsigned int freq;
238 ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc;
239 unsigned char fmt_bits;
240
241 DEBUGNOISE(printk(KERN_DEBUG "ad1816: prepare_for_input called: bsize=%d bcount=%d\n",bsize,bcount));
242
243 spin_lock_irqsave(&devc->lock,flags);
244 fmt_bits= (devc->format_bits&0x7)<<3;
245
246 /* set mono/stereo mode */
247 if (devc->channels > 1) {
248 fmt_bits |=0x4;
249 }
250 /* set Mono/Stereo in playback/capture register */
251 outb( (inb(devc->base+8) & ~0x3C)|fmt_bits, devc->base+8);
252 outb( (inb(devc->base+9) & ~0x3C)|fmt_bits, devc->base+9);
253
254 freq=((unsigned int)devc->speed*33000)/ad1816_clockfreq;
255
256 /* write playback/capture speeds */
257 ad_write (devc, 2, freq & 0xffff);
258 ad_write (devc, 3, freq & 0xffff);
259
260 spin_unlock_irqrestore(&devc->lock,flags);
261
262 ad1816_halt_input(dev);
263 return 0;
264}
265
266static int ad1816_prepare_for_output (int dev, int bsize, int bcount)
267{
268 unsigned long flags;
269 unsigned int freq;
270 ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc;
271 unsigned char fmt_bits;
272
273 DEBUGNOISE(printk(KERN_DEBUG "ad1816: prepare_for_output called: bsize=%d bcount=%d\n",bsize,bcount));
274
275 spin_lock_irqsave(&devc->lock,flags);
276
277 fmt_bits= (devc->format_bits&0x7)<<3;
278 /* set mono/stereo mode */
279 if (devc->channels > 1) {
280 fmt_bits |=0x4;
281 }
282
283 /* write format bits to playback/capture registers */
284 outb( (inb(devc->base+8) & ~0x3C)|fmt_bits, devc->base+8);
285 outb( (inb(devc->base+9) & ~0x3C)|fmt_bits, devc->base+9);
286
287 freq=((unsigned int)devc->speed*33000)/ad1816_clockfreq;
288
289 /* write playback/capture speeds */
290 ad_write (devc, 2, freq & 0xffff);
291 ad_write (devc, 3, freq & 0xffff);
292
293 spin_unlock_irqrestore(&devc->lock,flags);
294
295 ad1816_halt_output(dev);
296 return 0;
297
298}
299
300static void ad1816_trigger (int dev, int state)
301{
302 unsigned long flags;
303 ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc;
304
305 DEBUGNOISE(printk(KERN_DEBUG "ad1816: trigger called! (devc=%d,devc->base=%d\n", devc, devc->base));
306
307 /* mode may have changed */
308
309 spin_lock_irqsave(&devc->lock,flags);
310
311 /* mask out modes not specified on open call */
312 state &= devc->audio_mode;
313
314 /* setup soundchip to new io-mode */
315 if (state & PCM_ENABLE_INPUT) {
316 /* enable capture */
317 outb(inb(devc->base+9)|0x01, devc->base+9);
318 } else {
319 /* disable capture */
320 outb(inb(devc->base+9)&~0x01, devc->base+9);
321 }
322
323 if (state & PCM_ENABLE_OUTPUT) {
324 /* enable playback */
325 outb(inb(devc->base+8)|0x01, devc->base+8);
326 /* unmute pcm output */
327 ad_write(devc, 4, ad_read(devc,4)&~0x8080);
328 } else {
329 /* mute pcm output */
330 ad_write(devc, 4, ad_read(devc,4)|0x8080);
331 /* disable capture */
332 outb(inb(devc->base+8)&~0x01, devc->base+8);
333 }
334 spin_unlock_irqrestore(&devc->lock,flags);
335}
336
337
338/* halt input & output */
339static void ad1816_halt (int dev)
340{
341 ad1816_halt_input(dev);
342 ad1816_halt_output(dev);
343}
344
345static void ad1816_reset (int dev)
346{
347 ad1816_halt (dev);
348}
349
350/* set playback speed */
351static int ad1816_set_speed (int dev, int arg)
352{
353 unsigned long flags;
354 unsigned int freq;
355 int ret;
356
357 ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc;
358
359 spin_lock_irqsave(&devc->lock, flags);
360 if (arg == 0) {
361 ret = devc->speed;
362 spin_unlock_irqrestore(&devc->lock, flags);
363 return ret;
364 }
365 /* range checking */
366 if (arg < 4000) {
367 arg = 4000;
368 }
369 if (arg > 55000) {
370 arg = 55000;
371 }
372 devc->speed = arg;
373
374 /* change speed during playback */
375 freq=((unsigned int)devc->speed*33000)/ad1816_clockfreq;
376 /* write playback/capture speeds */
377 ad_write (devc, 2, freq & 0xffff);
378 ad_write (devc, 3, freq & 0xffff);
379
380 ret = devc->speed;
381 spin_unlock_irqrestore(&devc->lock, flags);
382 return ret;
383
384}
385
386static unsigned int ad1816_set_bits (int dev, unsigned int arg)
387{
388 unsigned long flags;
389 ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc;
390
391 static struct format_tbl {
392 int format;
393 unsigned char bits;
394 } format2bits[] = {
395 { 0, 0 },
396 { AFMT_MU_LAW, 1 },
397 { AFMT_A_LAW, 3 },
398 { AFMT_IMA_ADPCM, 0 },
399 { AFMT_U8, 0 },
400 { AFMT_S16_LE, 2 },
401 { AFMT_S16_BE, 6 },
402 { AFMT_S8, 0 },
403 { AFMT_U16_LE, 0 },
404 { AFMT_U16_BE, 0 }
405 };
406
407 int i, n = sizeof (format2bits) / sizeof (struct format_tbl);
408
409 spin_lock_irqsave(&devc->lock, flags);
410 /* return current format */
411 if (arg == 0) {
412 arg = devc->audio_format;
413 spin_unlock_irqrestore(&devc->lock, flags);
414 return arg;
415 }
416 devc->audio_format = arg;
417
418 /* search matching format bits */
419 for (i = 0; i < n; i++)
420 if (format2bits[i].format == arg) {
421 devc->format_bits = format2bits[i].bits;
422 devc->audio_format = arg;
423 spin_unlock_irqrestore(&devc->lock, flags);
424 return arg;
425 }
426
427 /* Still hanging here. Something must be terribly wrong */
428 devc->format_bits = 0;
429 devc->audio_format = AFMT_U8;
430 spin_unlock_irqrestore(&devc->lock, flags);
431 return(AFMT_U8);
432}
433
434static short ad1816_set_channels (int dev, short arg)
435{
436 ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc;
437
438 if (arg != 1 && arg != 2)
439 return devc->channels;
440
441 devc->channels = arg;
442 return arg;
443}
444
445/* open device */
446static int ad1816_open (int dev, int mode)
447{
448 ad1816_info *devc = NULL;
449 unsigned long flags;
450
451 /* is device number valid ? */
452 if (dev < 0 || dev >= num_audiodevs)
453 return -(ENXIO);
454
455 /* get device info of this dev */
456 devc = (ad1816_info *) audio_devs[dev]->devc;
457
458 /* make check if device already open atomic */
459 spin_lock_irqsave(&devc->lock,flags);
460
461 if (devc->opened) {
462 spin_unlock_irqrestore(&devc->lock,flags);
463 return -(EBUSY);
464 }
465
466 /* mark device as open */
467 devc->opened = 1;
468
469 devc->audio_mode = 0;
470 devc->speed = 8000;
471 devc->audio_format=AFMT_U8;
472 devc->channels=1;
473 spin_unlock_irqrestore(&devc->lock,flags);
474 ad1816_reset(devc->dev_no); /* halt all pending output */
475 return 0;
476}
477
478static void ad1816_close (int dev) /* close device */
479{
480 unsigned long flags;
481 ad1816_info *devc = (ad1816_info *) audio_devs[dev]->devc;
482
483 /* halt all pending output */
484 ad1816_reset(devc->dev_no);
485
486 spin_lock_irqsave(&devc->lock,flags);
487 devc->opened = 0;
488 devc->audio_mode = 0;
489 devc->speed = 8000;
490 devc->audio_format=AFMT_U8;
491 devc->format_bits = 0;
492 spin_unlock_irqrestore(&devc->lock,flags);
493}
494
495
496/* ------------------------------------------------------------------- */
497
498/* Audio driver structure */
499
500static struct audio_driver ad1816_audio_driver =
501{
502 .owner = THIS_MODULE,
503 .open = ad1816_open,
504 .close = ad1816_close,
505 .output_block = ad1816_output_block,
506 .start_input = ad1816_start_input,
507 .prepare_for_input = ad1816_prepare_for_input,
508 .prepare_for_output = ad1816_prepare_for_output,
509 .halt_io = ad1816_halt,
510 .halt_input = ad1816_halt_input,
511 .halt_output = ad1816_halt_output,
512 .trigger = ad1816_trigger,
513 .set_speed = ad1816_set_speed,
514 .set_bits = ad1816_set_bits,
515 .set_channels = ad1816_set_channels,
516};
517
518
519/* ------------------------------------------------------------------- */
520
521/* Interrupt handler */
522
523
524static irqreturn_t ad1816_interrupt (int irq, void *dev_id)
525{
526 unsigned char status;
527 ad1816_info *devc = (ad1816_info *)dev_id;
528
529 if (irq < 0 || irq > 15) {
530 printk(KERN_WARNING "ad1816: Got bogus interrupt %d\n", irq);
531 return IRQ_NONE;
532 }
533
534 spin_lock(&devc->lock);
535
536 /* read interrupt register */
537 status = inb (devc->base+1);
538 /* Clear all interrupt */
539 outb (~status, devc->base+1);
540
541 DEBUGNOISE(printk(KERN_DEBUG "ad1816: Got interrupt subclass %d\n",status));
542
543 if (status == 0) {
544 DEBUGNOISE(printk(KERN_DEBUG "ad1816: interrupt: Got interrupt, but no source.\n"));
545 spin_unlock(&devc->lock);
546 return IRQ_NONE;
547 }
548
549 if (devc->opened && (devc->audio_mode & PCM_ENABLE_INPUT) && (status&64))
550 DMAbuf_inputintr (devc->dev_no);
551
552 if (devc->opened && (devc->audio_mode & PCM_ENABLE_OUTPUT) && (status & 128))
553 DMAbuf_outputintr (devc->dev_no, 1);
554
555 spin_unlock(&devc->lock);
556 return IRQ_HANDLED;
557}
558
559/* ------------------------------------------------------------------- */
560
561/* Mixer stuff */
562
563struct mixer_def {
564 unsigned int regno: 7;
565 unsigned int polarity:1; /* 0=normal, 1=reversed */
566 unsigned int bitpos:4;
567 unsigned int nbits:4;
568};
569
570static char mix_cvt[101] = {
571 0, 0, 3, 7,10,13,16,19,21,23,26,28,30,32,34,35,37,39,40,42,
572 43,45,46,47,49,50,51,52,53,55,56,57,58,59,60,61,62,63,64,65,
573 65,66,67,68,69,70,70,71,72,73,73,74,75,75,76,77,77,78,79,79,
574 80,81,81,82,82,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,
575 91,91,92,92,93,93,94,94,95,95,96,96,96,97,97,98,98,98,99,99,
576 100
577};
578
579typedef struct mixer_def mixer_ent;
580
581/*
582 * Most of the mixer entries work in backwards. Setting the polarity field
583 * makes them to work correctly.
584 *
585 * The channel numbering used by individual soundcards is not fixed. Some
586 * cards have assigned different meanings for the AUX1, AUX2 and LINE inputs.
587 * The current version doesn't try to compensate this.
588 */
589
590#define MIX_ENT(name, reg_l, pola_l, pos_l, len_l, reg_r, pola_r, pos_r, len_r) \
591 {{reg_l, pola_l, pos_l, len_l}, {reg_r, pola_r, pos_r, len_r}}
592
593
594static mixer_ent mix_devices[SOUND_MIXER_NRDEVICES][2] = {
595MIX_ENT(SOUND_MIXER_VOLUME, 14, 1, 8, 5, 14, 1, 0, 5),
596MIX_ENT(SOUND_MIXER_BASS, 0, 0, 0, 0, 0, 0, 0, 0),
597MIX_ENT(SOUND_MIXER_TREBLE, 0, 0, 0, 0, 0, 0, 0, 0),
598MIX_ENT(SOUND_MIXER_SYNTH, 5, 1, 8, 6, 5, 1, 0, 6),
599MIX_ENT(SOUND_MIXER_PCM, 4, 1, 8, 6, 4, 1, 0, 6),
600MIX_ENT(SOUND_MIXER_SPEAKER, 0, 0, 0, 0, 0, 0, 0, 0),
601MIX_ENT(SOUND_MIXER_LINE, 18, 1, 8, 5, 18, 1, 0, 5),
602MIX_ENT(SOUND_MIXER_MIC, 19, 1, 8, 5, 19, 1, 0, 5),
603MIX_ENT(SOUND_MIXER_CD, 15, 1, 8, 5, 15, 1, 0, 5),
604MIX_ENT(SOUND_MIXER_IMIX, 0, 0, 0, 0, 0, 0, 0, 0),
605MIX_ENT(SOUND_MIXER_ALTPCM, 0, 0, 0, 0, 0, 0, 0, 0),
606MIX_ENT(SOUND_MIXER_RECLEV, 20, 0, 8, 4, 20, 0, 0, 4),
607MIX_ENT(SOUND_MIXER_IGAIN, 0, 0, 0, 0, 0, 0, 0, 0),
608MIX_ENT(SOUND_MIXER_OGAIN, 0, 0, 0, 0, 0, 0, 0, 0),
609MIX_ENT(SOUND_MIXER_LINE1, 17, 1, 8, 5, 17, 1, 0, 5),
610MIX_ENT(SOUND_MIXER_LINE2, 16, 1, 8, 5, 16, 1, 0, 5),
611MIX_ENT(SOUND_MIXER_LINE3, 39, 0, 9, 4, 39, 1, 0, 5)
612};
613
614
615static unsigned short default_mixer_levels[SOUND_MIXER_NRDEVICES] =
616{
617 0x4343, /* Master Volume */
618 0x3232, /* Bass */
619 0x3232, /* Treble */
620 0x0000, /* FM */
621 0x4343, /* PCM */
622 0x0000, /* PC Speaker */
623 0x0000, /* Ext Line */
624 0x0000, /* Mic */
625 0x0000, /* CD */
626 0x0000, /* Recording monitor */
627 0x0000, /* SB PCM */
628 0x0000, /* Recording level */
629 0x0000, /* Input gain */
630 0x0000, /* Output gain */
631 0x0000, /* Line1 */
632 0x0000, /* Line2 */
633 0x0000 /* Line3 (usually line in)*/
634};
635
636#define LEFT_CHN 0
637#define RIGHT_CHN 1
638
639
640
641static int
642ad1816_set_recmask (ad1816_info * devc, int mask)
643{
644 unsigned long flags;
645 unsigned char recdev;
646 int i, n;
647
648 spin_lock_irqsave(&devc->lock, flags);
649 mask &= devc->supported_rec_devices;
650
651 n = 0;
652 /* Count selected device bits */
653 for (i = 0; i < 32; i++)
654 if (mask & (1 << i))
655 n++;
656
657 if (n == 0)
658 mask = SOUND_MASK_MIC;
659 else if (n != 1) { /* Too many devices selected */
660 /* Filter out active settings */
661 mask &= ~devc->recmask;
662
663 n = 0;
664 /* Count selected device bits */
665 for (i = 0; i < 32; i++)
666 if (mask & (1 << i))
667 n++;
668
669 if (n != 1)
670 mask = SOUND_MASK_MIC;
671 }
672
673 switch (mask) {
674 case SOUND_MASK_MIC:
675 recdev = 5;
676 break;
677
678 case SOUND_MASK_LINE:
679 recdev = 0;
680 break;
681
682 case SOUND_MASK_CD:
683 recdev = 2;
684 break;
685
686 case SOUND_MASK_LINE1:
687 recdev = 4;
688 break;
689
690 case SOUND_MASK_LINE2:
691 recdev = 3;
692 break;
693
694 case SOUND_MASK_VOLUME:
695 recdev = 1;
696 break;
697
698 default:
699 mask = SOUND_MASK_MIC;
700 recdev = 5;
701 }
702
703 recdev <<= 4;
704 ad_write (devc, 20,
705 (ad_read (devc, 20) & 0x8f8f) | recdev | (recdev<<8));
706
707 devc->recmask = mask;
708 spin_unlock_irqrestore(&devc->lock, flags);
709 return mask;
710}
711
712static void
713change_bits (int *regval, int dev, int chn, int newval)
714{
715 unsigned char mask;
716 int shift;
717
718 /* Reverse polarity*/
719
720 if (mix_devices[dev][chn].polarity == 1)
721 newval = 100 - newval;
722
723 mask = (1 << mix_devices[dev][chn].nbits) - 1;
724 shift = mix_devices[dev][chn].bitpos;
725 /* Scale it */
726 newval = (int) ((newval * mask) + 50) / 100;
727 /* Clear bits */
728 *regval &= ~(mask << shift);
729 /* Set new value */
730 *regval |= (newval & mask) << shift;
731}
732
733static int
734ad1816_mixer_get (ad1816_info * devc, int dev)
735{
736 DEBUGNOISE(printk(KERN_DEBUG "ad1816: mixer_get called!\n"));
737
738 /* range check + supported mixer check */
739 if (dev < 0 || dev >= SOUND_MIXER_NRDEVICES )
740 return (-(EINVAL));
741 if (!((1 << dev) & devc->supported_devices))
742 return -(EINVAL);
743
744 return devc->levels[dev];
745}
746
747static int
748ad1816_mixer_set (ad1816_info * devc, int dev, int value)
749{
750 int left = value & 0x000000ff;
751 int right = (value & 0x0000ff00) >> 8;
752 int retvol;
753
754 int regoffs;
755 int val;
756 int valmute;
757 unsigned long flags;
758
759 DEBUGNOISE(printk(KERN_DEBUG "ad1816: mixer_set called!\n"));
760
761 if (dev < 0 || dev >= SOUND_MIXER_NRDEVICES )
762 return -(EINVAL);
763
764 if (left > 100)
765 left = 100;
766 if (left < 0)
767 left = 0;
768 if (right > 100)
769 right = 100;
770 if (right < 0)
771 right = 0;
772
773 /* Mono control */
774 if (mix_devices[dev][RIGHT_CHN].nbits == 0)
775 right = left;
776 retvol = left | (right << 8);
777
778 /* Scale it */
779
780 left = mix_cvt[left];
781 right = mix_cvt[right];
782
783 /* reject all mixers that are not supported */
784 if (!(devc->supported_devices & (1 << dev)))
785 return -(EINVAL);
786
787 /* sanity check */
788 if (mix_devices[dev][LEFT_CHN].nbits == 0)
789 return -(EINVAL);
790 spin_lock_irqsave(&devc->lock, flags);
791
792 /* keep precise volume internal */
793 devc->levels[dev] = retvol;
794
795 /* Set the left channel */
796 regoffs = mix_devices[dev][LEFT_CHN].regno;
797 val = ad_read (devc, regoffs);
798 change_bits (&val, dev, LEFT_CHN, left);
799
800 valmute=val;
801
802 /* Mute bit masking on some registers */
803 if ( regoffs==5 || regoffs==14 || regoffs==15 ||
804 regoffs==16 || regoffs==17 || regoffs==18 ||
805 regoffs==19 || regoffs==39) {
806 if (left==0)
807 valmute |= 0x8000;
808 else
809 valmute &= ~0x8000;
810 }
811 ad_write (devc, regoffs, valmute); /* mute */
812
813 /*
814 * Set the right channel
815 */
816
817 /* Was just a mono channel */
818 if (mix_devices[dev][RIGHT_CHN].nbits == 0) {
819 spin_unlock_irqrestore(&devc->lock, flags);
820 return retvol;
821 }
822
823 regoffs = mix_devices[dev][RIGHT_CHN].regno;
824 val = ad_read (devc, regoffs);
825 change_bits (&val, dev, RIGHT_CHN, right);
826
827 valmute=val;
828 if ( regoffs==5 || regoffs==14 || regoffs==15 ||
829 regoffs==16 || regoffs==17 || regoffs==18 ||
830 regoffs==19 || regoffs==39) {
831 if (right==0)
832 valmute |= 0x80;
833 else
834 valmute &= ~0x80;
835 }
836 ad_write (devc, regoffs, valmute); /* mute */
837 spin_unlock_irqrestore(&devc->lock, flags);
838 return retvol;
839}
840
841#define MIXER_DEVICES ( SOUND_MASK_VOLUME | \
842 SOUND_MASK_SYNTH | \
843 SOUND_MASK_PCM | \
844 SOUND_MASK_LINE | \
845 SOUND_MASK_LINE1 | \
846 SOUND_MASK_LINE2 | \
847 SOUND_MASK_LINE3 | \
848 SOUND_MASK_MIC | \
849 SOUND_MASK_CD | \
850 SOUND_MASK_RECLEV \
851 )
852#define REC_DEVICES ( SOUND_MASK_LINE2 |\
853 SOUND_MASK_LINE |\
854 SOUND_MASK_LINE1 |\
855 SOUND_MASK_MIC |\
856 SOUND_MASK_CD |\
857 SOUND_MASK_VOLUME \
858 )
859
860static void
861ad1816_mixer_reset (ad1816_info * devc)
862{
863 int i;
864
865 devc->supported_devices = MIXER_DEVICES;
866
867 devc->supported_rec_devices = REC_DEVICES;
868
869 for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
870 if (devc->supported_devices & (1 << i))
871 ad1816_mixer_set (devc, i, default_mixer_levels[i]);
872 ad1816_set_recmask (devc, SOUND_MASK_MIC);
873}
874
875static int
876ad1816_mixer_ioctl (int dev, unsigned int cmd, void __user * arg)
877{
878 ad1816_info *devc = mixer_devs[dev]->devc;
879 int val;
880 int __user *p = arg;
881
882 DEBUGNOISE(printk(KERN_DEBUG "ad1816: mixer_ioctl called!\n"));
883
884 /* Mixer ioctl */
885 if (((cmd >> 8) & 0xff) == 'M') {
886
887 /* set ioctl */
888 if (_SIOC_DIR (cmd) & _SIOC_WRITE) {
889 switch (cmd & 0xff){
890 case SOUND_MIXER_RECSRC:
891
892 if (get_user(val, p))
893 return -EFAULT;
894 val=ad1816_set_recmask (devc, val);
895 return put_user(val, p);
896 break;
897
898 default:
899 if (get_user(val, p))
900 return -EFAULT;
901 if ((val=ad1816_mixer_set (devc, cmd & 0xff, val))<0)
902 return val;
903 else
904 return put_user(val, p);
905 }
906 } else {
907 /* read ioctl */
908 switch (cmd & 0xff) {
909
910 case SOUND_MIXER_RECSRC:
911 val=devc->recmask;
912 return put_user(val, p);
913 break;
914
915 case SOUND_MIXER_DEVMASK:
916 val=devc->supported_devices;
917 return put_user(val, p);
918 break;
919
920 case SOUND_MIXER_STEREODEVS:
921 val=devc->supported_devices & ~(SOUND_MASK_SPEAKER | SOUND_MASK_IMIX);
922 return put_user(val, p);
923 break;
924
925 case SOUND_MIXER_RECMASK:
926 val=devc->supported_rec_devices;
927 return put_user(val, p);
928 break;
929
930 case SOUND_MIXER_CAPS:
931 val=SOUND_CAP_EXCL_INPUT;
932 return put_user(val, p);
933 break;
934
935 default:
936 if ((val=ad1816_mixer_get (devc, cmd & 0xff))<0)
937 return val;
938 else
939 return put_user(val, p);
940 }
941 }
942 } else
943 /* not for mixer */
944 return -(EINVAL);
945}
946
947/* ------------------------------------------------------------------- */
948
949/* Mixer structure */
950
951static struct mixer_operations ad1816_mixer_operations = {
952 .owner = THIS_MODULE,
953 .id = "AD1816",
954 .name = "AD1816 Mixer",
955 .ioctl = ad1816_mixer_ioctl
956};
957
958
959/* ------------------------------------------------------------------- */
960
961/* stuff for card recognition, init and unloading PNP ...*/
962
963
964/* check if AD1816 present at specified hw_config and register device with OS
965 * return 1 if initialization was successful, 0 otherwise
966 */
967static int __init ad1816_init_card (struct address_info *hw_config,
968 struct pnp_dev *pnp)
969{
970 ad1816_info *devc = NULL;
971 int tmp;
972 int oss_devno = -1;
973
974 printk(KERN_INFO "ad1816: initializing card: io=0x%x, irq=%d, dma=%d, "
975 "dma2=%d, clockfreq=%d, options=%d isadmabug=%d "
976 "%s\n",
977 hw_config->io_base,
978 hw_config->irq,
979 hw_config->dma,
980 hw_config->dma2,
981 ad1816_clockfreq,
982 options,
983 isa_dma_bridge_buggy,
984 pnp?"(PNP)":"");
985
986 /* ad1816_info structure remaining ? */
987 if (nr_ad1816_devs >= MAX_AUDIO_DEV) {
988 printk(KERN_WARNING "ad1816: no more ad1816_info structures "
989 "left\n");
990 goto out;
991 }
992
993 devc = &dev_info[nr_ad1816_devs];
994 devc->base = hw_config->io_base;
995 devc->irq = hw_config->irq;
996 devc->dma_playback=hw_config->dma;
997 devc->dma_capture=hw_config->dma2;
998 devc->opened = 0;
999 devc->pnpdev = pnp;
1000 spin_lock_init(&devc->lock);
1001
1002 if (!request_region(devc->base, 16, "AD1816 Sound")) {
1003 printk(KERN_WARNING "ad1816: I/O port 0x%03x not free\n",
1004 devc->base);
1005 goto out;
1006 }
1007
1008 printk(KERN_INFO "ad1816: Examining AD1816 at address 0x%03x.\n",
1009 devc->base);
1010
1011
1012 /* tests for ad1816 */
1013 /* base+0: bit 1 must be set but not 255 */
1014 tmp=inb(devc->base);
1015 if ( (tmp&0x80)==0 || tmp==255 ) {
1016 printk (KERN_INFO "ad1816: Chip is not an AD1816 or chip "
1017 "is not active (Test 0)\n");
1018 goto out_release_region;
1019 }
1020
1021 /* writes to ireg 8 are copied to ireg 9 */
1022 ad_write(devc,8,12345);
1023 if (ad_read(devc,9)!=12345) {
1024 printk(KERN_INFO "ad1816: Chip is not an AD1816 (Test 1)\n");
1025 goto out_release_region;
1026 }
1027
1028 /* writes to ireg 8 are copied to ireg 9 */
1029 ad_write(devc,8,54321);
1030 if (ad_read(devc,9)!=54321) {
1031 printk(KERN_INFO "ad1816: Chip is not an AD1816 (Test 2)\n");
1032 goto out_release_region;
1033 }
1034
1035 /* writes to ireg 10 are copied to ireg 11 */
1036 ad_write(devc,10,54321);
1037 if (ad_read(devc,11)!=54321) {
1038 printk (KERN_INFO "ad1816: Chip is not an AD1816 (Test 3)\n");
1039 goto out_release_region;
1040 }
1041
1042 /* writes to ireg 10 are copied to ireg 11 */
1043 ad_write(devc,10,12345);
1044 if (ad_read(devc,11)!=12345) {
1045 printk (KERN_INFO "ad1816: Chip is not an AD1816 (Test 4)\n");
1046 goto out_release_region;
1047 }
1048
1049 /* bit in base +1 cannot be set to 1 */
1050 tmp=inb(devc->base+1);
1051 outb(0xff,devc->base+1);
1052 if (inb(devc->base+1)!=tmp) {
1053 printk(KERN_INFO "ad1816: Chip is not an AD1816 (Test 5)\n");
1054 goto out_release_region;
1055 }
1056
1057 printk(KERN_INFO "ad1816: AD1816 (version %d) successfully detected!\n",
1058 ad_read(devc,45));
1059
1060 /* disable all interrupts */
1061 ad_write(devc,1,0);
1062
1063 /* Clear pending interrupts */
1064 outb (0, devc->base+1);
1065
1066 /* allocate irq */
1067 if (devc->irq < 0 || devc->irq > 15)
1068 goto out_release_region;
1069 if (request_irq(devc->irq, ad1816_interrupt,0,
1070 "SoundPort", devc) < 0) {
1071 printk(KERN_WARNING "ad1816: IRQ in use\n");
1072 goto out_release_region;
1073 }
1074
1075 /* DMA stuff */
1076 if (sound_alloc_dma (devc->dma_playback, "Sound System")) {
1077 printk(KERN_WARNING "ad1816: Can't allocate DMA%d\n",
1078 devc->dma_playback);
1079 goto out_free_irq;
1080 }
1081
1082 if ( devc->dma_capture >= 0 &&
1083 devc->dma_capture != devc->dma_playback) {
1084 if (sound_alloc_dma(devc->dma_capture,
1085 "Sound System (capture)")) {
1086 printk(KERN_WARNING "ad1816: Can't allocate DMA%d\n",
1087 devc->dma_capture);
1088 goto out_free_dma;
1089 }
1090 devc->audio_mode=DMA_AUTOMODE|DMA_DUPLEX;
1091 } else {
1092 printk(KERN_WARNING "ad1816: Only one DMA channel "
1093 "available/configured. No duplex operation possible\n");
1094 devc->audio_mode=DMA_AUTOMODE;
1095 }
1096
1097 conf_printf2 ("AD1816 audio driver",
1098 devc->base, devc->irq, devc->dma_playback,
1099 devc->dma_capture);
1100
1101 /* register device */
1102 if ((oss_devno = sound_install_audiodrv (AUDIO_DRIVER_VERSION,
1103 "AD1816 audio driver",
1104 &ad1816_audio_driver,
1105 sizeof (struct audio_driver),
1106 devc->audio_mode,
1107 ad_format_mask,
1108 devc,
1109 devc->dma_playback,
1110 devc->dma_capture)) < 0) {
1111 printk(KERN_WARNING "ad1816: Can't install sound driver\n");
1112 goto out_free_dma_2;
1113 }
1114
1115
1116 ad_write(devc,32,0x80f0); /* sound system mode */
1117 if (options&1) {
1118 ad_write(devc,33,0); /* disable all audiosources for dsp */
1119 } else {
1120 ad_write(devc,33,0x03f8); /* enable all audiosources for dsp */
1121 }
1122 ad_write(devc,4,0x8080); /* default values for volumes (muted)*/
1123 ad_write(devc,5,0x8080);
1124 ad_write(devc,6,0x8080);
1125 ad_write(devc,7,0x8080);
1126 ad_write(devc,15,0x8888);
1127 ad_write(devc,16,0x8888);
1128 ad_write(devc,17,0x8888);
1129 ad_write(devc,18,0x8888);
1130 ad_write(devc,19,0xc888); /* +20db mic active */
1131 ad_write(devc,14,0x0000); /* Master volume unmuted */
1132 ad_write(devc,39,0x009f); /* 3D effect on 0% phone out muted */
1133 ad_write(devc,44,0x0080); /* everything on power, 3d enabled for d/a */
1134 outb(0x10,devc->base+8); /* set dma mode */
1135 outb(0x10,devc->base+9);
1136
1137 /* enable capture + playback interrupt */
1138 ad_write(devc,1,0xc000);
1139
1140 /* set mixer defaults */
1141 ad1816_mixer_reset (devc);
1142
1143 /* register mixer */
1144 if ((audio_devs[oss_devno]->mixer_dev=sound_install_mixer(
1145 MIXER_DRIVER_VERSION,
1146 "AD1816 audio driver",
1147 &ad1816_mixer_operations,
1148 sizeof (struct mixer_operations),
1149 devc)) < 0) {
1150 printk(KERN_WARNING "Can't install mixer\n");
1151 }
1152 /* make ad1816_info active */
1153 nr_ad1816_devs++;
1154 printk(KERN_INFO "ad1816: card successfully installed!\n");
1155 return 1;
1156 /* error handling */
1157out_free_dma_2:
1158 if (devc->dma_capture >= 0 && devc->dma_capture != devc->dma_playback)
1159 sound_free_dma(devc->dma_capture);
1160out_free_dma:
1161 sound_free_dma(devc->dma_playback);
1162out_free_irq:
1163 free_irq(devc->irq, devc);
1164out_release_region:
1165 release_region(devc->base, 16);
1166out:
1167 return 0;
1168}
1169
1170static void __exit unload_card(ad1816_info *devc)
1171{
1172 int mixer, dev = 0;
1173
1174 if (devc != NULL) {
1175 printk("ad1816: Unloading card at address 0x%03x\n",devc->base);
1176
1177 dev = devc->dev_no;
1178 mixer = audio_devs[dev]->mixer_dev;
1179
1180 /* unreg mixer*/
1181 if(mixer>=0) {
1182 sound_unload_mixerdev(mixer);
1183 }
1184 /* unreg audiodev */
1185 sound_unload_audiodev(dev);
1186
1187 /* free dma channels */
1188 if (devc->dma_capture>=0 &&
1189 devc->dma_capture != devc->dma_playback) {
1190 sound_free_dma(devc->dma_capture);
1191 }
1192 sound_free_dma (devc->dma_playback);
1193 /* free irq */
1194 free_irq(devc->irq, devc);
1195 /* free io */
1196 release_region (devc->base, 16);
1197#ifdef __ISAPNP__
1198 if (devc->pnpdev) {
1199 pnp_disable_dev(devc->pnpdev);
1200 pnp_device_detach(devc->pnpdev);
1201 }
1202#endif
1203
1204 } else
1205 printk(KERN_WARNING "ad1816: no device/card specified\n");
1206}
1207
1208static int __initdata io = -1;
1209static int __initdata irq = -1;
1210static int __initdata dma = -1;
1211static int __initdata dma2 = -1;
1212
1213#ifdef __ISAPNP__
1214/* use isapnp for configuration */
1215static int isapnp = 1;
1216static int isapnpjump;
1217module_param(isapnp, bool, 0);
1218module_param(isapnpjump, int, 0);
1219#endif
1220
1221module_param(io, int, 0);
1222module_param(irq, int, 0);
1223module_param(dma, int, 0);
1224module_param(dma2, int, 0);
1225module_param(ad1816_clockfreq, int, 0);
1226module_param(options, int, 0);
1227
1228#ifdef __ISAPNP__
1229static struct {
1230 unsigned short card_vendor, card_device;
1231 unsigned short vendor;
1232 unsigned short function;
1233 struct ad1816_data *data;
1234} isapnp_ad1816_list[] __initdata = {
1235 { ISAPNP_ANY_ID, ISAPNP_ANY_ID,
1236 ISAPNP_VENDOR('A','D','S'), ISAPNP_FUNCTION(0x7150),
1237 NULL },
1238 { ISAPNP_ANY_ID, ISAPNP_ANY_ID,
1239 ISAPNP_VENDOR('A','D','S'), ISAPNP_FUNCTION(0x7180),
1240 NULL },
1241 {0}
1242};
1243
1244MODULE_DEVICE_TABLE(isapnp, isapnp_ad1816_list);
1245
1246
1247static void __init ad1816_config_pnp_card(struct pnp_card *card,
1248 unsigned short vendor,
1249 unsigned short function)
1250{
1251 struct address_info cfg;
1252 struct pnp_dev *card_dev = pnp_find_dev(card, vendor, function, NULL);
1253 if (!card_dev) return;
1254 if (pnp_device_attach(card_dev) < 0) {
1255 printk(KERN_WARNING "ad1816: Failed to attach PnP device\n");
1256 return;
1257 }
1258 if (pnp_activate_dev(card_dev) < 0) {
1259 printk(KERN_WARNING "ad1816: Failed to activate PnP device\n");
1260 pnp_device_detach(card_dev);
1261 return;
1262 }
1263 cfg.io_base = pnp_port_start(card_dev, 2);
1264 cfg.irq = pnp_irq(card_dev, 0);
1265 cfg.dma = pnp_irq(card_dev, 0);
1266 cfg.dma2 = pnp_irq(card_dev, 1);
1267 if (!ad1816_init_card(&cfg, card_dev)) {
1268 pnp_disable_dev(card_dev);
1269 pnp_device_detach(card_dev);
1270 }
1271}
1272
1273static void __init ad1816_config_pnp_cards(void)
1274{
1275 int nr_pnp_cfg;
1276 int i;
1277
1278 /* Count entries in isapnp_ad1816_list */
1279 for (nr_pnp_cfg = 0; isapnp_ad1816_list[nr_pnp_cfg].card_vendor != 0;
1280 nr_pnp_cfg++);
1281 /* Check and adjust isapnpjump */
1282 if( isapnpjump < 0 || isapnpjump >= nr_pnp_cfg) {
1283 printk(KERN_WARNING
1284 "ad1816: Valid range for isapnpjump is 0-%d. "
1285 "Adjusted to 0.\n", nr_pnp_cfg-1);
1286 isapnpjump = 0;
1287 }
1288 for (i = isapnpjump; isapnp_ad1816_list[i].card_vendor != 0; i++) {
1289 struct pnp_card *card = NULL;
1290 /* iterate over all pnp cards */
1291 while ((card = pnp_find_card(isapnp_ad1816_list[i].card_vendor,
1292 isapnp_ad1816_list[i].card_device, card)))
1293 ad1816_config_pnp_card(card,
1294 isapnp_ad1816_list[i].vendor,
1295 isapnp_ad1816_list[i].function);
1296 }
1297}
1298#endif
1299
1300/* module initialization */
1301static int __init init_ad1816(void)
1302{
1303 printk(KERN_INFO "ad1816: AD1816 sounddriver "
1304 "Copyright (C) 1998-2003 by Thorsten Knabe and "
1305 "others\n");
1306#ifdef AD1816_CLOCK
1307 /* set ad1816_clockfreq if set during compilation */
1308 ad1816_clockfreq=AD1816_CLOCK;
1309#endif
1310 if (ad1816_clockfreq<5000 || ad1816_clockfreq>100000) {
1311 ad1816_clockfreq=33000;
1312 }
1313
1314#ifdef __ISAPNP__
1315 /* configure PnP cards */
1316 if(isapnp) ad1816_config_pnp_cards();
1317#endif
1318 /* configure card by module params */
1319 if (io != -1 && irq != -1 && dma != -1) {
1320 struct address_info cfg;
1321 cfg.io_base = io;
1322 cfg.irq = irq;
1323 cfg.dma = dma;
1324 cfg.dma2 = dma2;
1325 ad1816_init_card(&cfg, NULL);
1326 }
1327 if (nr_ad1816_devs <= 0)
1328 return -ENODEV;
1329 return 0;
1330}
1331
1332/* module cleanup */
1333static void __exit cleanup_ad1816 (void)
1334{
1335 int i;
1336 ad1816_info *devc = NULL;
1337
1338 /* remove any soundcard */
1339 for (i = 0; i < nr_ad1816_devs; i++) {
1340 devc = &dev_info[i];
1341 unload_card(devc);
1342 }
1343 nr_ad1816_devs=0;
1344 printk(KERN_INFO "ad1816: driver unloaded!\n");
1345}
1346
1347module_init(init_ad1816);
1348module_exit(cleanup_ad1816);
1349
1350#ifndef MODULE
1351/* kernel command line parameter evaluation */
1352static int __init setup_ad1816(char *str)
1353{
1354 /* io, irq, dma, dma2 */
1355 int ints[5];
1356
1357 str = get_options(str, ARRAY_SIZE(ints), ints);
1358
1359 io = ints[1];
1360 irq = ints[2];
1361 dma = ints[3];
1362 dma2 = ints[4];
1363 return 1;
1364}
1365
1366__setup("ad1816=", setup_ad1816);
1367#endif
1368MODULE_LICENSE("GPL");
diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c
deleted file mode 100644
index c0730a3563a2..000000000000
--- a/sound/oss/ad1889.c
+++ /dev/null
@@ -1,1101 +0,0 @@
1/*
2 * Copyright 2001-2004 Randolph Chung <tausq@debian.org>
3 *
4 * Analog Devices 1889 PCI audio driver (AD1819 AC97-compatible codec)
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 *
20 * Notes:
21 * 1. Only flat DMA is supported; s-g is not supported right now
22 *
23 *
24<jsm> tausq: Anyway, to set up sample rates for D to A, you just use the sample rate on the codec. For A to D, you need to set the codec always to 48K (using the split sample rate feature on the codec) and then set the resampler on the AD1889 to the sample rate you want.
25<jsm> Also, when changing the sample rate on the codec you need to power it down and re power it up for the change to take effect!
26 *
27 * $Id: ad1889.c,v 1.3 2002/10/19 21:31:44 grundler Exp $
28 */
29#include <linux/module.h>
30#include <linux/init.h>
31#include <linux/ioport.h>
32#include <linux/pci.h>
33#include <linux/poll.h>
34#include <linux/proc_fs.h>
35#include <linux/slab.h>
36#include <linux/soundcard.h>
37#include <linux/ac97_codec.h>
38#include <linux/sound.h>
39#include <linux/interrupt.h>
40#include <linux/mutex.h>
41
42#include <asm/delay.h>
43#include <asm/io.h>
44#include <asm/dma.h>
45#include <asm/uaccess.h>
46
47#include "ad1889.h"
48
49#define DBG(fmt, arg...) printk(fmt, ##arg)
50#define DEVNAME "ad1889"
51
52#define NR_HW_CH 4
53#define DAC_RUNNING 1
54#define ADC_RUNNING 2
55
56#define UNDERRUN(dev) (0)
57
58#define AD1889_READW(dev,reg) readw(dev->regbase + reg)
59#define AD1889_WRITEW(dev,reg,val) writew((val), dev->regbase + reg)
60#define AD1889_READL(dev,reg) readl(dev->regbase + reg)
61#define AD1889_WRITEL(dev,reg,val) writel((val), dev->regbase + reg)
62
63//now 100ms
64/* #define WAIT_10MS() schedule_timeout(HZ/10) */
65#define WAIT_10MS() do { int __i; for (__i = 0; __i < 100; __i++) udelay(1000); } while(0)
66
67/* currently only support a single device */
68static ad1889_dev_t *ad1889_dev = NULL;
69
70/************************* helper routines ***************************** */
71static inline void ad1889_set_wav_rate(ad1889_dev_t *dev, int rate)
72{
73 struct ac97_codec *ac97_codec = dev->ac97_codec;
74
75 DBG("Setting WAV rate to %d\n", rate);
76 dev->state[AD_WAV_STATE].dmabuf.rate = rate;
77 AD1889_WRITEW(dev, AD_DS_WAS, rate);
78
79 /* Cycle the DAC to enable the new rate */
80 ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0x0200);
81 WAIT_10MS();
82 ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0);
83}
84
85static inline void ad1889_set_wav_fmt(ad1889_dev_t *dev, int fmt)
86{
87 u16 tmp;
88
89 DBG("Setting WAV format to 0x%x\n", fmt);
90
91 tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC);
92 if (fmt & AFMT_S16_LE) {
93 //tmp |= 0x0100; /* set WA16 */
94 tmp |= 0x0300; /* set WA16 stereo */
95 } else if (fmt & AFMT_U8) {
96 tmp &= ~0x0100; /* clear WA16 */
97 }
98 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp);
99}
100
101static inline void ad1889_set_adc_fmt(ad1889_dev_t *dev, int fmt)
102{
103 u16 tmp;
104
105 DBG("Setting ADC format to 0x%x\n", fmt);
106
107 tmp = AD1889_READW(ad1889_dev, AD_DS_RAMC);
108 if (fmt & AFMT_S16_LE) {
109 tmp |= 0x0100; /* set WA16 */
110 } else if (fmt & AFMT_U8) {
111 tmp &= ~0x0100; /* clear WA16 */
112 }
113 AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, tmp);
114}
115
116static void ad1889_start_wav(ad1889_state_t *state)
117{
118 unsigned long flags;
119 struct dmabuf *dmabuf = &state->dmabuf;
120 int cnt;
121 u16 tmp;
122
123 spin_lock_irqsave(&state->card->lock, flags);
124
125 if (dmabuf->dma_len) /* DMA already in flight */
126 goto skip_dma;
127
128 /* setup dma */
129 cnt = dmabuf->wr_ptr - dmabuf->rd_ptr;
130 if (cnt == 0) /* done - don't need to do anything */
131 goto skip_dma;
132
133 /* If the wr_ptr has wrapped, only map to the end */
134 if (cnt < 0)
135 cnt = DMA_SIZE - dmabuf->rd_ptr;
136
137 dmabuf->dma_handle = pci_map_single(ad1889_dev->pci,
138 dmabuf->rawbuf + dmabuf->rd_ptr,
139 cnt, PCI_DMA_TODEVICE);
140 dmabuf->dma_len = cnt;
141 dmabuf->ready = 1;
142
143 DBG("Starting playback at 0x%p for %ld bytes\n", dmabuf->rawbuf +
144 dmabuf->rd_ptr, dmabuf->dma_len);
145
146 /* load up the current register set */
147 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVCC, cnt);
148 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVICC, cnt);
149 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVCA, dmabuf->dma_handle);
150
151 /* TODO: for now we load the base registers with the same thing */
152 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVBC, cnt);
153 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVIBC, cnt);
154 AD1889_WRITEL(ad1889_dev, AD_DMA_WAVBA, dmabuf->dma_handle);
155
156 /* and we're off to the races... */
157 AD1889_WRITEL(ad1889_dev, AD_DMA_CHSS, 0x8);
158 tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC);
159 tmp |= 0x0400; /* set WAEN */
160 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp);
161 (void) AD1889_READW(ad1889_dev, AD_DS_WSMC); /* flush posted PCI write */
162
163 dmabuf->enable |= DAC_RUNNING;
164
165skip_dma:
166 spin_unlock_irqrestore(&state->card->lock, flags);
167}
168
169
170static void ad1889_stop_wav(ad1889_state_t *state)
171{
172 unsigned long flags;
173 struct dmabuf *dmabuf = &state->dmabuf;
174
175 spin_lock_irqsave(&state->card->lock, flags);
176
177 if (dmabuf->enable & DAC_RUNNING) {
178 u16 tmp;
179 unsigned long cnt = dmabuf->dma_len;
180
181 tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC);
182 tmp &= ~0x0400; /* clear WAEN */
183 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp);
184 (void) AD1889_READW(ad1889_dev, AD_DS_WSMC); /* flush posted PCI write */
185 pci_unmap_single(ad1889_dev->pci, dmabuf->dma_handle,
186 cnt, PCI_DMA_TODEVICE);
187
188 dmabuf->enable &= ~DAC_RUNNING;
189
190 /* update dma pointers */
191 dmabuf->rd_ptr += cnt;
192 dmabuf->rd_ptr &= (DMA_SIZE - 1);
193
194 dmabuf->dma_handle = 0;
195 dmabuf->dma_len = 0;
196 dmabuf->ready = 0;
197
198 wake_up(&dmabuf->wait);
199 }
200
201 spin_unlock_irqrestore(&state->card->lock, flags);
202}
203
204
205#if 0
206static void ad1889_startstop_adc(ad1889_state_t *state, int start)
207{
208 u16 tmp;
209 unsigned long flags;
210
211 spin_lock_irqsave(&state->card->lock, flags);
212
213 tmp = AD1889_READW(ad1889_dev, AD_DS_RAMC);
214 if (start) {
215 state->dmabuf.enable |= ADC_RUNNING;
216 tmp |= 0x0004; /* set ADEN */
217 } else {
218 state->dmabuf.enable &= ~ADC_RUNNING;
219 tmp &= ~0x0004; /* clear ADEN */
220 }
221 AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, tmp);
222
223 spin_unlock_irqrestore(&state->card->lock, flags);
224}
225#endif
226
227static ad1889_dev_t *ad1889_alloc_dev(struct pci_dev *pci)
228{
229 ad1889_dev_t *dev;
230 struct dmabuf *dmabuf;
231 int i;
232
233 if ((dev = kzalloc(sizeof(ad1889_dev_t), GFP_KERNEL)) == NULL)
234 return NULL;
235 spin_lock_init(&dev->lock);
236 dev->pci = pci;
237
238 for (i = 0; i < AD_MAX_STATES; i++) {
239 dev->state[i].card = dev;
240 mutex_init(&dev->state[i].mutex);
241 init_waitqueue_head(&dev->state[i].dmabuf.wait);
242 }
243
244 /* allocate dma buffer */
245
246 for (i = 0; i < AD_MAX_STATES; i++) {
247 dmabuf = &dev->state[i].dmabuf;
248 dmabuf->rawbuf = kmalloc(DMA_SIZE, GFP_KERNEL|GFP_DMA);
249 if (!dmabuf->rawbuf)
250 goto err_free_dmabuf;
251 dmabuf->rawbuf_size = DMA_SIZE;
252 dmabuf->dma_handle = 0;
253 dmabuf->rd_ptr = dmabuf->wr_ptr = dmabuf->dma_len = 0UL;
254 dmabuf->ready = 0;
255 dmabuf->rate = 48000;
256 }
257 return dev;
258
259err_free_dmabuf:
260 while (--i >= 0)
261 kfree(dev->state[i].dmabuf.rawbuf);
262 kfree(dev);
263 return NULL;
264}
265
266static void ad1889_free_dev(ad1889_dev_t *dev)
267{
268 int j;
269 struct dmabuf *dmabuf;
270
271 if (dev == NULL)
272 return;
273
274 if (dev->ac97_codec)
275 ac97_release_codec(dev->ac97_codec);
276
277 for (j = 0; j < AD_MAX_STATES; j++) {
278 dmabuf = &dev->state[j].dmabuf;
279 kfree(dmabuf->rawbuf);
280 }
281
282 kfree(dev);
283}
284
285static inline void ad1889_trigger_playback(ad1889_dev_t *dev)
286{
287#if 0
288 u32 val;
289 struct dmabuf *dmabuf = &dev->state[AD_WAV_STATE].dmabuf;
290#endif
291
292 ad1889_start_wav(&dev->state[AD_WAV_STATE]);
293}
294
295static int ad1889_read_proc (char *page, char **start, off_t off,
296 int count, int *eof, void *data)
297{
298 char *out = page;
299 int len, i;
300 ad1889_dev_t *dev = data;
301 ad1889_reg_t regs[] = {
302 { "WSMC", AD_DS_WSMC, 16 },
303 { "RAMC", AD_DS_RAMC, 16 },
304 { "WADA", AD_DS_WADA, 16 },
305 { "SYDA", AD_DS_SYDA, 16 },
306 { "WAS", AD_DS_WAS, 16 },
307 { "RES", AD_DS_RES, 16 },
308 { "CCS", AD_DS_CCS, 16 },
309 { "ADCBA", AD_DMA_ADCBA, 32 },
310 { "ADCCA", AD_DMA_ADCCA, 32 },
311 { "ADCBC", AD_DMA_ADCBC, 32 },
312 { "ADCCC", AD_DMA_ADCCC, 32 },
313 { "ADCIBC", AD_DMA_ADCIBC, 32 },
314 { "ADCICC", AD_DMA_ADCICC, 32 },
315 { "ADCCTRL", AD_DMA_ADCCTRL, 16 },
316 { "WAVBA", AD_DMA_WAVBA, 32 },
317 { "WAVCA", AD_DMA_WAVCA, 32 },
318 { "WAVBC", AD_DMA_WAVBC, 32 },
319 { "WAVCC", AD_DMA_WAVCC, 32 },
320 { "WAVIBC", AD_DMA_WAVIBC, 32 },
321 { "WAVICC", AD_DMA_WAVICC, 32 },
322 { "WAVCTRL", AD_DMA_WAVCTRL, 16 },
323 { "DISR", AD_DMA_DISR, 32 },
324 { "CHSS", AD_DMA_CHSS, 32 },
325 { "IPC", AD_GPIO_IPC, 16 },
326 { "OP", AD_GPIO_OP, 16 },
327 { "IP", AD_GPIO_IP, 16 },
328 { "ACIC", AD_AC97_ACIC, 16 },
329 { "AC97_RESET", AD_AC97_BASE + AC97_RESET, 16 },
330 { "AC97_MASTER_VOL_STEREO", AD_AC97_BASE + AC97_MASTER_VOL_STEREO, 16 },
331 { "AC97_HEADPHONE_VOL", AD_AC97_BASE + AC97_HEADPHONE_VOL, 16 },
332 { "AC97_MASTER_VOL_MONO", AD_AC97_BASE + AC97_MASTER_VOL_MONO, 16 },
333 { "AC97_MASTER_TONE", AD_AC97_BASE + AC97_MASTER_TONE, 16 },
334 { "AC97_PCBEEP_VOL", AD_AC97_BASE + AC97_PCBEEP_VOL, 16 },
335 { "AC97_PHONE_VOL", AD_AC97_BASE + AC97_PHONE_VOL, 16 },
336 { "AC97_MIC_VOL", AD_AC97_BASE + AC97_MIC_VOL, 16 },
337 { "AC97_LINEIN_VOL", AD_AC97_BASE + AC97_LINEIN_VOL, 16 },
338 { "AC97_CD_VOL", AD_AC97_BASE + AC97_CD_VOL, 16 },
339 { "AC97_VIDEO_VOL", AD_AC97_BASE + AC97_VIDEO_VOL, 16 },
340 { "AC97_AUX_VOL", AD_AC97_BASE + AC97_AUX_VOL, 16 },
341 { "AC97_PCMOUT_VOL", AD_AC97_BASE + AC97_PCMOUT_VOL, 16 },
342 { "AC97_RECORD_SELECT", AD_AC97_BASE + AC97_RECORD_SELECT, 16 },
343 { "AC97_RECORD_GAIN", AD_AC97_BASE + AC97_RECORD_GAIN, 16 },
344 { "AC97_RECORD_GAIN_MIC", AD_AC97_BASE + AC97_RECORD_GAIN_MIC, 16 },
345 { "AC97_GENERAL_PURPOSE", AD_AC97_BASE + AC97_GENERAL_PURPOSE, 16 },
346 { "AC97_3D_CONTROL", AD_AC97_BASE + AC97_3D_CONTROL, 16 },
347 { "AC97_MODEM_RATE", AD_AC97_BASE + AC97_MODEM_RATE, 16 },
348 { "AC97_POWER_CONTROL", AD_AC97_BASE + AC97_POWER_CONTROL, 16 },
349 { NULL }
350 };
351
352 if (dev == NULL)
353 return -ENODEV;
354
355 for (i = 0; regs[i].name != 0; i++)
356 out += sprintf(out, "%s: 0x%0*x\n", regs[i].name,
357 regs[i].width >> 2,
358 (regs[i].width == 16
359 ? AD1889_READW(dev, regs[i].offset)
360 : AD1889_READL(dev, regs[i].offset)));
361
362 for (i = 0; i < AD_MAX_STATES; i++) {
363 out += sprintf(out, "DMA status for %s:\n",
364 (i == AD_WAV_STATE ? "WAV" : "ADC"));
365 out += sprintf(out, "\t\t0x%p (IOVA: 0x%llu)\n",
366 dev->state[i].dmabuf.rawbuf,
367 (unsigned long long)dev->state[i].dmabuf.dma_handle);
368
369 out += sprintf(out, "\tread ptr: offset %u\n",
370 (unsigned int)dev->state[i].dmabuf.rd_ptr);
371 out += sprintf(out, "\twrite ptr: offset %u\n",
372 (unsigned int)dev->state[i].dmabuf.wr_ptr);
373 out += sprintf(out, "\tdma len: offset %u\n",
374 (unsigned int)dev->state[i].dmabuf.dma_len);
375 }
376
377 len = out - page - off;
378 if (len < count) {
379 *eof = 1;
380 if (len <= 0) return 0;
381 } else {
382 len = count;
383 }
384 *start = page + off;
385 return len;
386}
387
388/***************************** DMA interfaces ************************** */
389#if 0
390static inline unsigned long ad1889_get_dma_addr(ad1889_state_t *state)
391{
392 struct dmabuf *dmabuf = &state->dmabuf;
393 u32 offset;
394
395 if (!(dmabuf->enable & (DAC_RUNNING | ADC_RUNNING))) {
396 printk(KERN_ERR DEVNAME ": get_dma_addr called without dma enabled\n");
397 return 0;
398 }
399
400 if (dmabuf->enable & DAC_RUNNING)
401 offset = le32_to_cpu(AD1889_READL(state->card, AD_DMA_WAVBA));
402 else
403 offset = le32_to_cpu(AD1889_READL(state->card, AD_DMA_ADCBA));
404
405 return (unsigned long)bus_to_virt((unsigned long)offset) - (unsigned long)dmabuf->rawbuf;
406}
407
408static void ad1889_update_ptr(ad1889_dev_t *dev, int wake)
409{
410 ad1889_state_t *state;
411 struct dmabuf *dmabuf;
412 unsigned long hwptr;
413 int diff;
414
415 /* check ADC first */
416 state = &dev->adc_state;
417 dmabuf = &state->dmabuf;
418 if (dmabuf->enable & ADC_RUNNING) {
419 hwptr = ad1889_get_dma_addr(state);
420 diff = (dmabuf->dmasize + hwptr - dmabuf->hwptr) % dmabuf->dmasize;
421
422 dmabuf->hwptr = hwptr;
423 dmabuf->total_bytes += diff;
424 dmabuf->count += diff;
425 if (dmabuf->count > dmabuf->dmasize)
426 dmabuf->count = dmabuf->dmasize;
427
428 if (dmabuf->mapped) {
429 if (wake & dmabuf->count >= dmabuf->fragsize)
430 wake_up(&dmabuf->wait);
431 } else {
432 if (wake & dmabuf->count > 0)
433 wake_up(&dmabuf->wait);
434 }
435 }
436
437 /* check DAC */
438 state = &dev->wav_state;
439 dmabuf = &state->dmabuf;
440 if (dmabuf->enable & DAC_RUNNING) {
441XXX
442
443}
444#endif
445
446/************************* /dev/dsp interfaces ************************* */
447
448static ssize_t ad1889_read(struct file *file, char __user *buffer, size_t count,
449 loff_t *ppos)
450{
451 return 0;
452}
453
454static ssize_t ad1889_write(struct file *file, const char __user *buffer, size_t count,
455 loff_t *ppos)
456{
457 ad1889_dev_t *dev = (ad1889_dev_t *)file->private_data;
458 ad1889_state_t *state = &dev->state[AD_WAV_STATE];
459 volatile struct dmabuf *dmabuf = &state->dmabuf;
460 ssize_t ret = 0;
461 DECLARE_WAITQUEUE(wait, current);
462
463 mutex_lock(&state->mutex);
464#if 0
465 if (dmabuf->mapped) {
466 ret = -ENXIO;
467 goto err1;
468 }
469#endif
470 if (!access_ok(VERIFY_READ, buffer, count)) {
471 ret = -EFAULT;
472 goto err1;
473 }
474
475 add_wait_queue(&state->dmabuf.wait, &wait);
476
477 /* start filling dma buffer.... */
478 while (count > 0) {
479 long rem;
480 long cnt = count;
481 unsigned long flags;
482
483 for (;;) {
484 long used_bytes;
485 long timeout; /* max time for DMA in jiffies */
486
487 /* buffer is full if wr catches up to rd */
488 spin_lock_irqsave(&state->card->lock, flags);
489 used_bytes = dmabuf->wr_ptr - dmabuf->rd_ptr;
490 timeout = (dmabuf->dma_len * HZ) / dmabuf->rate;
491 spin_unlock_irqrestore(&state->card->lock, flags);
492
493 /* adjust for buffer wrap around */
494 used_bytes = (used_bytes + DMA_SIZE) & (DMA_SIZE - 1);
495
496 /* If at least one page unused */
497 if (used_bytes < (DMA_SIZE - 0x1000))
498 break;
499
500 /* dma buffer full */
501
502 if (file->f_flags & O_NONBLOCK) {
503 ret = -EAGAIN;
504 goto err2;
505 }
506
507 set_current_state(TASK_INTERRUPTIBLE);
508 schedule_timeout(timeout + 1);
509 if (signal_pending(current)) {
510 ret = -ERESTARTSYS;
511 goto err2;
512 }
513 }
514
515 /* watch out for wrapping around static buffer */
516 spin_lock_irqsave(&state->card->lock, flags);
517 rem = DMA_SIZE - dmabuf->wr_ptr;
518 if (cnt > rem)
519 cnt = rem;
520
521 rem = dmabuf->wr_ptr;
522
523 /* update dma pointers */
524 dmabuf->wr_ptr += cnt;
525 dmabuf->wr_ptr &= DMA_SIZE - 1; /* wrap ptr if necessary */
526 spin_unlock_irqrestore(&state->card->lock, flags);
527
528 /* transfer unwrapped chunk */
529 if (copy_from_user(dmabuf->rawbuf + rem, buffer, cnt)) {
530 ret = -EFAULT;
531 goto err2;
532 }
533
534 DBG("Writing 0x%lx bytes to +0x%lx\n", cnt, rem);
535
536 /* update counters */
537 count -= cnt;
538 buffer += cnt;
539 ret += cnt;
540
541 /* we have something to play - go play it! */
542 ad1889_trigger_playback(dev);
543 }
544
545err2:
546 remove_wait_queue(&state->dmabuf.wait, &wait);
547err1:
548 mutex_unlock(&state->mutex);
549 return ret;
550}
551
552static unsigned int ad1889_poll(struct file *file, struct poll_table_struct *wait)
553{
554 unsigned int mask = 0;
555#if 0
556 ad1889_dev_t *dev = (ad1889_dev_t *)file->private_data;
557 ad1889_state_t *state = NULL;
558 struct dmabuf *dmabuf;
559 unsigned long flags;
560
561 if (!(file->f_mode & (FMODE_READ | FMODE_WRITE)))
562 return -EINVAL;
563
564 if (file->f_mode & FMODE_WRITE) {
565 state = &dev->state[AD_WAV_STATE];
566 if (!state) return 0;
567 dmabuf = &state->dmabuf;
568 poll_wait(file, &dmabuf->wait, wait);
569 }
570
571 if (file->f_mode & FMODE_READ) {
572 state = &dev->state[AD_ADC_STATE];
573 if (!state) return 0;
574 dmabuf = &state->dmabuf;
575 poll_wait(file, &dmabuf->wait, wait);
576 }
577
578 spin_lock_irqsave(&dev->lock, flags);
579 ad1889_update_ptr(dev, 0);
580
581 if (file->f_mode & FMODE_WRITE) {
582 state = &dev->state[WAV_STATE];
583 dmabuf = &state->dmabuf;
584 if (dmabuf->mapped) {
585 if (dmabuf->count >= (int)dmabuf->fragsize)
586 mask |= POLLOUT | POLLWRNORM;
587 } else {
588 if ((int)dmabuf->dmasize >= dmabuf->count +
589 (int)dmabuf->fragsize)
590 mask |= POLLOUT | POLLWRNORM;
591 }
592 }
593
594 if (file ->f_mode & FMODE_READ) {
595 state = &dev->state[AD_ADC_STATE];
596 dmabuf = &state->dmabuf;
597 if (dmabuf->count >= (int)dmabuf->fragsize)
598 mask |= POLLIN | POLLRDNORM;
599 }
600 spin_unlock_irqrestore(&dev->lock, flags);
601
602#endif
603 return mask;
604}
605
606static int ad1889_mmap(struct file *file, struct vm_area_struct *vma)
607{
608 return 0;
609}
610
611static int ad1889_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
612 unsigned long arg)
613{
614 int val = 0;
615 ad1889_dev_t *dev = (ad1889_dev_t *)file->private_data;
616 struct dmabuf *dmabuf;
617 audio_buf_info abinfo;
618 int __user *p = (int __user *)arg;
619
620 DBG("ad1889_ioctl cmd 0x%x arg %lu\n", cmd, arg);
621
622 switch (cmd)
623 {
624 case OSS_GETVERSION:
625 return put_user(SOUND_VERSION, p);
626
627 case SNDCTL_DSP_RESET:
628 break;
629
630 case SNDCTL_DSP_SYNC:
631 break;
632
633 case SNDCTL_DSP_SPEED:
634 /* set sampling rate */
635 if (get_user(val, p))
636 return -EFAULT;
637 if (val > 5400 && val < 48000)
638 {
639 if (file->f_mode & FMODE_WRITE)
640 AD1889_WRITEW(ad1889_dev, AD_DS_WAS, val);
641 if (file->f_mode & FMODE_READ)
642 AD1889_WRITEW(ad1889_dev, AD_DS_RES, val);
643 }
644 return 0;
645
646 case SNDCTL_DSP_STEREO: /* undocumented? */
647 if (get_user(val, p))
648 return -EFAULT;
649 if (file->f_mode & FMODE_READ) {
650 val = AD1889_READW(ad1889_dev, AD_DS_WSMC);
651 if (val) {
652 val |= 0x0200; /* set WAST */
653 } else {
654 val &= ~0x0200; /* clear WAST */
655 }
656 AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, val);
657 }
658 if (file->f_mode & FMODE_WRITE) {
659 val = AD1889_READW(ad1889_dev, AD_DS_RAMC);
660 if (val) {
661 val |= 0x0002; /* set ADST */
662 } else {
663 val &= ~0x0002; /* clear ADST */
664 }
665 AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, val);
666 }
667
668 return 0;
669
670 case SNDCTL_DSP_GETBLKSIZE:
671 return put_user(DMA_SIZE, p);
672
673 case SNDCTL_DSP_GETFMTS:
674 return put_user(AFMT_S16_LE|AFMT_U8, p);
675
676 case SNDCTL_DSP_SETFMT:
677 if (get_user(val, p))
678 return -EFAULT;
679
680 if (val == 0) {
681 if (file->f_mode & FMODE_READ)
682 ad1889_set_adc_fmt(dev, val);
683
684 if (file->f_mode & FMODE_WRITE)
685 ad1889_set_wav_fmt(dev, val);
686 } else {
687 val = AFMT_S16_LE | AFMT_U8;
688 }
689
690 return put_user(val, p);
691
692 case SNDCTL_DSP_CHANNELS:
693 break;
694
695 case SNDCTL_DSP_POST:
696 /* send all data to device */
697 break;
698
699 case SNDCTL_DSP_SUBDIVIDE:
700 break;
701
702 case SNDCTL_DSP_SETFRAGMENT:
703 /* not supported; uses fixed fragment sizes */
704 return put_user(DMA_SIZE, p);
705
706 case SNDCTL_DSP_GETOSPACE:
707 case SNDCTL_DSP_GETISPACE:
708 /* space left in dma buffers */
709 if (cmd == SNDCTL_DSP_GETOSPACE)
710 dmabuf = &dev->state[AD_WAV_STATE].dmabuf;
711 else
712 dmabuf = &dev->state[AD_ADC_STATE].dmabuf;
713 abinfo.fragments = 1;
714 abinfo.fragstotal = 1;
715 abinfo.fragsize = DMA_SIZE;
716 abinfo.bytes = DMA_SIZE;
717 return copy_to_user(p, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
718 case SNDCTL_DSP_NONBLOCK:
719 file->f_flags |= O_NONBLOCK;
720 return 0;
721
722 case SNDCTL_DSP_GETCAPS:
723 return put_user(0, p);
724
725 case SNDCTL_DSP_GETTRIGGER:
726 case SNDCTL_DSP_SETTRIGGER:
727 break;
728
729 case SNDCTL_DSP_GETIPTR:
730 case SNDCTL_DSP_GETOPTR:
731 break;
732
733 case SNDCTL_DSP_SETDUPLEX:
734 break;
735
736 case SNDCTL_DSP_GETODELAY:
737 break;
738
739 case SOUND_PCM_READ_RATE:
740 return put_user(AD1889_READW(ad1889_dev, AD_DS_WAS), p);
741
742 case SOUND_PCM_READ_CHANNELS:
743 case SOUND_PCM_READ_BITS:
744 break;
745
746 case SNDCTL_DSP_MAPINBUF:
747 case SNDCTL_DSP_MAPOUTBUF:
748 case SNDCTL_DSP_SETSYNCRO:
749 case SOUND_PCM_WRITE_FILTER:
750 case SOUND_PCM_READ_FILTER:
751 break;
752
753 default:
754 break;
755 }
756
757 return -ENOTTY;
758}
759
760static int ad1889_open(struct inode *inode, struct file *file)
761{
762 /* check minor; only support /dev/dsp atm */
763 if (iminor(inode) != 3)
764 return -ENXIO;
765
766 file->private_data = ad1889_dev;
767
768 ad1889_set_wav_rate(ad1889_dev, 48000);
769 ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE);
770 AD1889_WRITEW(ad1889_dev, AD_DS_WADA, 0x0404); /* attenuation */
771 return nonseekable_open(inode, file);
772}
773
774static int ad1889_release(struct inode *inode, struct file *file)
775{
776 /* if we have state free it here */
777 return 0;
778}
779
780static const struct file_operations ad1889_fops = {
781 .owner = THIS_MODULE,
782 .llseek = no_llseek,
783 .read = ad1889_read,
784 .write = ad1889_write,
785 .poll = ad1889_poll,
786 .ioctl = ad1889_ioctl,
787 .mmap = ad1889_mmap,
788 .open = ad1889_open,
789 .release = ad1889_release,
790};
791
792/************************* /dev/mixer interfaces ************************ */
793static int ad1889_mixer_open(struct inode *inode, struct file *file)
794{
795 if (ad1889_dev->ac97_codec->dev_mixer != iminor(inode))
796 return -ENODEV;
797
798 file->private_data = ad1889_dev->ac97_codec;
799 return 0;
800}
801
802static int ad1889_mixer_release(struct inode *inode, struct file *file)
803{
804 return 0;
805}
806
807static int ad1889_mixer_ioctl(struct inode *inode, struct file *file,
808 unsigned int cmd, unsigned long arg)
809{
810 struct ac97_codec *codec = (struct ac97_codec *)file->private_data;
811 return codec->mixer_ioctl(codec, cmd, arg);
812}
813
814static const struct file_operations ad1889_mixer_fops = {
815 .owner = THIS_MODULE,
816 .llseek = no_llseek,
817 .ioctl = ad1889_mixer_ioctl,
818 .open = ad1889_mixer_open,
819 .release = ad1889_mixer_release,
820};
821
822/************************* AC97 interfaces ****************************** */
823static void ad1889_codec_write(struct ac97_codec *ac97, u8 reg, u16 val)
824{
825 ad1889_dev_t *dev = ac97->private_data;
826
827 //DBG("Writing 0x%x to 0x%lx\n", val, dev->regbase + AD_AC97_BASE + reg);
828 AD1889_WRITEW(dev, AD_AC97_BASE + reg, val);
829}
830
831static u16 ad1889_codec_read(struct ac97_codec *ac97, u8 reg)
832{
833 ad1889_dev_t *dev = ac97->private_data;
834 //DBG("Reading from 0x%lx\n", dev->regbase + AD_AC97_BASE + reg);
835 return AD1889_READW(dev, AD_AC97_BASE + reg);
836}
837
838static int ad1889_ac97_init(ad1889_dev_t *dev, int id)
839{
840 struct ac97_codec *ac97;
841 u16 eid;
842
843 if ((ac97 = ac97_alloc_codec()) == NULL)
844 return -ENOMEM;
845
846 ac97->private_data = dev;
847 ac97->id = id;
848
849 ac97->codec_read = ad1889_codec_read;
850 ac97->codec_write = ad1889_codec_write;
851
852 if (ac97_probe_codec(ac97) == 0) {
853 printk(DEVNAME ": ac97_probe_codec failed\n");
854 goto out_free;
855 }
856
857 eid = ad1889_codec_read(ac97, AC97_EXTENDED_ID);
858 if (eid == 0xffff) {
859 printk(KERN_WARNING DEVNAME ": no codec attached?\n");
860 goto out_free;
861 }
862
863 dev->ac97_features = eid;
864
865 if ((ac97->dev_mixer = register_sound_mixer(&ad1889_mixer_fops, -1)) < 0) {
866 printk(KERN_ERR DEVNAME ": cannot register mixer\n");
867 goto out_free;
868 }
869
870 dev->ac97_codec = ac97;
871 return 0;
872
873out_free:
874 ac97_release_codec(ac97);
875 return -ENODEV;
876}
877
878static int ad1889_aclink_reset(struct pci_dev * pcidev)
879{
880 u16 stat;
881 int retry = 200;
882 ad1889_dev_t *dev = pci_get_drvdata(pcidev);
883
884 AD1889_WRITEW(dev, AD_DS_CCS, 0x8000); /* turn on clock */
885 AD1889_READW(dev, AD_DS_CCS);
886
887 WAIT_10MS();
888
889 stat = AD1889_READW(dev, AD_AC97_ACIC);
890 stat |= 0x0002; /* Reset Disable */
891 AD1889_WRITEW(dev, AD_AC97_ACIC, stat);
892 (void) AD1889_READW(dev, AD_AC97_ACIC); /* flush posted write */
893
894 udelay(10);
895
896 stat = AD1889_READW(dev, AD_AC97_ACIC);
897 stat |= 0x0001; /* Interface Enable */
898 AD1889_WRITEW(dev, AD_AC97_ACIC, stat);
899
900 do {
901 if (AD1889_READW(dev, AD_AC97_ACIC) & 0x8000) /* Ready */
902 break;
903 WAIT_10MS();
904 retry--;
905 } while (retry > 0);
906
907 if (!retry) {
908 printk(KERN_ERR "ad1889_aclink_reset: codec is not ready [0x%x]\n",
909 AD1889_READW(dev, AD_AC97_ACIC));
910 return -EBUSY;
911 }
912
913 /* TODO reset AC97 codec */
914 /* TODO set wave/adc pci ctrl status */
915
916 stat = AD1889_READW(dev, AD_AC97_ACIC);
917 stat |= 0x0004; /* Audio Stream Output Enable */
918 AD1889_WRITEW(dev, AD_AC97_ACIC, stat);
919 return 0;
920}
921
922/************************* PCI interfaces ****************************** */
923/* PCI device table */
924static struct pci_device_id ad1889_id_tbl[] = {
925 { PCI_VENDOR_ID_ANALOG_DEVICES, PCI_DEVICE_ID_AD1889JS, PCI_ANY_ID,
926 PCI_ANY_ID, 0, 0, (unsigned long)DEVNAME },
927 { },
928};
929MODULE_DEVICE_TABLE(pci, ad1889_id_tbl);
930
931static irqreturn_t ad1889_interrupt(int irq, void *dev_id)
932{
933 u32 stat;
934 ad1889_dev_t *dev = (ad1889_dev_t *)dev_id;
935
936 stat = AD1889_READL(dev, AD_DMA_DISR);
937
938 /* clear ISR */
939 AD1889_WRITEL(dev, AD_DMA_DISR, stat);
940
941 if (stat & 0x8) { /* WAVI */
942 DBG("WAV interrupt\n");
943 dev->stats.wav_intrs++;
944 if (dev->state[AD_WAV_STATE].dmabuf.ready) {
945 ad1889_stop_wav(&dev->state[AD_WAV_STATE]); /* clean up */
946 ad1889_start_wav(&dev->state[AD_WAV_STATE]); /* start new */
947 }
948 }
949
950 if ((stat & 0x2) && dev->state[AD_ADC_STATE].dmabuf.ready) { /* ADCI */
951 DBG("ADC interrupt\n");
952 dev->stats.adc_intrs++;
953 }
954 if(stat)
955 return IRQ_HANDLED;
956 return IRQ_NONE;
957}
958
959static void ad1889_initcfg(ad1889_dev_t *dev)
960{
961 u16 tmp16;
962 u32 tmp32;
963
964 /* make sure the interrupt bits are setup the way we want */
965 tmp32 = AD1889_READL(dev, AD_DMA_WAVCTRL);
966 tmp32 &= ~0xff; /* flat dma, no sg, mask out the intr bits */
967 tmp32 |= 0x6; /* intr on count, loop */
968 AD1889_WRITEL(dev, AD_DMA_WAVCTRL, tmp32);
969
970 /* unmute... */
971 tmp16 = AD1889_READW(dev, AD_DS_WADA);
972 tmp16 &= ~0x8080;
973 AD1889_WRITEW(dev, AD_DS_WADA, tmp16);
974}
975
976static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
977{
978 int err;
979 ad1889_dev_t *dev;
980 unsigned long bar;
981 struct proc_dir_entry *proc_root = NULL;
982
983 if ((err = pci_enable_device(pcidev)) != 0) {
984 printk(KERN_ERR DEVNAME ": pci_enable_device failed\n");
985 return err;
986 }
987
988 pci_set_master(pcidev);
989 if ((dev = ad1889_alloc_dev(pcidev)) == NULL) {
990 printk(KERN_ERR DEVNAME ": cannot allocate memory for device\n");
991 return -ENOMEM;
992 }
993 pci_set_drvdata(pcidev, dev);
994 bar = pci_resource_start(pcidev, 0);
995
996 if (!(pci_resource_flags(pcidev, 0) & IORESOURCE_MEM)) {
997 printk(KERN_ERR DEVNAME ": memory region not assigned\n");
998 goto out1;
999 }
1000
1001 if (pci_request_region(pcidev, 0, DEVNAME)) {
1002 printk(KERN_ERR DEVNAME ": unable to request memory region\n");
1003 goto out1;
1004 }
1005
1006 dev->regbase = ioremap_nocache(bar, AD_DS_IOMEMSIZE);
1007 if (!dev->regbase) {
1008 printk(KERN_ERR DEVNAME ": unable to remap iomem\n");
1009 goto out2;
1010 }
1011
1012 if (request_irq(pcidev->irq, ad1889_interrupt, IRQF_SHARED, DEVNAME, dev) != 0) {
1013 printk(KERN_ERR DEVNAME ": unable to request interrupt\n");
1014 goto out3;
1015 }
1016
1017 printk(KERN_INFO DEVNAME ": %s at %p IRQ %d\n",
1018 (char *)ent->driver_data, dev->regbase, pcidev->irq);
1019
1020 if (ad1889_aclink_reset(pcidev) != 0)
1021 goto out4;
1022
1023 /* register /dev/dsp */
1024 if ((dev->dev_audio = register_sound_dsp(&ad1889_fops, -1)) < 0) {
1025 printk(KERN_ERR DEVNAME ": cannot register /dev/dsp\n");
1026 goto out4;
1027 }
1028
1029 if ((err = ad1889_ac97_init(dev, 0)) != 0)
1030 goto out5;
1031
1032 /* XXX: cleanups */
1033 if (((proc_root = proc_mkdir("driver/ad1889", NULL)) == NULL) ||
1034 create_proc_read_entry("ac97", S_IFREG|S_IRUGO, proc_root, ac97_read_proc, dev->ac97_codec) == NULL ||
1035 create_proc_read_entry("info", S_IFREG|S_IRUGO, proc_root, ad1889_read_proc, dev) == NULL)
1036 goto out5;
1037
1038 ad1889_initcfg(dev);
1039
1040 //DBG(DEVNAME ": Driver initialization done!\n");
1041
1042 ad1889_dev = dev;
1043
1044 return 0;
1045
1046out5:
1047 unregister_sound_dsp(dev->dev_audio);
1048out4:
1049 free_irq(pcidev->irq, dev);
1050out3:
1051 iounmap(dev->regbase);
1052out2:
1053 pci_release_region(pcidev, 0);
1054out1:
1055 ad1889_free_dev(dev);
1056 pci_set_drvdata(pcidev, NULL);
1057
1058 return -ENODEV;
1059}
1060
1061static void __devexit ad1889_remove(struct pci_dev *pcidev)
1062{
1063 ad1889_dev_t *dev = pci_get_drvdata(pcidev);
1064
1065 if (dev == NULL) return;
1066
1067 unregister_sound_mixer(dev->ac97_codec->dev_mixer);
1068 unregister_sound_dsp(dev->dev_audio);
1069 free_irq(pcidev->irq, dev);
1070 iounmap(dev->regbase);
1071 pci_release_region(pcidev, 0);
1072
1073 /* any hw programming needed? */
1074 ad1889_free_dev(dev);
1075 pci_set_drvdata(pcidev, NULL);
1076}
1077
1078MODULE_AUTHOR("Randolph Chung");
1079MODULE_DESCRIPTION("Analog Devices AD1889 PCI Audio");
1080MODULE_LICENSE("GPL");
1081
1082static struct pci_driver ad1889_driver = {
1083 .name = DEVNAME,
1084 .id_table = ad1889_id_tbl,
1085 .probe = ad1889_probe,
1086 .remove = __devexit_p(ad1889_remove),
1087};
1088
1089static int __init ad1889_init_module(void)
1090{
1091 return pci_register_driver(&ad1889_driver);
1092}
1093
1094static void ad1889_exit_module(void)
1095{
1096 pci_unregister_driver(&ad1889_driver);
1097 return;
1098}
1099
1100module_init(ad1889_init_module);
1101module_exit(ad1889_exit_module);
diff --git a/sound/oss/ad1889.h b/sound/oss/ad1889.h
deleted file mode 100644
index 09913765967a..000000000000
--- a/sound/oss/ad1889.h
+++ /dev/null
@@ -1,135 +0,0 @@
1#ifndef _AD1889_H_
2#define _AD1889_H_
3
4#define AD_DS_WSMC 0x00 /* DMA input wave/syn mixer control */
5#define AD_DS_RAMC 0x02 /* DMA output resamp/ADC mixer control */
6#define AD_DS_WADA 0x04 /* DMA input wave attenuation */
7#define AD_DS_SYDA 0x06 /* DMA input syn attentuation */
8#define AD_DS_WAS 0x08 /* wave input sample rate */
9#define AD_DS_RES 0x0a /* resampler output sample rate */
10#define AD_DS_CCS 0x0c /* chip control/status */
11
12#define AD_DMA_RESBA 0x40 /* RES base addr */
13#define AD_DMA_RESCA 0x44 /* RES current addr */
14#define AD_DMA_RESBC 0x48 /* RES base cnt */
15#define AD_DMA_RESCC 0x4c /* RES current count */
16#define AD_DMA_ADCBA 0x50 /* ADC */
17#define AD_DMA_ADCCA 0x54
18#define AD_DMA_ADCBC 0x58
19#define AD_DMA_ADCCC 0x5c
20#define AD_DMA_SYNBA 0x60 /* SYN */
21#define AD_DMA_SYNCA 0x64
22#define AD_DMA_SYNBC 0x68
23#define AD_DMA_SYNCC 0x6c
24#define AD_DMA_WAVBA 0x70 /* WAV */
25#define AD_DMA_WAVCA 0x74
26#define AD_DMA_WAVBC 0x78
27#define AD_DMA_WAVCC 0x7c
28#define AD_DMA_RESICC 0x80 /* RES interrupt current count */
29#define AD_DMA_RESIBC 0x84 /* RES interrupt base count */
30#define AD_DMA_ADCICC 0x88 /* ADC interrupt current count */
31#define AD_DMA_ADCIBC 0x8c /* ADC interrupt base count */
32#define AD_DMA_SYNICC 0x90 /* SYN interrupt current count */
33#define AD_DMA_SYNIBC 0x94 /* SYN interrupt base count */
34#define AD_DMA_WAVICC 0x98 /* WAV interrupt current count */
35#define AD_DMA_WAVIBC 0x9c /* WAV interrupt base count */
36#define AD_DMA_RESCTRL 0xa0 /* RES PCI control/status */
37#define AD_DMA_ADCCTRL 0xa8 /* ADC PCI control/status */
38#define AD_DMA_SYNCTRL 0xb0 /* SYN PCI control/status */
39#define AD_DMA_WAVCTRL 0xb8 /* WAV PCI control/status */
40#define AD_DMA_DISR 0xc0 /* PCI DMA intr status */
41#define AD_DMA_CHSS 0xc4 /* PCI DMA channel stop status */
42
43#define AD_GPIO_IPC 0xc8 /* IO port ctrl */
44#define AD_GPIO_OP 0xca /* IO output status */
45#define AD_GPIO_IP 0xcc /* IO input status */
46
47/* AC97 registers, 0x100 - 0x17f; see ac97.h */
48#define AD_AC97_BASE 0x100 /* ac97 base register */
49#define AD_AC97_ACIC 0x180 /* AC Link interface ctrl */
50
51/* OPL3; BAR1 */
52#define AD_OPL_M0AS 0x00 /* Music0 address/status */
53#define AD_OPL_M0DATA 0x01 /* Music0 data */
54#define AD_OPL_M1A 0x02 /* Music1 address */
55#define AD_OPL_M1DATA 0x03 /* Music1 data */
56/* 0x04-0x0f reserved */
57
58/* MIDI; BAR2 */
59#define AD_MIDA 0x00 /* MIDI data */
60#define AD_MISC 0x01 /* MIDI status/cmd */
61/* 0x02-0xff reserved */
62
63#define AD_DS_IOMEMSIZE 512
64#define AD_OPL_MEMSIZE 16
65#define AD_MIDI_MEMSIZE 16
66
67#define AD_WAV_STATE 0
68#define AD_ADC_STATE 1
69#define AD_MAX_STATES 2
70
71#define DMA_SIZE (128*1024)
72
73#define DMA_FLAG_MAPPED 1
74
75struct ad1889_dev;
76
77typedef struct ad1889_state {
78 struct ad1889_dev *card;
79
80 mode_t open_mode;
81 struct dmabuf {
82 unsigned int rate;
83 unsigned char fmt, enable;
84
85 /* buf management */
86 size_t rawbuf_size;
87 void *rawbuf;
88 dma_addr_t dma_handle; /* mapped address */
89 unsigned long dma_len; /* number of bytes mapped */
90
91 /* indexes into rawbuf for setting up DMA engine */
92 volatile unsigned long rd_ptr, wr_ptr;
93
94 wait_queue_head_t wait; /* to wait for buf servicing */
95
96 /* OSS bits */
97 unsigned int mapped:1;
98 unsigned int ready:1;
99 unsigned int ossfragshift;
100 int ossmaxfrags;
101 unsigned int subdivision;
102 } dmabuf;
103
104 struct mutex mutex;
105} ad1889_state_t;
106
107typedef struct ad1889_dev {
108 void __iomem *regbase;
109 struct pci_dev *pci;
110
111 spinlock_t lock;
112
113 int dev_audio;
114
115 /* states; one per channel; right now only WAV and ADC */
116 struct ad1889_state state[AD_MAX_STATES];
117
118 /* AC97 codec */
119 struct ac97_codec *ac97_codec;
120 u16 ac97_features;
121
122 /* debugging stuff */
123 struct stats {
124 unsigned int wav_intrs, adc_intrs;
125 unsigned int blocks, underrun, error;
126 } stats;
127} ad1889_dev_t;
128
129typedef struct ad1889_reg {
130 const char *name;
131 int offset;
132 int width;
133} ad1889_reg_t;
134
135#endif
diff --git a/sound/oss/adlib_card.c b/sound/oss/adlib_card.c
deleted file mode 100644
index c9a7c9b470de..000000000000
--- a/sound/oss/adlib_card.c
+++ /dev/null
@@ -1,73 +0,0 @@
1/*
2 * sound/oss/adlib_card.c
3 *
4 * Detection routine for the AdLib card.
5 *
6 * Copyright (C) by Hannu Savolainen 1993-1997
7 *
8 * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
9 * Version 2 (June 1991). See the "COPYING" file distributed with this software
10 * for more info.
11 */
12
13#include <linux/module.h>
14#include <linux/init.h>
15
16#include "sound_config.h"
17
18#include "opl3.h"
19
20static void __init attach_adlib_card(struct address_info *hw_config)
21{
22 hw_config->slots[0] = opl3_init(hw_config->io_base, hw_config->osp, THIS_MODULE);
23}
24
25static int __init probe_adlib(struct address_info *hw_config)
26{
27 return opl3_detect(hw_config->io_base, hw_config->osp);
28}
29
30static struct address_info cfg;
31
32static int __initdata io = -1;
33
34module_param(io, int, 0);
35
36static int __init init_adlib(void)
37{
38 cfg.io_base = io;
39
40 if (cfg.io_base == -1) {
41 printk(KERN_ERR "adlib: must specify I/O address.\n");
42 return -EINVAL;
43 }
44 if (probe_adlib(&cfg) == 0)
45 return -ENODEV;
46 attach_adlib_card(&cfg);
47
48 return 0;
49}
50
51static void __exit cleanup_adlib(void)
52{
53 sound_unload_synthdev(cfg.slots[0]);
54
55}
56
57module_init(init_adlib);
58module_exit(cleanup_adlib);
59
60#ifndef MODULE
61static int __init setup_adlib(char *str)
62{
63 /* io */
64 int ints[2];
65 str = get_options(str, ARRAY_SIZE(ints), ints);
66
67 io = ints[1];
68
69 return 1;
70}
71__setup("adlib=", setup_adlib);
72#endif
73MODULE_LICENSE("GPL");
diff --git a/sound/oss/cs461x.h b/sound/oss/cs461x.h
deleted file mode 100644
index 0ce41338e6dd..000000000000
--- a/sound/oss/cs461x.h
+++ /dev/null
@@ -1,1691 +0,0 @@
1#ifndef __CS461X_H
2#define __CS461X_H
3
4/*
5 * Copyright (c) by Cirrus Logic Corporation <pcaudio@crystal.cirrus.com>
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
7 * Definitions for Cirrus Logic CS461x chips
8 *
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 */
25
26#ifndef PCI_VENDOR_ID_CIRRUS
27#define PCI_VENDOR_ID_CIRRUS 0x1013
28#endif
29#ifndef PCI_DEVICE_ID_CIRRUS_4610
30#define PCI_DEVICE_ID_CIRRUS_4610 0x6001
31#endif
32#ifndef PCI_DEVICE_ID_CIRRUS_4612
33#define PCI_DEVICE_ID_CIRRUS_4612 0x6003
34#endif
35#ifndef PCI_DEVICE_ID_CIRRUS_4615
36#define PCI_DEVICE_ID_CIRRUS_4615 0x6004
37#endif
38
39/*
40 * Direct registers
41 */
42
43/*
44 * The following define the offsets of the registers accessed via base address
45 * register zero on the CS461x part.
46 */
47#define BA0_HISR 0x00000000
48#define BA0_HSR0 0x00000004
49#define BA0_HICR 0x00000008
50#define BA0_DMSR 0x00000100
51#define BA0_HSAR 0x00000110
52#define BA0_HDAR 0x00000114
53#define BA0_HDMR 0x00000118
54#define BA0_HDCR 0x0000011C
55#define BA0_PFMC 0x00000200
56#define BA0_PFCV1 0x00000204
57#define BA0_PFCV2 0x00000208
58#define BA0_PCICFG00 0x00000300
59#define BA0_PCICFG04 0x00000304
60#define BA0_PCICFG08 0x00000308
61#define BA0_PCICFG0C 0x0000030C
62#define BA0_PCICFG10 0x00000310
63#define BA0_PCICFG14 0x00000314
64#define BA0_PCICFG18 0x00000318
65#define BA0_PCICFG1C 0x0000031C
66#define BA0_PCICFG20 0x00000320
67#define BA0_PCICFG24 0x00000324
68#define BA0_PCICFG28 0x00000328
69#define BA0_PCICFG2C 0x0000032C
70#define BA0_PCICFG30 0x00000330
71#define BA0_PCICFG34 0x00000334
72#define BA0_PCICFG38 0x00000338
73#define BA0_PCICFG3C 0x0000033C
74#define BA0_CLKCR1 0x00000400
75#define BA0_CLKCR2 0x00000404
76#define BA0_PLLM 0x00000408
77#define BA0_PLLCC 0x0000040C
78#define BA0_FRR 0x00000410
79#define BA0_CFL1 0x00000414
80#define BA0_CFL2 0x00000418
81#define BA0_SERMC1 0x00000420
82#define BA0_SERMC2 0x00000424
83#define BA0_SERC1 0x00000428
84#define BA0_SERC2 0x0000042C
85#define BA0_SERC3 0x00000430
86#define BA0_SERC4 0x00000434
87#define BA0_SERC5 0x00000438
88#define BA0_SERBSP 0x0000043C
89#define BA0_SERBST 0x00000440
90#define BA0_SERBCM 0x00000444
91#define BA0_SERBAD 0x00000448
92#define BA0_SERBCF 0x0000044C
93#define BA0_SERBWP 0x00000450
94#define BA0_SERBRP 0x00000454
95#ifndef NO_CS4612
96#define BA0_ASER_FADDR 0x00000458
97#endif
98#define BA0_ACCTL 0x00000460
99#define BA0_ACSTS 0x00000464
100#define BA0_ACOSV 0x00000468
101#define BA0_ACCAD 0x0000046C
102#define BA0_ACCDA 0x00000470
103#define BA0_ACISV 0x00000474
104#define BA0_ACSAD 0x00000478
105#define BA0_ACSDA 0x0000047C
106#define BA0_JSPT 0x00000480
107#define BA0_JSCTL 0x00000484
108#define BA0_JSC1 0x00000488
109#define BA0_JSC2 0x0000048C
110#define BA0_MIDCR 0x00000490
111#define BA0_MIDSR 0x00000494
112#define BA0_MIDWP 0x00000498
113#define BA0_MIDRP 0x0000049C
114#define BA0_JSIO 0x000004A0
115#ifndef NO_CS4612
116#define BA0_ASER_MASTER 0x000004A4
117#endif
118#define BA0_CFGI 0x000004B0
119#define BA0_SSVID 0x000004B4
120#define BA0_GPIOR 0x000004B8
121#ifndef NO_CS4612
122#define BA0_EGPIODR 0x000004BC
123#define BA0_EGPIOPTR 0x000004C0
124#define BA0_EGPIOTR 0x000004C4
125#define BA0_EGPIOWR 0x000004C8
126#define BA0_EGPIOSR 0x000004CC
127#define BA0_SERC6 0x000004D0
128#define BA0_SERC7 0x000004D4
129#define BA0_SERACC 0x000004D8
130#define BA0_ACCTL2 0x000004E0
131#define BA0_ACSTS2 0x000004E4
132#define BA0_ACOSV2 0x000004E8
133#define BA0_ACCAD2 0x000004EC
134#define BA0_ACCDA2 0x000004F0
135#define BA0_ACISV2 0x000004F4
136#define BA0_ACSAD2 0x000004F8
137#define BA0_ACSDA2 0x000004FC
138#define BA0_IOTAC0 0x00000500
139#define BA0_IOTAC1 0x00000504
140#define BA0_IOTAC2 0x00000508
141#define BA0_IOTAC3 0x0000050C
142#define BA0_IOTAC4 0x00000510
143#define BA0_IOTAC5 0x00000514
144#define BA0_IOTAC6 0x00000518
145#define BA0_IOTAC7 0x0000051C
146#define BA0_IOTAC8 0x00000520
147#define BA0_IOTAC9 0x00000524
148#define BA0_IOTAC10 0x00000528
149#define BA0_IOTAC11 0x0000052C
150#define BA0_IOTFR0 0x00000540
151#define BA0_IOTFR1 0x00000544
152#define BA0_IOTFR2 0x00000548
153#define BA0_IOTFR3 0x0000054C
154#define BA0_IOTFR4 0x00000550
155#define BA0_IOTFR5 0x00000554
156#define BA0_IOTFR6 0x00000558
157#define BA0_IOTFR7 0x0000055C
158#define BA0_IOTFIFO 0x00000580
159#define BA0_IOTRRD 0x00000584
160#define BA0_IOTFP 0x00000588
161#define BA0_IOTCR 0x0000058C
162#define BA0_DPCID 0x00000590
163#define BA0_DPCIA 0x00000594
164#define BA0_DPCIC 0x00000598
165#define BA0_PCPCIR 0x00000600
166#define BA0_PCPCIG 0x00000604
167#define BA0_PCPCIEN 0x00000608
168#define BA0_EPCIPMC 0x00000610
169#endif
170
171/*
172 * The following define the offsets of the registers and memories accessed via
173 * base address register one on the CS461x part.
174 */
175#define BA1_SP_DMEM0 0x00000000
176#define BA1_SP_DMEM1 0x00010000
177#define BA1_SP_PMEM 0x00020000
178#define BA1_SP_REG 0x00030000
179#define BA1_SPCR 0x00030000
180#define BA1_DREG 0x00030004
181#define BA1_DSRWP 0x00030008
182#define BA1_TWPR 0x0003000C
183#define BA1_SPWR 0x00030010
184#define BA1_SPIR 0x00030014
185#define BA1_FGR1 0x00030020
186#define BA1_SPCS 0x00030028
187#define BA1_SDSR 0x0003002C
188#define BA1_FRMT 0x00030030
189#define BA1_FRCC 0x00030034
190#define BA1_FRSC 0x00030038
191#define BA1_OMNI_MEM 0x000E0000
192
193/*
194 * The following defines are for the flags in the host interrupt status
195 * register.
196 */
197#define HISR_VC_MASK 0x0000FFFF
198#define HISR_VC0 0x00000001
199#define HISR_VC1 0x00000002
200#define HISR_VC2 0x00000004
201#define HISR_VC3 0x00000008
202#define HISR_VC4 0x00000010
203#define HISR_VC5 0x00000020
204#define HISR_VC6 0x00000040
205#define HISR_VC7 0x00000080
206#define HISR_VC8 0x00000100
207#define HISR_VC9 0x00000200
208#define HISR_VC10 0x00000400
209#define HISR_VC11 0x00000800
210#define HISR_VC12 0x00001000
211#define HISR_VC13 0x00002000
212#define HISR_VC14 0x00004000
213#define HISR_VC15 0x00008000
214#define HISR_INT0 0x00010000
215#define HISR_INT1 0x00020000
216#define HISR_DMAI 0x00040000
217#define HISR_FROVR 0x00080000
218#define HISR_MIDI 0x00100000
219#ifdef NO_CS4612
220#define HISR_RESERVED 0x0FE00000
221#else
222#define HISR_SBINT 0x00200000
223#define HISR_RESERVED 0x0FC00000
224#endif
225#define HISR_H0P 0x40000000
226#define HISR_INTENA 0x80000000
227
228/*
229 * The following defines are for the flags in the host signal register 0.
230 */
231#define HSR0_VC_MASK 0xFFFFFFFF
232#define HSR0_VC16 0x00000001
233#define HSR0_VC17 0x00000002
234#define HSR0_VC18 0x00000004
235#define HSR0_VC19 0x00000008
236#define HSR0_VC20 0x00000010
237#define HSR0_VC21 0x00000020
238#define HSR0_VC22 0x00000040
239#define HSR0_VC23 0x00000080
240#define HSR0_VC24 0x00000100
241#define HSR0_VC25 0x00000200
242#define HSR0_VC26 0x00000400
243#define HSR0_VC27 0x00000800
244#define HSR0_VC28 0x00001000
245#define HSR0_VC29 0x00002000
246#define HSR0_VC30 0x00004000
247#define HSR0_VC31 0x00008000
248#define HSR0_VC32 0x00010000
249#define HSR0_VC33 0x00020000
250#define HSR0_VC34 0x00040000
251#define HSR0_VC35 0x00080000
252#define HSR0_VC36 0x00100000
253#define HSR0_VC37 0x00200000
254#define HSR0_VC38 0x00400000
255#define HSR0_VC39 0x00800000
256#define HSR0_VC40 0x01000000
257#define HSR0_VC41 0x02000000
258#define HSR0_VC42 0x04000000
259#define HSR0_VC43 0x08000000
260#define HSR0_VC44 0x10000000
261#define HSR0_VC45 0x20000000
262#define HSR0_VC46 0x40000000
263#define HSR0_VC47 0x80000000
264
265/*
266 * The following defines are for the flags in the host interrupt control
267 * register.
268 */
269#define HICR_IEV 0x00000001
270#define HICR_CHGM 0x00000002
271
272/*
273 * The following defines are for the flags in the DMA status register.
274 */
275#define DMSR_HP 0x00000001
276#define DMSR_HR 0x00000002
277#define DMSR_SP 0x00000004
278#define DMSR_SR 0x00000008
279
280/*
281 * The following defines are for the flags in the host DMA source address
282 * register.
283 */
284#define HSAR_HOST_ADDR_MASK 0xFFFFFFFF
285#define HSAR_DSP_ADDR_MASK 0x0000FFFF
286#define HSAR_MEMID_MASK 0x000F0000
287#define HSAR_MEMID_SP_DMEM0 0x00000000
288#define HSAR_MEMID_SP_DMEM1 0x00010000
289#define HSAR_MEMID_SP_PMEM 0x00020000
290#define HSAR_MEMID_SP_DEBUG 0x00030000
291#define HSAR_MEMID_OMNI_MEM 0x000E0000
292#define HSAR_END 0x40000000
293#define HSAR_ERR 0x80000000
294
295/*
296 * The following defines are for the flags in the host DMA destination address
297 * register.
298 */
299#define HDAR_HOST_ADDR_MASK 0xFFFFFFFF
300#define HDAR_DSP_ADDR_MASK 0x0000FFFF
301#define HDAR_MEMID_MASK 0x000F0000
302#define HDAR_MEMID_SP_DMEM0 0x00000000
303#define HDAR_MEMID_SP_DMEM1 0x00010000
304#define HDAR_MEMID_SP_PMEM 0x00020000
305#define HDAR_MEMID_SP_DEBUG 0x00030000
306#define HDAR_MEMID_OMNI_MEM 0x000E0000
307#define HDAR_END 0x40000000
308#define HDAR_ERR 0x80000000
309
310/*
311 * The following defines are for the flags in the host DMA control register.
312 */
313#define HDMR_AC_MASK 0x0000F000
314#define HDMR_AC_8_16 0x00001000
315#define HDMR_AC_M_S 0x00002000
316#define HDMR_AC_B_L 0x00004000
317#define HDMR_AC_S_U 0x00008000
318
319/*
320 * The following defines are for the flags in the host DMA control register.
321 */
322#define HDCR_COUNT_MASK 0x000003FF
323#define HDCR_DONE 0x00004000
324#define HDCR_OPT 0x00008000
325#define HDCR_WBD 0x00400000
326#define HDCR_WBS 0x00800000
327#define HDCR_DMS_MASK 0x07000000
328#define HDCR_DMS_LINEAR 0x00000000
329#define HDCR_DMS_16_DWORDS 0x01000000
330#define HDCR_DMS_32_DWORDS 0x02000000
331#define HDCR_DMS_64_DWORDS 0x03000000
332#define HDCR_DMS_128_DWORDS 0x04000000
333#define HDCR_DMS_256_DWORDS 0x05000000
334#define HDCR_DMS_512_DWORDS 0x06000000
335#define HDCR_DMS_1024_DWORDS 0x07000000
336#define HDCR_DH 0x08000000
337#define HDCR_SMS_MASK 0x70000000
338#define HDCR_SMS_LINEAR 0x00000000
339#define HDCR_SMS_16_DWORDS 0x10000000
340#define HDCR_SMS_32_DWORDS 0x20000000
341#define HDCR_SMS_64_DWORDS 0x30000000
342#define HDCR_SMS_128_DWORDS 0x40000000
343#define HDCR_SMS_256_DWORDS 0x50000000
344#define HDCR_SMS_512_DWORDS 0x60000000
345#define HDCR_SMS_1024_DWORDS 0x70000000
346#define HDCR_SH 0x80000000
347#define HDCR_COUNT_SHIFT 0
348
349/*
350 * The following defines are for the flags in the performance monitor control
351 * register.
352 */
353#define PFMC_C1SS_MASK 0x0000001F
354#define PFMC_C1EV 0x00000020
355#define PFMC_C1RS 0x00008000
356#define PFMC_C2SS_MASK 0x001F0000
357#define PFMC_C2EV 0x00200000
358#define PFMC_C2RS 0x80000000
359#define PFMC_C1SS_SHIFT 0
360#define PFMC_C2SS_SHIFT 16
361#define PFMC_BUS_GRANT 0
362#define PFMC_GRANT_AFTER_REQ 1
363#define PFMC_TRANSACTION 2
364#define PFMC_DWORD_TRANSFER 3
365#define PFMC_SLAVE_READ 4
366#define PFMC_SLAVE_WRITE 5
367#define PFMC_PREEMPTION 6
368#define PFMC_DISCONNECT_RETRY 7
369#define PFMC_INTERRUPT 8
370#define PFMC_BUS_OWNERSHIP 9
371#define PFMC_TRANSACTION_LAG 10
372#define PFMC_PCI_CLOCK 11
373#define PFMC_SERIAL_CLOCK 12
374#define PFMC_SP_CLOCK 13
375
376/*
377 * The following defines are for the flags in the performance counter value 1
378 * register.
379 */
380#define PFCV1_PC1V_MASK 0xFFFFFFFF
381#define PFCV1_PC1V_SHIFT 0
382
383/*
384 * The following defines are for the flags in the performance counter value 2
385 * register.
386 */
387#define PFCV2_PC2V_MASK 0xFFFFFFFF
388#define PFCV2_PC2V_SHIFT 0
389
390/*
391 * The following defines are for the flags in the clock control register 1.
392 */
393#define CLKCR1_OSCS 0x00000001
394#define CLKCR1_OSCP 0x00000002
395#define CLKCR1_PLLSS_MASK 0x0000000C
396#define CLKCR1_PLLSS_SERIAL 0x00000000
397#define CLKCR1_PLLSS_CRYSTAL 0x00000004
398#define CLKCR1_PLLSS_PCI 0x00000008
399#define CLKCR1_PLLSS_RESERVED 0x0000000C
400#define CLKCR1_PLLP 0x00000010
401#define CLKCR1_SWCE 0x00000020
402#define CLKCR1_PLLOS 0x00000040
403
404/*
405 * The following defines are for the flags in the clock control register 2.
406 */
407#define CLKCR2_PDIVS_MASK 0x0000000F
408#define CLKCR2_PDIVS_1 0x00000001
409#define CLKCR2_PDIVS_2 0x00000002
410#define CLKCR2_PDIVS_4 0x00000004
411#define CLKCR2_PDIVS_7 0x00000007
412#define CLKCR2_PDIVS_8 0x00000008
413#define CLKCR2_PDIVS_16 0x00000000
414
415/*
416 * The following defines are for the flags in the PLL multiplier register.
417 */
418#define PLLM_MASK 0x000000FF
419#define PLLM_SHIFT 0
420
421/*
422 * The following defines are for the flags in the PLL capacitor coefficient
423 * register.
424 */
425#define PLLCC_CDR_MASK 0x00000007
426#ifndef NO_CS4610
427#define PLLCC_CDR_240_350_MHZ 0x00000000
428#define PLLCC_CDR_184_265_MHZ 0x00000001
429#define PLLCC_CDR_144_205_MHZ 0x00000002
430#define PLLCC_CDR_111_160_MHZ 0x00000003
431#define PLLCC_CDR_87_123_MHZ 0x00000004
432#define PLLCC_CDR_67_96_MHZ 0x00000005
433#define PLLCC_CDR_52_74_MHZ 0x00000006
434#define PLLCC_CDR_45_58_MHZ 0x00000007
435#endif
436#ifndef NO_CS4612
437#define PLLCC_CDR_271_398_MHZ 0x00000000
438#define PLLCC_CDR_227_330_MHZ 0x00000001
439#define PLLCC_CDR_167_239_MHZ 0x00000002
440#define PLLCC_CDR_150_215_MHZ 0x00000003
441#define PLLCC_CDR_107_154_MHZ 0x00000004
442#define PLLCC_CDR_98_140_MHZ 0x00000005
443#define PLLCC_CDR_73_104_MHZ 0x00000006
444#define PLLCC_CDR_63_90_MHZ 0x00000007
445#endif
446#define PLLCC_LPF_MASK 0x000000F8
447#ifndef NO_CS4610
448#define PLLCC_LPF_23850_60000_KHZ 0x00000000
449#define PLLCC_LPF_7960_26290_KHZ 0x00000008
450#define PLLCC_LPF_4160_10980_KHZ 0x00000018
451#define PLLCC_LPF_1740_4580_KHZ 0x00000038
452#define PLLCC_LPF_724_1910_KHZ 0x00000078
453#define PLLCC_LPF_317_798_KHZ 0x000000F8
454#endif
455#ifndef NO_CS4612
456#define PLLCC_LPF_25580_64530_KHZ 0x00000000
457#define PLLCC_LPF_14360_37270_KHZ 0x00000008
458#define PLLCC_LPF_6100_16020_KHZ 0x00000018
459#define PLLCC_LPF_2540_6690_KHZ 0x00000038
460#define PLLCC_LPF_1050_2780_KHZ 0x00000078
461#define PLLCC_LPF_450_1160_KHZ 0x000000F8
462#endif
463
464/*
465 * The following defines are for the flags in the feature reporting register.
466 */
467#define FRR_FAB_MASK 0x00000003
468#define FRR_MASK_MASK 0x0000001C
469#ifdef NO_CS4612
470#define FRR_CFOP_MASK 0x000000E0
471#else
472#define FRR_CFOP_MASK 0x00000FE0
473#endif
474#define FRR_CFOP_NOT_DVD 0x00000020
475#define FRR_CFOP_A3D 0x00000040
476#define FRR_CFOP_128_PIN 0x00000080
477#ifndef NO_CS4612
478#define FRR_CFOP_CS4280 0x00000800
479#endif
480#define FRR_FAB_SHIFT 0
481#define FRR_MASK_SHIFT 2
482#define FRR_CFOP_SHIFT 5
483
484/*
485 * The following defines are for the flags in the configuration load 1
486 * register.
487 */
488#define CFL1_CLOCK_SOURCE_MASK 0x00000003
489#define CFL1_CLOCK_SOURCE_CS423X 0x00000000
490#define CFL1_CLOCK_SOURCE_AC97 0x00000001
491#define CFL1_CLOCK_SOURCE_CRYSTAL 0x00000002
492#define CFL1_CLOCK_SOURCE_DUAL_AC97 0x00000003
493#define CFL1_VALID_DATA_MASK 0x000000FF
494
495/*
496 * The following defines are for the flags in the configuration load 2
497 * register.
498 */
499#define CFL2_VALID_DATA_MASK 0x000000FF
500
501/*
502 * The following defines are for the flags in the serial port master control
503 * register 1.
504 */
505#define SERMC1_MSPE 0x00000001
506#define SERMC1_PTC_MASK 0x0000000E
507#define SERMC1_PTC_CS423X 0x00000000
508#define SERMC1_PTC_AC97 0x00000002
509#define SERMC1_PTC_DAC 0x00000004
510#define SERMC1_PLB 0x00000010
511#define SERMC1_XLB 0x00000020
512
513/*
514 * The following defines are for the flags in the serial port master control
515 * register 2.
516 */
517#define SERMC2_LROE 0x00000001
518#define SERMC2_MCOE 0x00000002
519#define SERMC2_MCDIV 0x00000004
520
521/*
522 * The following defines are for the flags in the serial port 1 configuration
523 * register.
524 */
525#define SERC1_SO1EN 0x00000001
526#define SERC1_SO1F_MASK 0x0000000E
527#define SERC1_SO1F_CS423X 0x00000000
528#define SERC1_SO1F_AC97 0x00000002
529#define SERC1_SO1F_DAC 0x00000004
530#define SERC1_SO1F_SPDIF 0x00000006
531
532/*
533 * The following defines are for the flags in the serial port 2 configuration
534 * register.
535 */
536#define SERC2_SI1EN 0x00000001
537#define SERC2_SI1F_MASK 0x0000000E
538#define SERC2_SI1F_CS423X 0x00000000
539#define SERC2_SI1F_AC97 0x00000002
540#define SERC2_SI1F_ADC 0x00000004
541#define SERC2_SI1F_SPDIF 0x00000006
542
543/*
544 * The following defines are for the flags in the serial port 3 configuration
545 * register.
546 */
547#define SERC3_SO2EN 0x00000001
548#define SERC3_SO2F_MASK 0x00000006
549#define SERC3_SO2F_DAC 0x00000000
550#define SERC3_SO2F_SPDIF 0x00000002
551
552/*
553 * The following defines are for the flags in the serial port 4 configuration
554 * register.
555 */
556#define SERC4_SO3EN 0x00000001
557#define SERC4_SO3F_MASK 0x00000006
558#define SERC4_SO3F_DAC 0x00000000
559#define SERC4_SO3F_SPDIF 0x00000002
560
561/*
562 * The following defines are for the flags in the serial port 5 configuration
563 * register.
564 */
565#define SERC5_SI2EN 0x00000001
566#define SERC5_SI2F_MASK 0x00000006
567#define SERC5_SI2F_ADC 0x00000000
568#define SERC5_SI2F_SPDIF 0x00000002
569
570/*
571 * The following defines are for the flags in the serial port backdoor sample
572 * pointer register.
573 */
574#define SERBSP_FSP_MASK 0x0000000F
575#define SERBSP_FSP_SHIFT 0
576
577/*
578 * The following defines are for the flags in the serial port backdoor status
579 * register.
580 */
581#define SERBST_RRDY 0x00000001
582#define SERBST_WBSY 0x00000002
583
584/*
585 * The following defines are for the flags in the serial port backdoor command
586 * register.
587 */
588#define SERBCM_RDC 0x00000001
589#define SERBCM_WRC 0x00000002
590
591/*
592 * The following defines are for the flags in the serial port backdoor address
593 * register.
594 */
595#ifdef NO_CS4612
596#define SERBAD_FAD_MASK 0x000000FF
597#else
598#define SERBAD_FAD_MASK 0x000001FF
599#endif
600#define SERBAD_FAD_SHIFT 0
601
602/*
603 * The following defines are for the flags in the serial port backdoor
604 * configuration register.
605 */
606#define SERBCF_HBP 0x00000001
607
608/*
609 * The following defines are for the flags in the serial port backdoor write
610 * port register.
611 */
612#define SERBWP_FWD_MASK 0x000FFFFF
613#define SERBWP_FWD_SHIFT 0
614
615/*
616 * The following defines are for the flags in the serial port backdoor read
617 * port register.
618 */
619#define SERBRP_FRD_MASK 0x000FFFFF
620#define SERBRP_FRD_SHIFT 0
621
622/*
623 * The following defines are for the flags in the async FIFO address register.
624 */
625#ifndef NO_CS4612
626#define ASER_FADDR_A1_MASK 0x000001FF
627#define ASER_FADDR_EN1 0x00008000
628#define ASER_FADDR_A2_MASK 0x01FF0000
629#define ASER_FADDR_EN2 0x80000000
630#define ASER_FADDR_A1_SHIFT 0
631#define ASER_FADDR_A2_SHIFT 16
632#endif
633
634/*
635 * The following defines are for the flags in the AC97 control register.
636 */
637#define ACCTL_RSTN 0x00000001
638#define ACCTL_ESYN 0x00000002
639#define ACCTL_VFRM 0x00000004
640#define ACCTL_DCV 0x00000008
641#define ACCTL_CRW 0x00000010
642#define ACCTL_ASYN 0x00000020
643#ifndef NO_CS4612
644#define ACCTL_TC 0x00000040
645#endif
646
647/*
648 * The following defines are for the flags in the AC97 status register.
649 */
650#define ACSTS_CRDY 0x00000001
651#define ACSTS_VSTS 0x00000002
652#ifndef NO_CS4612
653#define ACSTS_WKUP 0x00000004
654#endif
655
656/*
657 * The following defines are for the flags in the AC97 output slot valid
658 * register.
659 */
660#define ACOSV_SLV3 0x00000001
661#define ACOSV_SLV4 0x00000002
662#define ACOSV_SLV5 0x00000004
663#define ACOSV_SLV6 0x00000008
664#define ACOSV_SLV7 0x00000010
665#define ACOSV_SLV8 0x00000020
666#define ACOSV_SLV9 0x00000040
667#define ACOSV_SLV10 0x00000080
668#define ACOSV_SLV11 0x00000100
669#define ACOSV_SLV12 0x00000200
670
671/*
672 * The following defines are for the flags in the AC97 command address
673 * register.
674 */
675#define ACCAD_CI_MASK 0x0000007F
676#define ACCAD_CI_SHIFT 0
677
678/*
679 * The following defines are for the flags in the AC97 command data register.
680 */
681#define ACCDA_CD_MASK 0x0000FFFF
682#define ACCDA_CD_SHIFT 0
683
684/*
685 * The following defines are for the flags in the AC97 input slot valid
686 * register.
687 */
688#define ACISV_ISV3 0x00000001
689#define ACISV_ISV4 0x00000002
690#define ACISV_ISV5 0x00000004
691#define ACISV_ISV6 0x00000008
692#define ACISV_ISV7 0x00000010
693#define ACISV_ISV8 0x00000020
694#define ACISV_ISV9 0x00000040
695#define ACISV_ISV10 0x00000080
696#define ACISV_ISV11 0x00000100
697#define ACISV_ISV12 0x00000200
698
699/*
700 * The following defines are for the flags in the AC97 status address
701 * register.
702 */
703#define ACSAD_SI_MASK 0x0000007F
704#define ACSAD_SI_SHIFT 0
705
706/*
707 * The following defines are for the flags in the AC97 status data register.
708 */
709#define ACSDA_SD_MASK 0x0000FFFF
710#define ACSDA_SD_SHIFT 0
711
712/*
713 * The following defines are for the flags in the joystick poll/trigger
714 * register.
715 */
716#define JSPT_CAX 0x00000001
717#define JSPT_CAY 0x00000002
718#define JSPT_CBX 0x00000004
719#define JSPT_CBY 0x00000008
720#define JSPT_BA1 0x00000010
721#define JSPT_BA2 0x00000020
722#define JSPT_BB1 0x00000040
723#define JSPT_BB2 0x00000080
724
725/*
726 * The following defines are for the flags in the joystick control register.
727 */
728#define JSCTL_SP_MASK 0x00000003
729#define JSCTL_SP_SLOW 0x00000000
730#define JSCTL_SP_MEDIUM_SLOW 0x00000001
731#define JSCTL_SP_MEDIUM_FAST 0x00000002
732#define JSCTL_SP_FAST 0x00000003
733#define JSCTL_ARE 0x00000004
734
735/*
736 * The following defines are for the flags in the joystick coordinate pair 1
737 * readback register.
738 */
739#define JSC1_Y1V_MASK 0x0000FFFF
740#define JSC1_X1V_MASK 0xFFFF0000
741#define JSC1_Y1V_SHIFT 0
742#define JSC1_X1V_SHIFT 16
743
744/*
745 * The following defines are for the flags in the joystick coordinate pair 2
746 * readback register.
747 */
748#define JSC2_Y2V_MASK 0x0000FFFF
749#define JSC2_X2V_MASK 0xFFFF0000
750#define JSC2_Y2V_SHIFT 0
751#define JSC2_X2V_SHIFT 16
752
753/*
754 * The following defines are for the flags in the MIDI control register.
755 */
756#define MIDCR_TXE 0x00000001 /* Enable transmitting. */
757#define MIDCR_RXE 0x00000002 /* Enable receiving. */
758#define MIDCR_RIE 0x00000004 /* Interrupt upon tx ready. */
759#define MIDCR_TIE 0x00000008 /* Interrupt upon rx ready. */
760#define MIDCR_MLB 0x00000010 /* Enable midi loopback. */
761#define MIDCR_MRST 0x00000020 /* Reset interface. */
762
763/*
764 * The following defines are for the flags in the MIDI status register.
765 */
766#define MIDSR_TBF 0x00000001 /* Tx FIFO is full. */
767#define MIDSR_RBE 0x00000002 /* Rx FIFO is empty. */
768
769/*
770 * The following defines are for the flags in the MIDI write port register.
771 */
772#define MIDWP_MWD_MASK 0x000000FF
773#define MIDWP_MWD_SHIFT 0
774
775/*
776 * The following defines are for the flags in the MIDI read port register.
777 */
778#define MIDRP_MRD_MASK 0x000000FF
779#define MIDRP_MRD_SHIFT 0
780
781/*
782 * The following defines are for the flags in the joystick GPIO register.
783 */
784#define JSIO_DAX 0x00000001
785#define JSIO_DAY 0x00000002
786#define JSIO_DBX 0x00000004
787#define JSIO_DBY 0x00000008
788#define JSIO_AXOE 0x00000010
789#define JSIO_AYOE 0x00000020
790#define JSIO_BXOE 0x00000040
791#define JSIO_BYOE 0x00000080
792
793/*
794 * The following defines are for the flags in the master async/sync serial
795 * port enable register.
796 */
797#ifndef NO_CS4612
798#define ASER_MASTER_ME 0x00000001
799#endif
800
801/*
802 * The following defines are for the flags in the configuration interface
803 * register.
804 */
805#define CFGI_CLK 0x00000001
806#define CFGI_DOUT 0x00000002
807#define CFGI_DIN_EEN 0x00000004
808#define CFGI_EELD 0x00000008
809
810/*
811 * The following defines are for the flags in the subsystem ID and vendor ID
812 * register.
813 */
814#define SSVID_VID_MASK 0x0000FFFF
815#define SSVID_SID_MASK 0xFFFF0000
816#define SSVID_VID_SHIFT 0
817#define SSVID_SID_SHIFT 16
818
819/*
820 * The following defines are for the flags in the GPIO pin interface register.
821 */
822#define GPIOR_VOLDN 0x00000001
823#define GPIOR_VOLUP 0x00000002
824#define GPIOR_SI2D 0x00000004
825#define GPIOR_SI2OE 0x00000008
826
827/*
828 * The following defines are for the flags in the extended GPIO pin direction
829 * register.
830 */
831#ifndef NO_CS4612
832#define EGPIODR_GPOE0 0x00000001
833#define EGPIODR_GPOE1 0x00000002
834#define EGPIODR_GPOE2 0x00000004
835#define EGPIODR_GPOE3 0x00000008
836#define EGPIODR_GPOE4 0x00000010
837#define EGPIODR_GPOE5 0x00000020
838#define EGPIODR_GPOE6 0x00000040
839#define EGPIODR_GPOE7 0x00000080
840#define EGPIODR_GPOE8 0x00000100
841#endif
842
843/*
844 * The following defines are for the flags in the extended GPIO pin polarity/
845 * type register.
846 */
847#ifndef NO_CS4612
848#define EGPIOPTR_GPPT0 0x00000001
849#define EGPIOPTR_GPPT1 0x00000002
850#define EGPIOPTR_GPPT2 0x00000004
851#define EGPIOPTR_GPPT3 0x00000008
852#define EGPIOPTR_GPPT4 0x00000010
853#define EGPIOPTR_GPPT5 0x00000020
854#define EGPIOPTR_GPPT6 0x00000040
855#define EGPIOPTR_GPPT7 0x00000080
856#define EGPIOPTR_GPPT8 0x00000100
857#endif
858
859/*
860 * The following defines are for the flags in the extended GPIO pin sticky
861 * register.
862 */
863#ifndef NO_CS4612
864#define EGPIOTR_GPS0 0x00000001
865#define EGPIOTR_GPS1 0x00000002
866#define EGPIOTR_GPS2 0x00000004
867#define EGPIOTR_GPS3 0x00000008
868#define EGPIOTR_GPS4 0x00000010
869#define EGPIOTR_GPS5 0x00000020
870#define EGPIOTR_GPS6 0x00000040
871#define EGPIOTR_GPS7 0x00000080
872#define EGPIOTR_GPS8 0x00000100
873#endif
874
875/*
876 * The following defines are for the flags in the extended GPIO ping wakeup
877 * register.
878 */
879#ifndef NO_CS4612
880#define EGPIOWR_GPW0 0x00000001
881#define EGPIOWR_GPW1 0x00000002
882#define EGPIOWR_GPW2 0x00000004
883#define EGPIOWR_GPW3 0x00000008
884#define EGPIOWR_GPW4 0x00000010
885#define EGPIOWR_GPW5 0x00000020
886#define EGPIOWR_GPW6 0x00000040
887#define EGPIOWR_GPW7 0x00000080
888#define EGPIOWR_GPW8 0x00000100
889#endif
890
891/*
892 * The following defines are for the flags in the extended GPIO pin status
893 * register.
894 */
895#ifndef NO_CS4612
896#define EGPIOSR_GPS0 0x00000001
897#define EGPIOSR_GPS1 0x00000002
898#define EGPIOSR_GPS2 0x00000004
899#define EGPIOSR_GPS3 0x00000008
900#define EGPIOSR_GPS4 0x00000010
901#define EGPIOSR_GPS5 0x00000020
902#define EGPIOSR_GPS6 0x00000040
903#define EGPIOSR_GPS7 0x00000080
904#define EGPIOSR_GPS8 0x00000100
905#endif
906
907/*
908 * The following defines are for the flags in the serial port 6 configuration
909 * register.
910 */
911#ifndef NO_CS4612
912#define SERC6_ASDO2EN 0x00000001
913#endif
914
915/*
916 * The following defines are for the flags in the serial port 7 configuration
917 * register.
918 */
919#ifndef NO_CS4612
920#define SERC7_ASDI2EN 0x00000001
921#define SERC7_POSILB 0x00000002
922#define SERC7_SIPOLB 0x00000004
923#define SERC7_SOSILB 0x00000008
924#define SERC7_SISOLB 0x00000010
925#endif
926
927/*
928 * The following defines are for the flags in the serial port AC link
929 * configuration register.
930 */
931#ifndef NO_CS4612
932#define SERACC_CODEC_TYPE_MASK 0x00000001
933#define SERACC_CODEC_TYPE_1_03 0x00000000
934#define SERACC_CODEC_TYPE_2_0 0x00000001
935#define SERACC_TWO_CODECS 0x00000002
936#define SERACC_MDM 0x00000004
937#define SERACC_HSP 0x00000008
938#endif
939
940/*
941 * The following defines are for the flags in the AC97 control register 2.
942 */
943#ifndef NO_CS4612
944#define ACCTL2_RSTN 0x00000001
945#define ACCTL2_ESYN 0x00000002
946#define ACCTL2_VFRM 0x00000004
947#define ACCTL2_DCV 0x00000008
948#define ACCTL2_CRW 0x00000010
949#define ACCTL2_ASYN 0x00000020
950#endif
951
952/*
953 * The following defines are for the flags in the AC97 status register 2.
954 */
955#ifndef NO_CS4612
956#define ACSTS2_CRDY 0x00000001
957#define ACSTS2_VSTS 0x00000002
958#endif
959
960/*
961 * The following defines are for the flags in the AC97 output slot valid
962 * register 2.
963 */
964#ifndef NO_CS4612
965#define ACOSV2_SLV3 0x00000001
966#define ACOSV2_SLV4 0x00000002
967#define ACOSV2_SLV5 0x00000004
968#define ACOSV2_SLV6 0x00000008
969#define ACOSV2_SLV7 0x00000010
970#define ACOSV2_SLV8 0x00000020
971#define ACOSV2_SLV9 0x00000040
972#define ACOSV2_SLV10 0x00000080
973#define ACOSV2_SLV11 0x00000100
974#define ACOSV2_SLV12 0x00000200
975#endif
976
977/*
978 * The following defines are for the flags in the AC97 command address
979 * register 2.
980 */
981#ifndef NO_CS4612
982#define ACCAD2_CI_MASK 0x0000007F
983#define ACCAD2_CI_SHIFT 0
984#endif
985
986/*
987 * The following defines are for the flags in the AC97 command data register
988 * 2.
989 */
990#ifndef NO_CS4612
991#define ACCDA2_CD_MASK 0x0000FFFF
992#define ACCDA2_CD_SHIFT 0
993#endif
994
995/*
996 * The following defines are for the flags in the AC97 input slot valid
997 * register 2.
998 */
999#ifndef NO_CS4612
1000#define ACISV2_ISV3 0x00000001
1001#define ACISV2_ISV4 0x00000002
1002#define ACISV2_ISV5 0x00000004
1003#define ACISV2_ISV6 0x00000008
1004#define ACISV2_ISV7 0x00000010
1005#define ACISV2_ISV8 0x00000020
1006#define ACISV2_ISV9 0x00000040
1007#define ACISV2_ISV10 0x00000080
1008#define ACISV2_ISV11 0x00000100
1009#define ACISV2_ISV12 0x00000200
1010#endif
1011
1012/*
1013 * The following defines are for the flags in the AC97 status address
1014 * register 2.
1015 */
1016#ifndef NO_CS4612
1017#define ACSAD2_SI_MASK 0x0000007F
1018#define ACSAD2_SI_SHIFT 0
1019#endif
1020
1021/*
1022 * The following defines are for the flags in the AC97 status data register 2.
1023 */
1024#ifndef NO_CS4612
1025#define ACSDA2_SD_MASK 0x0000FFFF
1026#define ACSDA2_SD_SHIFT 0
1027#endif
1028
1029/*
1030 * The following defines are for the flags in the I/O trap address and control
1031 * registers (all 12).
1032 */
1033#ifndef NO_CS4612
1034#define IOTAC_SA_MASK 0x0000FFFF
1035#define IOTAC_MSK_MASK 0x000F0000
1036#define IOTAC_IODC_MASK 0x06000000
1037#define IOTAC_IODC_16_BIT 0x00000000
1038#define IOTAC_IODC_10_BIT 0x02000000
1039#define IOTAC_IODC_12_BIT 0x04000000
1040#define IOTAC_WSPI 0x08000000
1041#define IOTAC_RSPI 0x10000000
1042#define IOTAC_WSE 0x20000000
1043#define IOTAC_WE 0x40000000
1044#define IOTAC_RE 0x80000000
1045#define IOTAC_SA_SHIFT 0
1046#define IOTAC_MSK_SHIFT 16
1047#endif
1048
1049/*
1050 * The following defines are for the flags in the I/O trap fast read registers
1051 * (all 8).
1052 */
1053#ifndef NO_CS4612
1054#define IOTFR_D_MASK 0x0000FFFF
1055#define IOTFR_A_MASK 0x000F0000
1056#define IOTFR_R_MASK 0x0F000000
1057#define IOTFR_ALL 0x40000000
1058#define IOTFR_VL 0x80000000
1059#define IOTFR_D_SHIFT 0
1060#define IOTFR_A_SHIFT 16
1061#define IOTFR_R_SHIFT 24
1062#endif
1063
1064/*
1065 * The following defines are for the flags in the I/O trap FIFO register.
1066 */
1067#ifndef NO_CS4612
1068#define IOTFIFO_BA_MASK 0x00003FFF
1069#define IOTFIFO_S_MASK 0x00FF0000
1070#define IOTFIFO_OF 0x40000000
1071#define IOTFIFO_SPIOF 0x80000000
1072#define IOTFIFO_BA_SHIFT 0
1073#define IOTFIFO_S_SHIFT 16
1074#endif
1075
1076/*
1077 * The following defines are for the flags in the I/O trap retry read data
1078 * register.
1079 */
1080#ifndef NO_CS4612
1081#define IOTRRD_D_MASK 0x0000FFFF
1082#define IOTRRD_RDV 0x80000000
1083#define IOTRRD_D_SHIFT 0
1084#endif
1085
1086/*
1087 * The following defines are for the flags in the I/O trap FIFO pointer
1088 * register.
1089 */
1090#ifndef NO_CS4612
1091#define IOTFP_CA_MASK 0x00003FFF
1092#define IOTFP_PA_MASK 0x3FFF0000
1093#define IOTFP_CA_SHIFT 0
1094#define IOTFP_PA_SHIFT 16
1095#endif
1096
1097/*
1098 * The following defines are for the flags in the I/O trap control register.
1099 */
1100#ifndef NO_CS4612
1101#define IOTCR_ITD 0x00000001
1102#define IOTCR_HRV 0x00000002
1103#define IOTCR_SRV 0x00000004
1104#define IOTCR_DTI 0x00000008
1105#define IOTCR_DFI 0x00000010
1106#define IOTCR_DDP 0x00000020
1107#define IOTCR_JTE 0x00000040
1108#define IOTCR_PPE 0x00000080
1109#endif
1110
1111/*
1112 * The following defines are for the flags in the direct PCI data register.
1113 */
1114#ifndef NO_CS4612
1115#define DPCID_D_MASK 0xFFFFFFFF
1116#define DPCID_D_SHIFT 0
1117#endif
1118
1119/*
1120 * The following defines are for the flags in the direct PCI address register.
1121 */
1122#ifndef NO_CS4612
1123#define DPCIA_A_MASK 0xFFFFFFFF
1124#define DPCIA_A_SHIFT 0
1125#endif
1126
1127/*
1128 * The following defines are for the flags in the direct PCI command register.
1129 */
1130#ifndef NO_CS4612
1131#define DPCIC_C_MASK 0x0000000F
1132#define DPCIC_C_IOREAD 0x00000002
1133#define DPCIC_C_IOWRITE 0x00000003
1134#define DPCIC_BE_MASK 0x000000F0
1135#endif
1136
1137/*
1138 * The following defines are for the flags in the PC/PCI request register.
1139 */
1140#ifndef NO_CS4612
1141#define PCPCIR_RDC_MASK 0x00000007
1142#define PCPCIR_C_MASK 0x00007000
1143#define PCPCIR_REQ 0x00008000
1144#define PCPCIR_RDC_SHIFT 0
1145#define PCPCIR_C_SHIFT 12
1146#endif
1147
1148/*
1149 * The following defines are for the flags in the PC/PCI grant register.
1150 */
1151#ifndef NO_CS4612
1152#define PCPCIG_GDC_MASK 0x00000007
1153#define PCPCIG_VL 0x00008000
1154#define PCPCIG_GDC_SHIFT 0
1155#endif
1156
1157/*
1158 * The following defines are for the flags in the PC/PCI master enable
1159 * register.
1160 */
1161#ifndef NO_CS4612
1162#define PCPCIEN_EN 0x00000001
1163#endif
1164
1165/*
1166 * The following defines are for the flags in the extended PCI power
1167 * management control register.
1168 */
1169#ifndef NO_CS4612
1170#define EPCIPMC_GWU 0x00000001
1171#define EPCIPMC_FSPC 0x00000002
1172#endif
1173
1174/*
1175 * The following defines are for the flags in the SP control register.
1176 */
1177#define SPCR_RUN 0x00000001
1178#define SPCR_STPFR 0x00000002
1179#define SPCR_RUNFR 0x00000004
1180#define SPCR_TICK 0x00000008
1181#define SPCR_DRQEN 0x00000020
1182#define SPCR_RSTSP 0x00000040
1183#define SPCR_OREN 0x00000080
1184#ifndef NO_CS4612
1185#define SPCR_PCIINT 0x00000100
1186#define SPCR_OINTD 0x00000200
1187#define SPCR_CRE 0x00008000
1188#endif
1189
1190/*
1191 * The following defines are for the flags in the debug index register.
1192 */
1193#define DREG_REGID_MASK 0x0000007F
1194#define DREG_DEBUG 0x00000080
1195#define DREG_RGBK_MASK 0x00000700
1196#define DREG_TRAP 0x00000800
1197#if !defined(NO_CS4612)
1198#if !defined(NO_CS4615)
1199#define DREG_TRAPX 0x00001000
1200#endif
1201#endif
1202#define DREG_REGID_SHIFT 0
1203#define DREG_RGBK_SHIFT 8
1204#define DREG_RGBK_REGID_MASK 0x0000077F
1205#define DREG_REGID_R0 0x00000010
1206#define DREG_REGID_R1 0x00000011
1207#define DREG_REGID_R2 0x00000012
1208#define DREG_REGID_R3 0x00000013
1209#define DREG_REGID_R4 0x00000014
1210#define DREG_REGID_R5 0x00000015
1211#define DREG_REGID_R6 0x00000016
1212#define DREG_REGID_R7 0x00000017
1213#define DREG_REGID_R8 0x00000018
1214#define DREG_REGID_R9 0x00000019
1215#define DREG_REGID_RA 0x0000001A
1216#define DREG_REGID_RB 0x0000001B
1217#define DREG_REGID_RC 0x0000001C
1218#define DREG_REGID_RD 0x0000001D
1219#define DREG_REGID_RE 0x0000001E
1220#define DREG_REGID_RF 0x0000001F
1221#define DREG_REGID_RA_BUS_LOW 0x00000020
1222#define DREG_REGID_RA_BUS_HIGH 0x00000038
1223#define DREG_REGID_YBUS_LOW 0x00000050
1224#define DREG_REGID_YBUS_HIGH 0x00000058
1225#define DREG_REGID_TRAP_0 0x00000100
1226#define DREG_REGID_TRAP_1 0x00000101
1227#define DREG_REGID_TRAP_2 0x00000102
1228#define DREG_REGID_TRAP_3 0x00000103
1229#define DREG_REGID_TRAP_4 0x00000104
1230#define DREG_REGID_TRAP_5 0x00000105
1231#define DREG_REGID_TRAP_6 0x00000106
1232#define DREG_REGID_TRAP_7 0x00000107
1233#define DREG_REGID_INDIRECT_ADDRESS 0x0000010E
1234#define DREG_REGID_TOP_OF_STACK 0x0000010F
1235#if !defined(NO_CS4612)
1236#if !defined(NO_CS4615)
1237#define DREG_REGID_TRAP_8 0x00000110
1238#define DREG_REGID_TRAP_9 0x00000111
1239#define DREG_REGID_TRAP_10 0x00000112
1240#define DREG_REGID_TRAP_11 0x00000113
1241#define DREG_REGID_TRAP_12 0x00000114
1242#define DREG_REGID_TRAP_13 0x00000115
1243#define DREG_REGID_TRAP_14 0x00000116
1244#define DREG_REGID_TRAP_15 0x00000117
1245#define DREG_REGID_TRAP_16 0x00000118
1246#define DREG_REGID_TRAP_17 0x00000119
1247#define DREG_REGID_TRAP_18 0x0000011A
1248#define DREG_REGID_TRAP_19 0x0000011B
1249#define DREG_REGID_TRAP_20 0x0000011C
1250#define DREG_REGID_TRAP_21 0x0000011D
1251#define DREG_REGID_TRAP_22 0x0000011E
1252#define DREG_REGID_TRAP_23 0x0000011F
1253#endif
1254#endif
1255#define DREG_REGID_RSA0_LOW 0x00000200
1256#define DREG_REGID_RSA0_HIGH 0x00000201
1257#define DREG_REGID_RSA1_LOW 0x00000202
1258#define DREG_REGID_RSA1_HIGH 0x00000203
1259#define DREG_REGID_RSA2 0x00000204
1260#define DREG_REGID_RSA3 0x00000205
1261#define DREG_REGID_RSI0_LOW 0x00000206
1262#define DREG_REGID_RSI0_HIGH 0x00000207
1263#define DREG_REGID_RSI1 0x00000208
1264#define DREG_REGID_RSI2 0x00000209
1265#define DREG_REGID_SAGUSTATUS 0x0000020A
1266#define DREG_REGID_RSCONFIG01_LOW 0x0000020B
1267#define DREG_REGID_RSCONFIG01_HIGH 0x0000020C
1268#define DREG_REGID_RSCONFIG23_LOW 0x0000020D
1269#define DREG_REGID_RSCONFIG23_HIGH 0x0000020E
1270#define DREG_REGID_RSDMA01E 0x0000020F
1271#define DREG_REGID_RSDMA23E 0x00000210
1272#define DREG_REGID_RSD0_LOW 0x00000211
1273#define DREG_REGID_RSD0_HIGH 0x00000212
1274#define DREG_REGID_RSD1_LOW 0x00000213
1275#define DREG_REGID_RSD1_HIGH 0x00000214
1276#define DREG_REGID_RSD2_LOW 0x00000215
1277#define DREG_REGID_RSD2_HIGH 0x00000216
1278#define DREG_REGID_RSD3_LOW 0x00000217
1279#define DREG_REGID_RSD3_HIGH 0x00000218
1280#define DREG_REGID_SRAR_HIGH 0x0000021A
1281#define DREG_REGID_SRAR_LOW 0x0000021B
1282#define DREG_REGID_DMA_STATE 0x0000021C
1283#define DREG_REGID_CURRENT_DMA_STREAM 0x0000021D
1284#define DREG_REGID_NEXT_DMA_STREAM 0x0000021E
1285#define DREG_REGID_CPU_STATUS 0x00000300
1286#define DREG_REGID_MAC_MODE 0x00000301
1287#define DREG_REGID_STACK_AND_REPEAT 0x00000302
1288#define DREG_REGID_INDEX0 0x00000304
1289#define DREG_REGID_INDEX1 0x00000305
1290#define DREG_REGID_DMA_STATE_0_3 0x00000400
1291#define DREG_REGID_DMA_STATE_4_7 0x00000404
1292#define DREG_REGID_DMA_STATE_8_11 0x00000408
1293#define DREG_REGID_DMA_STATE_12_15 0x0000040C
1294#define DREG_REGID_DMA_STATE_16_19 0x00000410
1295#define DREG_REGID_DMA_STATE_20_23 0x00000414
1296#define DREG_REGID_DMA_STATE_24_27 0x00000418
1297#define DREG_REGID_DMA_STATE_28_31 0x0000041C
1298#define DREG_REGID_DMA_STATE_32_35 0x00000420
1299#define DREG_REGID_DMA_STATE_36_39 0x00000424
1300#define DREG_REGID_DMA_STATE_40_43 0x00000428
1301#define DREG_REGID_DMA_STATE_44_47 0x0000042C
1302#define DREG_REGID_DMA_STATE_48_51 0x00000430
1303#define DREG_REGID_DMA_STATE_52_55 0x00000434
1304#define DREG_REGID_DMA_STATE_56_59 0x00000438
1305#define DREG_REGID_DMA_STATE_60_63 0x0000043C
1306#define DREG_REGID_DMA_STATE_64_67 0x00000440
1307#define DREG_REGID_DMA_STATE_68_71 0x00000444
1308#define DREG_REGID_DMA_STATE_72_75 0x00000448
1309#define DREG_REGID_DMA_STATE_76_79 0x0000044C
1310#define DREG_REGID_DMA_STATE_80_83 0x00000450
1311#define DREG_REGID_DMA_STATE_84_87 0x00000454
1312#define DREG_REGID_DMA_STATE_88_91 0x00000458
1313#define DREG_REGID_DMA_STATE_92_95 0x0000045C
1314#define DREG_REGID_TRAP_SELECT 0x00000500
1315#define DREG_REGID_TRAP_WRITE_0 0x00000500
1316#define DREG_REGID_TRAP_WRITE_1 0x00000501
1317#define DREG_REGID_TRAP_WRITE_2 0x00000502
1318#define DREG_REGID_TRAP_WRITE_3 0x00000503
1319#define DREG_REGID_TRAP_WRITE_4 0x00000504
1320#define DREG_REGID_TRAP_WRITE_5 0x00000505
1321#define DREG_REGID_TRAP_WRITE_6 0x00000506
1322#define DREG_REGID_TRAP_WRITE_7 0x00000507
1323#if !defined(NO_CS4612)
1324#if !defined(NO_CS4615)
1325#define DREG_REGID_TRAP_WRITE_8 0x00000510
1326#define DREG_REGID_TRAP_WRITE_9 0x00000511
1327#define DREG_REGID_TRAP_WRITE_10 0x00000512
1328#define DREG_REGID_TRAP_WRITE_11 0x00000513
1329#define DREG_REGID_TRAP_WRITE_12 0x00000514
1330#define DREG_REGID_TRAP_WRITE_13 0x00000515
1331#define DREG_REGID_TRAP_WRITE_14 0x00000516
1332#define DREG_REGID_TRAP_WRITE_15 0x00000517
1333#define DREG_REGID_TRAP_WRITE_16 0x00000518
1334#define DREG_REGID_TRAP_WRITE_17 0x00000519
1335#define DREG_REGID_TRAP_WRITE_18 0x0000051A
1336#define DREG_REGID_TRAP_WRITE_19 0x0000051B
1337#define DREG_REGID_TRAP_WRITE_20 0x0000051C
1338#define DREG_REGID_TRAP_WRITE_21 0x0000051D
1339#define DREG_REGID_TRAP_WRITE_22 0x0000051E
1340#define DREG_REGID_TRAP_WRITE_23 0x0000051F
1341#endif
1342#endif
1343#define DREG_REGID_MAC0_ACC0_LOW 0x00000600
1344#define DREG_REGID_MAC0_ACC1_LOW 0x00000601
1345#define DREG_REGID_MAC0_ACC2_LOW 0x00000602
1346#define DREG_REGID_MAC0_ACC3_LOW 0x00000603
1347#define DREG_REGID_MAC1_ACC0_LOW 0x00000604
1348#define DREG_REGID_MAC1_ACC1_LOW 0x00000605
1349#define DREG_REGID_MAC1_ACC2_LOW 0x00000606
1350#define DREG_REGID_MAC1_ACC3_LOW 0x00000607
1351#define DREG_REGID_MAC0_ACC0_MID 0x00000608
1352#define DREG_REGID_MAC0_ACC1_MID 0x00000609
1353#define DREG_REGID_MAC0_ACC2_MID 0x0000060A
1354#define DREG_REGID_MAC0_ACC3_MID 0x0000060B
1355#define DREG_REGID_MAC1_ACC0_MID 0x0000060C
1356#define DREG_REGID_MAC1_ACC1_MID 0x0000060D
1357#define DREG_REGID_MAC1_ACC2_MID 0x0000060E
1358#define DREG_REGID_MAC1_ACC3_MID 0x0000060F
1359#define DREG_REGID_MAC0_ACC0_HIGH 0x00000610
1360#define DREG_REGID_MAC0_ACC1_HIGH 0x00000611
1361#define DREG_REGID_MAC0_ACC2_HIGH 0x00000612
1362#define DREG_REGID_MAC0_ACC3_HIGH 0x00000613
1363#define DREG_REGID_MAC1_ACC0_HIGH 0x00000614
1364#define DREG_REGID_MAC1_ACC1_HIGH 0x00000615
1365#define DREG_REGID_MAC1_ACC2_HIGH 0x00000616
1366#define DREG_REGID_MAC1_ACC3_HIGH 0x00000617
1367#define DREG_REGID_RSHOUT_LOW 0x00000620
1368#define DREG_REGID_RSHOUT_MID 0x00000628
1369#define DREG_REGID_RSHOUT_HIGH 0x00000630
1370
1371/*
1372 * The following defines are for the flags in the DMA stream requestor write
1373 */
1374#define DSRWP_DSR_MASK 0x0000000F
1375#define DSRWP_DSR_BG_RQ 0x00000001
1376#define DSRWP_DSR_PRIORITY_MASK 0x00000006
1377#define DSRWP_DSR_PRIORITY_0 0x00000000
1378#define DSRWP_DSR_PRIORITY_1 0x00000002
1379#define DSRWP_DSR_PRIORITY_2 0x00000004
1380#define DSRWP_DSR_PRIORITY_3 0x00000006
1381#define DSRWP_DSR_RQ_PENDING 0x00000008
1382
1383/*
1384 * The following defines are for the flags in the trap write port register.
1385 */
1386#define TWPR_TW_MASK 0x0000FFFF
1387#define TWPR_TW_SHIFT 0
1388
1389/*
1390 * The following defines are for the flags in the stack pointer write
1391 * register.
1392 */
1393#define SPWR_STKP_MASK 0x0000000F
1394#define SPWR_STKP_SHIFT 0
1395
1396/*
1397 * The following defines are for the flags in the SP interrupt register.
1398 */
1399#define SPIR_FRI 0x00000001
1400#define SPIR_DOI 0x00000002
1401#define SPIR_GPI2 0x00000004
1402#define SPIR_GPI3 0x00000008
1403#define SPIR_IP0 0x00000010
1404#define SPIR_IP1 0x00000020
1405#define SPIR_IP2 0x00000040
1406#define SPIR_IP3 0x00000080
1407
1408/*
1409 * The following defines are for the flags in the functional group 1 register.
1410 */
1411#define FGR1_F1S_MASK 0x0000FFFF
1412#define FGR1_F1S_SHIFT 0
1413
1414/*
1415 * The following defines are for the flags in the SP clock status register.
1416 */
1417#define SPCS_FRI 0x00000001
1418#define SPCS_DOI 0x00000002
1419#define SPCS_GPI2 0x00000004
1420#define SPCS_GPI3 0x00000008
1421#define SPCS_IP0 0x00000010
1422#define SPCS_IP1 0x00000020
1423#define SPCS_IP2 0x00000040
1424#define SPCS_IP3 0x00000080
1425#define SPCS_SPRUN 0x00000100
1426#define SPCS_SLEEP 0x00000200
1427#define SPCS_FG 0x00000400
1428#define SPCS_ORUN 0x00000800
1429#define SPCS_IRQ 0x00001000
1430#define SPCS_FGN_MASK 0x0000E000
1431#define SPCS_FGN_SHIFT 13
1432
1433/*
1434 * The following defines are for the flags in the SP DMA requestor status
1435 * register.
1436 */
1437#define SDSR_DCS_MASK 0x000000FF
1438#define SDSR_DCS_SHIFT 0
1439#define SDSR_DCS_NONE 0x00000007
1440
1441/*
1442 * The following defines are for the flags in the frame timer register.
1443 */
1444#define FRMT_FTV_MASK 0x0000FFFF
1445#define FRMT_FTV_SHIFT 0
1446
1447/*
1448 * The following defines are for the flags in the frame timer current count
1449 * register.
1450 */
1451#define FRCC_FCC_MASK 0x0000FFFF
1452#define FRCC_FCC_SHIFT 0
1453
1454/*
1455 * The following defines are for the flags in the frame timer save count
1456 * register.
1457 */
1458#define FRSC_FCS_MASK 0x0000FFFF
1459#define FRSC_FCS_SHIFT 0
1460
1461/*
1462 * The following define the various flags stored in the scatter/gather
1463 * descriptors.
1464 */
1465#define DMA_SG_NEXT_ENTRY_MASK 0x00000FF8
1466#define DMA_SG_SAMPLE_END_MASK 0x0FFF0000
1467#define DMA_SG_SAMPLE_END_FLAG 0x10000000
1468#define DMA_SG_LOOP_END_FLAG 0x20000000
1469#define DMA_SG_SIGNAL_END_FLAG 0x40000000
1470#define DMA_SG_SIGNAL_PAGE_FLAG 0x80000000
1471#define DMA_SG_NEXT_ENTRY_SHIFT 3
1472#define DMA_SG_SAMPLE_END_SHIFT 16
1473
1474/*
1475 * The following define the offsets of the fields within the on-chip generic
1476 * DMA requestor.
1477 */
1478#define DMA_RQ_CONTROL1 0x00000000
1479#define DMA_RQ_CONTROL2 0x00000004
1480#define DMA_RQ_SOURCE_ADDR 0x00000008
1481#define DMA_RQ_DESTINATION_ADDR 0x0000000C
1482#define DMA_RQ_NEXT_PAGE_ADDR 0x00000010
1483#define DMA_RQ_NEXT_PAGE_SGDESC 0x00000014
1484#define DMA_RQ_LOOP_START_ADDR 0x00000018
1485#define DMA_RQ_POST_LOOP_ADDR 0x0000001C
1486#define DMA_RQ_PAGE_MAP_ADDR 0x00000020
1487
1488/*
1489 * The following defines are for the flags in the first control word of the
1490 * on-chip generic DMA requestor.
1491 */
1492#define DMA_RQ_C1_COUNT_MASK 0x000003FF
1493#define DMA_RQ_C1_DESTINATION_SCATTER 0x00001000
1494#define DMA_RQ_C1_SOURCE_GATHER 0x00002000
1495#define DMA_RQ_C1_DONE_FLAG 0x00004000
1496#define DMA_RQ_C1_OPTIMIZE_STATE 0x00008000
1497#define DMA_RQ_C1_SAMPLE_END_STATE_MASK 0x00030000
1498#define DMA_RQ_C1_FULL_PAGE 0x00000000
1499#define DMA_RQ_C1_BEFORE_SAMPLE_END 0x00010000
1500#define DMA_RQ_C1_PAGE_MAP_ERROR 0x00020000
1501#define DMA_RQ_C1_AT_SAMPLE_END 0x00030000
1502#define DMA_RQ_C1_LOOP_END_STATE_MASK 0x000C0000
1503#define DMA_RQ_C1_NOT_LOOP_END 0x00000000
1504#define DMA_RQ_C1_BEFORE_LOOP_END 0x00040000
1505#define DMA_RQ_C1_2PAGE_LOOP_BEGIN 0x00080000
1506#define DMA_RQ_C1_LOOP_BEGIN 0x000C0000
1507#define DMA_RQ_C1_PAGE_MAP_MASK 0x00300000
1508#define DMA_RQ_C1_PM_NONE_PENDING 0x00000000
1509#define DMA_RQ_C1_PM_NEXT_PENDING 0x00100000
1510#define DMA_RQ_C1_PM_RESERVED 0x00200000
1511#define DMA_RQ_C1_PM_LOOP_NEXT_PENDING 0x00300000
1512#define DMA_RQ_C1_WRITEBACK_DEST_FLAG 0x00400000
1513#define DMA_RQ_C1_WRITEBACK_SRC_FLAG 0x00800000
1514#define DMA_RQ_C1_DEST_SIZE_MASK 0x07000000
1515#define DMA_RQ_C1_DEST_LINEAR 0x00000000
1516#define DMA_RQ_C1_DEST_MOD16 0x01000000
1517#define DMA_RQ_C1_DEST_MOD32 0x02000000
1518#define DMA_RQ_C1_DEST_MOD64 0x03000000
1519#define DMA_RQ_C1_DEST_MOD128 0x04000000
1520#define DMA_RQ_C1_DEST_MOD256 0x05000000
1521#define DMA_RQ_C1_DEST_MOD512 0x06000000
1522#define DMA_RQ_C1_DEST_MOD1024 0x07000000
1523#define DMA_RQ_C1_DEST_ON_HOST 0x08000000
1524#define DMA_RQ_C1_SOURCE_SIZE_MASK 0x70000000
1525#define DMA_RQ_C1_SOURCE_LINEAR 0x00000000
1526#define DMA_RQ_C1_SOURCE_MOD16 0x10000000
1527#define DMA_RQ_C1_SOURCE_MOD32 0x20000000
1528#define DMA_RQ_C1_SOURCE_MOD64 0x30000000
1529#define DMA_RQ_C1_SOURCE_MOD128 0x40000000
1530#define DMA_RQ_C1_SOURCE_MOD256 0x50000000
1531#define DMA_RQ_C1_SOURCE_MOD512 0x60000000
1532#define DMA_RQ_C1_SOURCE_MOD1024 0x70000000
1533#define DMA_RQ_C1_SOURCE_ON_HOST 0x80000000
1534#define DMA_RQ_C1_COUNT_SHIFT 0
1535
1536/*
1537 * The following defines are for the flags in the second control word of the
1538 * on-chip generic DMA requestor.
1539 */
1540#define DMA_RQ_C2_VIRTUAL_CHANNEL_MASK 0x0000003F
1541#define DMA_RQ_C2_VIRTUAL_SIGNAL_MASK 0x00000300
1542#define DMA_RQ_C2_NO_VIRTUAL_SIGNAL 0x00000000
1543#define DMA_RQ_C2_SIGNAL_EVERY_DMA 0x00000100
1544#define DMA_RQ_C2_SIGNAL_SOURCE_PINGPONG 0x00000200
1545#define DMA_RQ_C2_SIGNAL_DEST_PINGPONG 0x00000300
1546#define DMA_RQ_C2_AUDIO_CONVERT_MASK 0x0000F000
1547#define DMA_RQ_C2_AC_NONE 0x00000000
1548#define DMA_RQ_C2_AC_8_TO_16_BIT 0x00001000
1549#define DMA_RQ_C2_AC_MONO_TO_STEREO 0x00002000
1550#define DMA_RQ_C2_AC_ENDIAN_CONVERT 0x00004000
1551#define DMA_RQ_C2_AC_SIGNED_CONVERT 0x00008000
1552#define DMA_RQ_C2_LOOP_END_MASK 0x0FFF0000
1553#define DMA_RQ_C2_LOOP_MASK 0x30000000
1554#define DMA_RQ_C2_NO_LOOP 0x00000000
1555#define DMA_RQ_C2_ONE_PAGE_LOOP 0x10000000
1556#define DMA_RQ_C2_TWO_PAGE_LOOP 0x20000000
1557#define DMA_RQ_C2_MULTI_PAGE_LOOP 0x30000000
1558#define DMA_RQ_C2_SIGNAL_LOOP_BACK 0x40000000
1559#define DMA_RQ_C2_SIGNAL_POST_BEGIN_PAGE 0x80000000
1560#define DMA_RQ_C2_VIRTUAL_CHANNEL_SHIFT 0
1561#define DMA_RQ_C2_LOOP_END_SHIFT 16
1562
1563/*
1564 * The following defines are for the flags in the source and destination words
1565 * of the on-chip generic DMA requestor.
1566 */
1567#define DMA_RQ_SD_ADDRESS_MASK 0x0000FFFF
1568#define DMA_RQ_SD_MEMORY_ID_MASK 0x000F0000
1569#define DMA_RQ_SD_SP_PARAM_ADDR 0x00000000
1570#define DMA_RQ_SD_SP_SAMPLE_ADDR 0x00010000
1571#define DMA_RQ_SD_SP_PROGRAM_ADDR 0x00020000
1572#define DMA_RQ_SD_SP_DEBUG_ADDR 0x00030000
1573#define DMA_RQ_SD_OMNIMEM_ADDR 0x000E0000
1574#define DMA_RQ_SD_END_FLAG 0x40000000
1575#define DMA_RQ_SD_ERROR_FLAG 0x80000000
1576#define DMA_RQ_SD_ADDRESS_SHIFT 0
1577
1578/*
1579 * The following defines are for the flags in the page map address word of the
1580 * on-chip generic DMA requestor.
1581 */
1582#define DMA_RQ_PMA_LOOP_THIRD_PAGE_ENTRY_MASK 0x00000FF8
1583#define DMA_RQ_PMA_PAGE_TABLE_MASK 0xFFFFF000
1584#define DMA_RQ_PMA_LOOP_THIRD_PAGE_ENTRY_SHIFT 3
1585#define DMA_RQ_PMA_PAGE_TABLE_SHIFT 12
1586
1587#define BA1_VARIDEC_BUF_1 0x000
1588
1589#define BA1_PDTC 0x0c0 /* BA1_PLAY_DMA_TRANSACTION_COUNT_REG */
1590#define BA1_PFIE 0x0c4 /* BA1_PLAY_FORMAT_&_INTERRUPT_ENABLE_REG */
1591#define BA1_PBA 0x0c8 /* BA1_PLAY_BUFFER_ADDRESS */
1592#define BA1_PVOL 0x0f8 /* BA1_PLAY_VOLUME_REG */
1593#define BA1_PSRC 0x288 /* BA1_PLAY_SAMPLE_RATE_CORRECTION_REG */
1594#define BA1_PCTL 0x2a4 /* BA1_PLAY_CONTROL_REG */
1595#define BA1_PPI 0x2b4 /* BA1_PLAY_PHASE_INCREMENT_REG */
1596
1597#define BA1_CCTL 0x064 /* BA1_CAPTURE_CONTROL_REG */
1598#define BA1_CIE 0x104 /* BA1_CAPTURE_INTERRUPT_ENABLE_REG */
1599#define BA1_CBA 0x10c /* BA1_CAPTURE_BUFFER_ADDRESS */
1600#define BA1_CSRC 0x2c8 /* BA1_CAPTURE_SAMPLE_RATE_CORRECTION_REG */
1601#define BA1_CCI 0x2d8 /* BA1_CAPTURE_COEFFICIENT_INCREMENT_REG */
1602#define BA1_CD 0x2e0 /* BA1_CAPTURE_DELAY_REG */
1603#define BA1_CPI 0x2f4 /* BA1_CAPTURE_PHASE_INCREMENT_REG */
1604#define BA1_CVOL 0x2f8 /* BA1_CAPTURE_VOLUME_REG */
1605
1606#define BA1_CFG1 0x134 /* BA1_CAPTURE_FRAME_GROUP_1_REG */
1607#define BA1_CFG2 0x138 /* BA1_CAPTURE_FRAME_GROUP_2_REG */
1608#define BA1_CCST 0x13c /* BA1_CAPTURE_CONSTANT_REG */
1609#define BA1_CSPB 0x340 /* BA1_CAPTURE_SPB_ADDRESS */
1610
1611/*
1612 *
1613 */
1614
1615#define CS461X_MODE_OUTPUT (1<<0) /* MIDI UART - output */
1616#define CS461X_MODE_INPUT (1<<1) /* MIDI UART - input */
1617
1618//****************************************************************************
1619//
1620// The following define the offsets of the AC97 shadow registers, which appear
1621// as a virtual extension to the base address register zero memory range.
1622//
1623//****************************************************************************
1624#define AC97_REG_OFFSET_MASK 0x0000007EL
1625#define AC97_CODEC_NUMBER_MASK 0x00003000L
1626
1627#define BA0_AC97_RESET 0x00001000L
1628#define BA0_AC97_MASTER_VOLUME 0x00001002L
1629#define BA0_AC97_HEADPHONE_VOLUME 0x00001004L
1630#define BA0_AC97_MASTER_VOLUME_MONO 0x00001006L
1631#define BA0_AC97_MASTER_TONE 0x00001008L
1632#define BA0_AC97_PC_BEEP_VOLUME 0x0000100AL
1633#define BA0_AC97_PHONE_VOLUME 0x0000100CL
1634#define BA0_AC97_MIC_VOLUME 0x0000100EL
1635#define BA0_AC97_LINE_IN_VOLUME 0x00001010L
1636#define BA0_AC97_CD_VOLUME 0x00001012L
1637#define BA0_AC97_VIDEO_VOLUME 0x00001014L
1638#define BA0_AC97_AUX_VOLUME 0x00001016L
1639#define BA0_AC97_PCM_OUT_VOLUME 0x00001018L
1640#define BA0_AC97_RECORD_SELECT 0x0000101AL
1641#define BA0_AC97_RECORD_GAIN 0x0000101CL
1642#define BA0_AC97_RECORD_GAIN_MIC 0x0000101EL
1643#define BA0_AC97_GENERAL_PURPOSE 0x00001020L
1644#define BA0_AC97_3D_CONTROL 0x00001022L
1645#define BA0_AC97_MODEM_RATE 0x00001024L
1646#define BA0_AC97_POWERDOWN 0x00001026L
1647#define BA0_AC97_EXT_AUDIO_ID 0x00001028L
1648#define BA0_AC97_EXT_AUDIO_POWER 0x0000102AL
1649#define BA0_AC97_PCM_FRONT_DAC_RATE 0x0000102CL
1650#define BA0_AC97_PCM_SURR_DAC_RATE 0x0000102EL
1651#define BA0_AC97_PCM_LFE_DAC_RATE 0x00001030L
1652#define BA0_AC97_PCM_LR_ADC_RATE 0x00001032L
1653#define BA0_AC97_MIC_ADC_RATE 0x00001034L
1654#define BA0_AC97_6CH_VOL_C_LFE 0x00001036L
1655#define BA0_AC97_6CH_VOL_SURROUND 0x00001038L
1656#define BA0_AC97_RESERVED_3A 0x0000103AL
1657#define BA0_AC97_EXT_MODEM_ID 0x0000103CL
1658#define BA0_AC97_EXT_MODEM_POWER 0x0000103EL
1659#define BA0_AC97_LINE1_CODEC_RATE 0x00001040L
1660#define BA0_AC97_LINE2_CODEC_RATE 0x00001042L
1661#define BA0_AC97_HANDSET_CODEC_RATE 0x00001044L
1662#define BA0_AC97_LINE1_CODEC_LEVEL 0x00001046L
1663#define BA0_AC97_LINE2_CODEC_LEVEL 0x00001048L
1664#define BA0_AC97_HANDSET_CODEC_LEVEL 0x0000104AL
1665#define BA0_AC97_GPIO_PIN_CONFIG 0x0000104CL
1666#define BA0_AC97_GPIO_PIN_TYPE 0x0000104EL
1667#define BA0_AC97_GPIO_PIN_STICKY 0x00001050L
1668#define BA0_AC97_GPIO_PIN_WAKEUP 0x00001052L
1669#define BA0_AC97_GPIO_PIN_STATUS 0x00001054L
1670#define BA0_AC97_MISC_MODEM_AFE_STAT 0x00001056L
1671#define BA0_AC97_RESERVED_58 0x00001058L
1672#define BA0_AC97_CRYSTAL_REV_N_FAB_ID 0x0000105AL
1673#define BA0_AC97_TEST_AND_MISC_CTRL 0x0000105CL
1674#define BA0_AC97_AC_MODE 0x0000105EL
1675#define BA0_AC97_MISC_CRYSTAL_CONTROL 0x00001060L
1676#define BA0_AC97_LINE1_HYPRID_CTRL 0x00001062L
1677#define BA0_AC97_VENDOR_RESERVED_64 0x00001064L
1678#define BA0_AC97_VENDOR_RESERVED_66 0x00001066L
1679#define BA0_AC97_SPDIF_CONTROL 0x00001068L
1680#define BA0_AC97_VENDOR_RESERVED_6A 0x0000106AL
1681#define BA0_AC97_VENDOR_RESERVED_6C 0x0000106CL
1682#define BA0_AC97_VENDOR_RESERVED_6E 0x0000106EL
1683#define BA0_AC97_VENDOR_RESERVED_70 0x00001070L
1684#define BA0_AC97_VENDOR_RESERVED_72 0x00001072L
1685#define BA0_AC97_VENDOR_RESERVED_74 0x00001074L
1686#define BA0_AC97_CAL_ADDRESS 0x00001076L
1687#define BA0_AC97_CAL_DATA 0x00001078L
1688#define BA0_AC97_VENDOR_RESERVED_7A 0x0000107AL
1689#define BA0_AC97_VENDOR_ID1 0x0000107CL
1690#define BA0_AC97_VENDOR_ID2 0x0000107EL
1691#endif /* __CS461X_H */
diff --git a/sound/oss/cs461x_image.h b/sound/oss/cs461x_image.h
deleted file mode 100644
index b5c5a46d3423..000000000000
--- a/sound/oss/cs461x_image.h
+++ /dev/null
@@ -1,322 +0,0 @@
1/****************************************************************************
2 * "CWCIMAGE.H"-- For CS46XX. Ver 1.04
3 * Copyright 1998-2001 (c) Cirrus Logic Corp.
4 * Version 1.04
5 ****************************************************************************
6 */
7#ifndef __CS_IMAGE_H
8#define __CS_IMAGE_H
9
10#define CLEAR__COUNT 3
11#define FILL__COUNT 4
12#define BA1__DWORD_SIZE 13*1024+512
13
14static struct
15{
16 unsigned BA1__DestByteOffset;
17 unsigned BA1__SourceSize;
18} ClrStat[CLEAR__COUNT] ={ {0x00000000, 0x00003000 },
19 {0x00010000, 0x00003800 },
20 {0x00020000, 0x00007000 } };
21
22static u32 FillArray1[]={
230x00000000,0x00000000,0x00000000,0x00000000,
240x00000000,0x00000000,0x00000000,0x00000000,
250x00000000,0x00000000,0x00000163,0x00000000,
260x00000000,0x00000000,0x00000000,0x00000000,
270x00000000,0x00000000,0x00000000,0x00000000,
280x00000000,0x00000000,0x00000000,0x00000000,
290x00000000,0x00200040,0x00008010,0x00000000,
300x00000000,0x80000001,0x00000001,0x00060000,
310x00000000,0x00000000,0x00000000,0x00000000,
320x00000000,0x00000000,0x00000000,0x00000000,
330x00000000,0x00900080,0x00000173,0x00000000,
340x00000000,0x00000010,0x00800000,0x00900000,
350xf2c0000f,0x00000200,0x00000000,0x00010600,
360x00000000,0x00000000,0x00000000,0x00000000,
370x00000000,0x00000000,0x00000163,0x330300c2,
380x06000000,0x00000000,0x80008000,0x80008000,
390x3fc0000f,0x00000301,0x00010400,0x00000000,
400x00000000,0x00000000,0x00000000,0x00000000,
410x00000000,0x00b00000,0x00d0806d,0x330480c3,
420x04800000,0x00000001,0x00800001,0x0000ffff,
430x00000000,0x00000000,0x00000000,0x00000000,
440x00000000,0x00000000,0x00000000,0x00000000,
450x00000000,0x00000000,0x00000000,0x00000000,
460x00000000,0x00000000,0x00000000,0x00000000,
470x00000000,0x00000000,0x00000000,0x00000000,
480x00000000,0x00000000,0x00000000,0x00000000,
490x00000000,0x00000000,0x00000000,0x00000000,
500x00000000,0x00000000,0x00000000,0x00000000,
510x066a0600,0x06350070,0x0000929d,0x929d929d,
520x00000000,0x0000735a,0x00000600,0x00000000,
530x929d735a,0x00000000,0x00010000,0x735a735a,
540xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75,
550x00000000,0x00000000,0x00000000,0x00000000,
560x00000000,0x00000000,0x00000000,0x00000000,
570x00000000,0x00000000,0x0000804f,0x000000c3,
580x05000000,0x00a00010,0x00000000,0x80008000,
590x00000000,0x00000000,0x00000700,0x00000000,
600x00000000,0x00000000,0x00000000,0x00000000,
610x00000080,0x00a00000,0x0000809a,0x000000c2,
620x07400000,0x00000000,0x80008000,0xffffffff,
630x00c80028,0x00005555,0x00000000,0x000107a0,
640x00c80028,0x000000c2,0x06800000,0x00000000,
650x06e00080,0x00300000,0x000080bb,0x000000c9,
660x07a00000,0x04000000,0x80008000,0xffffffff,
670x00c80028,0x00005555,0x00000000,0x00000780,
680x00c80028,0x000000c5,0xff800000,0x00000000,
690x00640080,0x00c00000,0x00008197,0x000000c9,
700x07800000,0x04000000,0x80008000,0xffffffff,
710x00000000,0x00000000,0x00000000,0x00000000,
720x00000000,0x00000000,0x00000000,0x00000000,
730x00000000,0x00000000,0x0000805e,0x000000c1,
740x00000000,0x00800000,0x80008000,0x80008000,
750x00020000,0x0000ffff,0x00000000,0x00000000};
76
77static u32 FillArray2[]={
780x929d0600,0x929d929d,0x929d929d,0x929d0000,
790x929d929d,0x929d929d,0x929d929d,0x929d929d,
800x929d929d,0x00100635,0x060b013f,0x00000004,
810x00000001,0x007a0002,0x00000000,0x066e0610,
820x0105929d,0x929d929d,0x929d929d,0x929d929d,
830x929d929d,0xa431ac75,0x0001735a,0xa431ac75,
840xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75,
850xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75,
860xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75,
870xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75,
880xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75,
890xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75,
900xa431ac75,0xa431ac75,0xa431ac75,0x735a0051,
910x00000000,0x929d929d,0x929d929d,0x929d929d,
920x929d929d,0x929d929d,0x929d929d,0x929d929d,
930x929d929d,0x929d929d,0x00000000,0x06400136,
940x0000270f,0x00010000,0x007a0000,0x00000000,
950x068e0645,0x0105929d,0x929d929d,0x929d929d,
960x929d929d,0x929d929d,0xa431ac75,0x0001735a,
970xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75,
980xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75,
990xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75,
1000xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75,
1010xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75,
1020xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75,
1030xa431ac75,0xa431ac75,0xa431ac75,0xa431ac75,
1040x735a0100,0x00000000,0x00000000,0x00000000};
105
106static u32 FillArray3[]={
1070x00000000,0x00000000,0x00000000,0x00010004};
108
109static u32 FillArray4[]={
1100x00040730,0x00001002,0x000f619e,0x00001003,
1110x00001705,0x00001400,0x000a411e,0x00001003,
1120x00040730,0x00001002,0x000f619e,0x00001003,
1130x00009705,0x00001400,0x000a411e,0x00001003,
1140x00040730,0x00001002,0x000f619e,0x00001003,
1150x00011705,0x00001400,0x000a411e,0x00001003,
1160x00040730,0x00001002,0x000f619e,0x00001003,
1170x00019705,0x00001400,0x000a411e,0x00001003,
1180x00040730,0x00001002,0x000f619e,0x00001003,
1190x00021705,0x00001400,0x000a411e,0x00001003,
1200x00040730,0x00001002,0x000f619e,0x00001003,
1210x00029705,0x00001400,0x000a411e,0x00001003,
1220x00040730,0x00001002,0x000f619e,0x00001003,
1230x00031705,0x00001400,0x000a411e,0x00001003,
1240x00040730,0x00001002,0x000f619e,0x00001003,
1250x00039705,0x00001400,0x000a411e,0x00001003,
1260x000fe19e,0x00001003,0x0009c730,0x00001003,
1270x0008e19c,0x00001003,0x000083c1,0x00093040,
1280x00098730,0x00001002,0x000ee19e,0x00001003,
1290x00009705,0x00001400,0x000a211e,0x00001003,
1300x00098730,0x00001002,0x000ee19e,0x00001003,
1310x00011705,0x00001400,0x000a211e,0x00001003,
1320x00098730,0x00001002,0x000ee19e,0x00001003,
1330x00019705,0x00001400,0x000a211e,0x00001003,
1340x00098730,0x00001002,0x000ee19e,0x00001003,
1350x00021705,0x00001400,0x000a211e,0x00001003,
1360x00098730,0x00001002,0x000ee19e,0x00001003,
1370x00029705,0x00001400,0x000a211e,0x00001003,
1380x00098730,0x00001002,0x000ee19e,0x00001003,
1390x00031705,0x00001400,0x000a211e,0x00001003,
1400x00098730,0x00001002,0x000ee19e,0x00001003,
1410x00039705,0x00001400,0x000a211e,0x00001003,
1420x0000a730,0x00001008,0x000e2730,0x00001002,
1430x0000a731,0x00001002,0x0000a731,0x00001002,
1440x0000a731,0x00001002,0x0000a731,0x00001002,
1450x0000a731,0x00001002,0x0000a731,0x00001002,
1460x00000000,0x00000000,0x000f619c,0x00001003,
1470x0007f801,0x000c0000,0x00000037,0x00001000,
1480x00000000,0x00000000,0x00000000,0x00000000,
1490x00000000,0x00000000,0x00000000,0x00000000,
1500x00000000,0x000c0000,0x00000000,0x00000000,
1510x0000373c,0x00001000,0x00000000,0x00000000,
1520x000ee19c,0x00001003,0x0007f801,0x000c0000,
1530x00000037,0x00001000,0x00000000,0x00000000,
1540x00000000,0x00000000,0x00000000,0x00000000,
1550x00000000,0x00000000,0x0000273c,0x00001000,
1560x00000033,0x00001000,0x000e679e,0x00001003,
1570x00007705,0x00001400,0x000ac71e,0x00001003,
1580x00087fc1,0x000c3be0,0x0007f801,0x000c0000,
1590x00000037,0x00001000,0x00000000,0x00000000,
1600x00000000,0x00000000,0x00000000,0x00000000,
1610x00000000,0x00000000,0x0000a730,0x00001003,
1620x00000033,0x00001000,0x0007f801,0x000c0000,
1630x00000037,0x00001000,0x00000000,0x00000000,
1640x00000000,0x00000000,0x00000000,0x00000000,
1650x00000000,0x00000000,0x00000000,0x000c0000,
1660x00000032,0x00001000,0x0000273d,0x00001000,
1670x0004a730,0x00001003,0x00000f41,0x00097140,
1680x0000a841,0x0009b240,0x0000a0c1,0x0009f040,
1690x0001c641,0x00093540,0x0001cec1,0x0009b5c0,
1700x00000000,0x00000000,0x0001bf05,0x0003fc40,
1710x00002725,0x000aa400,0x00013705,0x00093a00,
1720x0000002e,0x0009d6c0,0x00038630,0x00001004,
1730x0004ef0a,0x000eb785,0x0003fc8a,0x00000000,
1740x00000000,0x000c70e0,0x0007d182,0x0002c640,
1750x00000630,0x00001004,0x000799b8,0x0002c6c0,
1760x00031705,0x00092240,0x00039f05,0x000932c0,
1770x0003520a,0x00000000,0x00040731,0x0000100b,
1780x00010705,0x000b20c0,0x00000000,0x000eba44,
1790x00032108,0x000c60c4,0x00065208,0x000c2917,
1800x000406b0,0x00001007,0x00012f05,0x00036880,
1810x0002818e,0x000c0000,0x0004410a,0x00000000,
1820x00040630,0x00001007,0x00029705,0x000c0000,
1830x00000000,0x00000000,0x00003fc1,0x0003fc40,
1840x000037c1,0x00091b40,0x00003fc1,0x000911c0,
1850x000037c1,0x000957c0,0x00003fc1,0x000951c0,
1860x000037c1,0x00000000,0x00003fc1,0x000991c0,
1870x000037c1,0x00000000,0x00003fc1,0x0009d1c0,
1880x000037c1,0x00000000,0x0001ccc1,0x000915c0,
1890x0001c441,0x0009d800,0x0009cdc1,0x00091240,
1900x0001c541,0x00091d00,0x0009cfc1,0x00095240,
1910x0001c741,0x00095c80,0x000e8ca9,0x00099240,
1920x000e85ad,0x00095640,0x00069ca9,0x00099d80,
1930x000e952d,0x00099640,0x000eaca9,0x0009d6c0,
1940x000ea5ad,0x00091a40,0x0006bca9,0x0009de80,
1950x000eb52d,0x00095a40,0x000ecca9,0x00099ac0,
1960x000ec5ad,0x0009da40,0x000edca9,0x0009d300,
1970x000a6e0a,0x00001000,0x000ed52d,0x00091e40,
1980x000eeca9,0x00095ec0,0x000ee5ad,0x00099e40,
1990x0006fca9,0x00002500,0x000fb208,0x000c59a0,
2000x000ef52d,0x0009de40,0x00068ca9,0x000912c1,
2010x000683ad,0x00095241,0x00020f05,0x000991c1,
2020x00000000,0x00000000,0x00086f88,0x00001000,
2030x0009cf81,0x000b5340,0x0009c701,0x000b92c0,
2040x0009de81,0x000bd300,0x0009d601,0x000b1700,
2050x0001fd81,0x000b9d80,0x0009f501,0x000b57c0,
2060x000a0f81,0x000bd740,0x00020701,0x000b5c80,
2070x000a1681,0x000b97c0,0x00021601,0x00002500,
2080x000a0701,0x000b9b40,0x000a0f81,0x000b1bc0,
2090x00021681,0x00002d00,0x00020f81,0x000bd800,
2100x000a0701,0x000b5bc0,0x00021601,0x00003500,
2110x000a0f81,0x000b5f40,0x000a0701,0x000bdbc0,
2120x00021681,0x00003d00,0x00020f81,0x000b1d00,
2130x000a0701,0x000b1fc0,0x00021601,0x00020500,
2140x00020f81,0x000b1341,0x000a0701,0x000b9fc0,
2150x00021681,0x00020d00,0x00020f81,0x000bde80,
2160x000a0701,0x000bdfc0,0x00021601,0x00021500,
2170x00020f81,0x000b9341,0x00020701,0x000b53c1,
2180x00021681,0x00021d00,0x000a0f81,0x000d0380,
2190x0000b601,0x000b15c0,0x00007b01,0x00000000,
2200x00007b81,0x000bd1c0,0x00007b01,0x00000000,
2210x00007b81,0x000b91c0,0x00007b01,0x000b57c0,
2220x00007b81,0x000b51c0,0x00007b01,0x000b1b40,
2230x00007b81,0x000b11c0,0x00087b01,0x000c3dc0,
2240x0007e488,0x000d7e45,0x00000000,0x000d7a44,
2250x0007e48a,0x00000000,0x00011f05,0x00084080,
2260x00000000,0x00000000,0x00001705,0x000b3540,
2270x00008a01,0x000bf040,0x00007081,0x000bb5c0,
2280x00055488,0x00000000,0x0000d482,0x0003fc40,
2290x0003fc88,0x00000000,0x0001e401,0x000b3a00,
2300x0001ec81,0x000bd6c0,0x0004ef08,0x000eb784,
2310x000c86b0,0x00001007,0x00008281,0x000bb240,
2320x0000b801,0x000b7140,0x00007888,0x00000000,
2330x0000073c,0x00001000,0x0007f188,0x000c0000,
2340x00000000,0x00000000,0x00055288,0x000c555c,
2350x0005528a,0x000c0000,0x0009fa88,0x000c5d00,
2360x0000fa88,0x00000000,0x00000032,0x00001000,
2370x0000073d,0x00001000,0x0007f188,0x000c0000,
2380x00000000,0x00000000,0x0008c01c,0x00001003,
2390x00002705,0x00001008,0x0008b201,0x000c1392,
2400x0000ba01,0x00000000,0x00008731,0x00001400,
2410x0004c108,0x000fe0c4,0x00057488,0x00000000,
2420x000a6388,0x00001001,0x0008b334,0x000bc141,
2430x0003020e,0x00000000,0x000886b0,0x00001008,
2440x00003625,0x000c5dfa,0x000a638a,0x00001001,
2450x0008020e,0x00001002,0x0008a6b0,0x00001008,
2460x0007f301,0x00000000,0x00000000,0x00000000,
2470x00002725,0x000a8c40,0x000000ae,0x00000000,
2480x000d8630,0x00001008,0x00000000,0x000c74e0,
2490x0007d182,0x0002d640,0x000a8630,0x00001008,
2500x000799b8,0x0002d6c0,0x0000748a,0x000c3ec5,
2510x0007420a,0x000c0000,0x00062208,0x000c4117,
2520x00070630,0x00001009,0x00000000,0x000c0000,
2530x0001022e,0x00000000,0x0003a630,0x00001009,
2540x00000000,0x000c0000,0x00000036,0x00001000,
2550x00000000,0x00000000,0x00000000,0x00000000,
2560x00000000,0x00000000,0x00000000,0x00000000,
2570x0002a730,0x00001008,0x0007f801,0x000c0000,
2580x00000037,0x00001000,0x00000000,0x00000000,
2590x00000000,0x00000000,0x00000000,0x00000000,
2600x00000000,0x00000000,0x0002a730,0x00001008,
2610x00000033,0x00001000,0x0002a705,0x00001008,
2620x00007a01,0x000c0000,0x000e6288,0x000d550a,
2630x0006428a,0x00000000,0x00060730,0x0000100a,
2640x00000000,0x000c0000,0x00000000,0x00000000,
2650x0007aab0,0x00034880,0x00078fb0,0x0000100b,
2660x00057488,0x00000000,0x00033b94,0x00081140,
2670x000183ae,0x00000000,0x000786b0,0x0000100b,
2680x00022f05,0x000c3545,0x0000eb8a,0x00000000,
2690x00042731,0x00001003,0x0007aab0,0x00034880,
2700x00048fb0,0x0000100a,0x00057488,0x00000000,
2710x00033b94,0x00081140,0x000183ae,0x00000000,
2720x000806b0,0x0000100b,0x00022f05,0x00000000,
2730x00007401,0x00091140,0x00048f05,0x000951c0,
2740x00042731,0x00001003,0x0000473d,0x00001000,
2750x000f19b0,0x000bbc47,0x00080000,0x000bffc7,
2760x000fe19e,0x00001003,0x00000000,0x00000000,
2770x0008e19c,0x00001003,0x000083c1,0x00093040,
2780x00000f41,0x00097140,0x0000a841,0x0009b240,
2790x0000a0c1,0x0009f040,0x0001c641,0x00093540,
2800x0001cec1,0x0009b5c0,0x00000000,0x000fdc44,
2810x00055208,0x00000000,0x00010705,0x000a2880,
2820x0000a23a,0x00093a00,0x0003fc8a,0x000df6c5,
2830x0004ef0a,0x000c0000,0x00012f05,0x00036880,
2840x00065308,0x000c2997,0x000d86b0,0x0000100a,
2850x0004410a,0x000d40c7,0x00000000,0x00000000,
2860x00080730,0x00001004,0x00056f0a,0x000ea105,
2870x00000000,0x00000000,0x0000473d,0x00001000,
2880x000f19b0,0x000bbc47,0x00080000,0x000bffc7,
2890x0000273d,0x00001000,0x00000000,0x000eba44,
2900x00048f05,0x0000f440,0x00007401,0x0000f7c0,
2910x00000734,0x00001000,0x00010705,0x000a6880,
2920x00006a88,0x000c75c4,0x00000000,0x000e5084,
2930x00000000,0x000eba44,0x00087401,0x000e4782,
2940x00000734,0x00001000,0x00010705,0x000a6880,
2950x00006a88,0x000c75c4,0x0007c108,0x000c0000,
2960x0007e721,0x000bed40,0x00005f25,0x000badc0,
2970x0003ba97,0x000beb80,0x00065590,0x000b2e00,
2980x00033217,0x00003ec0,0x00065590,0x000b8e40,
2990x0003ed80,0x000491c0,0x00073fb0,0x00074c80,
3000x000283a0,0x0000100c,0x000ee388,0x00042970,
3010x00008301,0x00021ef2,0x000b8f14,0x0000000f,
3020x000c4d8d,0x0000001b,0x000d6dc2,0x000e06c6,
3030x000032ac,0x000c3916,0x0004edc2,0x00074c80,
3040x00078898,0x00001000,0x00038894,0x00000032,
3050x000c4d8d,0x00092e1b,0x000d6dc2,0x000e06c6,
3060x0004edc2,0x000c1956,0x0000722c,0x00034a00,
3070x00041705,0x0009ed40,0x00058730,0x00001400,
3080x000d7488,0x000c3a00,0x00048f05,0x00000000};
309
310static struct
311{ u32 Offset;
312 u32 Size;
313 u32 *pFill;
314} FillStat[FILL__COUNT] = {
315 {0x00000000, sizeof(FillArray1), FillArray1},
316 {0x00001800, sizeof(FillArray2), FillArray2},
317 {0x000137f0, sizeof(FillArray3), FillArray3},
318 {0x00020000, sizeof(FillArray4), FillArray4}
319 };
320
321
322#endif
diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c
deleted file mode 100644
index 2a1f0d9ac968..000000000000
--- a/sound/oss/cs46xx.c
+++ /dev/null
@@ -1,5444 +0,0 @@
1/*
2 * Crystal SoundFusion CS46xx driver
3 *
4 * Copyright 1998-2001 Cirrus Logic Corporation <pcaudio@crystal.cirrus.com>
5 * <twoller@crystal.cirrus.com>
6 * Copyright 1999-2000 Jaroslav Kysela <perex@suse.cz>
7 * Copyright 2000 Alan Cox <alan@redhat.com>
8 *
9 * The core of this code is taken from the ALSA project driver by
10 * Jaroslav. Please send Jaroslav the credit for the driver and
11 * report bugs in this port to <alan@redhat.com>
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 * Current maintainers:
27 * Cirrus Logic Corporation, Thomas Woller (tw)
28 * <twoller@crystal.cirrus.com>
29 * Nils Faerber (nf)
30 * <nils@kernelconcepts.de>
31 * Thanks to David Pollard for testing.
32 *
33 * Changes:
34 * 20000909-nf Changed cs_read, cs_write and drain_dac
35 * 20001025-tw Separate Playback/Capture structs and buffers.
36 * Added Scatter/Gather support for Playback.
37 * Added Capture.
38 * 20001027-nf Port to kernel 2.4.0-test9, some clean-ups
39 * Start of powermanagement support (CS46XX_PM).
40 * 20001128-tw Add module parm for default buffer order.
41 * added DMA_GFP flag to kmalloc dma buffer allocs.
42 * backfill silence to eliminate stuttering on
43 * underruns.
44 * 20001201-tw add resyncing of swptr on underruns.
45 * 20001205-tw-nf fixed GETOSPACE ioctl() after open()
46 * 20010113-tw patch from Hans Grobler general cleanup.
47 * 20010117-tw 2.4.0 pci cleanup, wrapper code for 2.2.16-2.4.0
48 * 20010118-tw basic PM support for 2.2.16+ and 2.4.0/2.4.2.
49 * 20010228-dh patch from David Huggins - cs_update_ptr recursion.
50 * 20010409-tw add hercules game theatre XP amp code.
51 * 20010420-tw cleanup powerdown/up code.
52 * 20010521-tw eliminate pops, and fixes for powerdown.
53 * 20010525-tw added fixes for thinkpads with powerdown logic.
54 * 20010723-sh patch from Horms (Simon Horman) -
55 * SOUND_PCM_READ_BITS returns bits as set in driver
56 * rather than a logical or of the possible values.
57 * Various ioctls handle the case where the device
58 * is open for reading or writing but not both better.
59 *
60 * Status:
61 * Playback/Capture supported from 8k-48k.
62 * 16Bit Signed LE & 8Bit Unsigned, with Mono or Stereo supported.
63 *
64 * APM/PM - 2.2.x APM is enabled and functioning fine. APM can also
65 * be enabled for 2.4.x by modifying the CS46XX_ACPI_SUPPORT macro
66 * definition.
67 *
68 * Hercules Game Theatre XP - the EGPIO2 pin controls the external Amp,
69 * so, use the drain/polarity to enable.
70 * hercules_egpio_disable set to 1, will force a 0 to EGPIODR.
71 *
72 * VTB Santa Cruz - the GPIO7/GPIO8 on the Secondary Codec control
73 * the external amplifier for the "back" speakers, since we do not
74 * support the secondary codec then this external amp is also not
75 * turned on.
76 */
77
78#include <linux/interrupt.h>
79#include <linux/list.h>
80#include <linux/module.h>
81#include <linux/string.h>
82#include <linux/ioport.h>
83#include <linux/sched.h>
84#include <linux/delay.h>
85#include <linux/sound.h>
86#include <linux/slab.h>
87#include <linux/soundcard.h>
88#include <linux/pci.h>
89#include <linux/bitops.h>
90#include <linux/init.h>
91#include <linux/poll.h>
92#include <linux/ac97_codec.h>
93#include <linux/mutex.h>
94#include <linux/mm.h>
95
96#include <asm/io.h>
97#include <asm/dma.h>
98#include <asm/uaccess.h>
99
100#include "cs46xxpm.h"
101#include "cs46xx_wrapper-24.h"
102#include "cs461x.h"
103
104/* MIDI buffer sizes */
105#define CS_MIDIINBUF 500
106#define CS_MIDIOUTBUF 500
107
108#define ADC_RUNNING 1
109#define DAC_RUNNING 2
110
111#define CS_FMT_16BIT 1 /* These are fixed in fact */
112#define CS_FMT_STEREO 2
113#define CS_FMT_MASK 3
114
115#define CS_TYPE_ADC 1
116#define CS_TYPE_DAC 2
117
118#define CS_TRUE 1
119#define CS_FALSE 0
120
121#define CS_INC_USE_COUNT(m) (atomic_inc(m))
122#define CS_DEC_USE_COUNT(m) (atomic_dec(m))
123#define CS_DEC_AND_TEST(m) (atomic_dec_and_test(m))
124#define CS_IN_USE(m) (atomic_read(m) != 0)
125
126#define CS_DBGBREAKPOINT {__asm__("INT $3");}
127/*
128 * CS461x definitions
129 */
130
131#define CS461X_BA0_SIZE 0x2000
132#define CS461X_BA1_DATA0_SIZE 0x3000
133#define CS461X_BA1_DATA1_SIZE 0x3800
134#define CS461X_BA1_PRG_SIZE 0x7000
135#define CS461X_BA1_REG_SIZE 0x0100
136
137#define GOF_PER_SEC 200
138
139#define CSDEBUG_INTERFACE 1
140#define CSDEBUG 1
141/*
142 * Turn on/off debugging compilation by using 1/0 respectively for CSDEBUG
143 *
144 *
145 * CSDEBUG is usual mode is set to 1, then use the
146 * cs_debuglevel and cs_debugmask to turn on or off debugging.
147 * Debug level of 1 has been defined to be kernel errors and info
148 * that should be printed on any released driver.
149 */
150#if CSDEBUG
151#define CS_DBGOUT(mask,level,x) if ((cs_debuglevel >= (level)) && ((mask) & cs_debugmask)) {x;}
152#else
153#define CS_DBGOUT(mask,level,x)
154#endif
155/*
156 * cs_debugmask areas
157 */
158#define CS_INIT 0x00000001 /* initialization and probe functions */
159#define CS_ERROR 0x00000002 /* tmp debugging bit placeholder */
160#define CS_INTERRUPT 0x00000004 /* interrupt handler (separate from all other) */
161#define CS_FUNCTION 0x00000008 /* enter/leave functions */
162#define CS_WAVE_WRITE 0x00000010 /* write information for wave */
163#define CS_WAVE_READ 0x00000020 /* read information for wave */
164#define CS_MIDI_WRITE 0x00000040 /* write information for midi */
165#define CS_MIDI_READ 0x00000080 /* read information for midi */
166#define CS_MPU401_WRITE 0x00000100 /* write information for mpu401 */
167#define CS_MPU401_READ 0x00000200 /* read information for mpu401 */
168#define CS_OPEN 0x00000400 /* all open functions in the driver */
169#define CS_RELEASE 0x00000800 /* all release functions in the driver */
170#define CS_PARMS 0x00001000 /* functional and operational parameters */
171#define CS_IOCTL 0x00002000 /* ioctl (non-mixer) */
172#define CS_PM 0x00004000 /* PM */
173#define CS_TMP 0x10000000 /* tmp debug mask bit */
174
175#define CS_IOCTL_CMD_SUSPEND 0x1 // suspend
176#define CS_IOCTL_CMD_RESUME 0x2 // resume
177
178#if CSDEBUG
179static unsigned long cs_debuglevel = 1; /* levels range from 1-9 */
180module_param(cs_debuglevel, ulong, 0644);
181static unsigned long cs_debugmask = CS_INIT | CS_ERROR; /* use CS_DBGOUT with various mask values */
182module_param(cs_debugmask, ulong, 0644);
183#endif
184static unsigned long hercules_egpio_disable; /* if non-zero set all EGPIO to 0 */
185module_param(hercules_egpio_disable, ulong, 0);
186static unsigned long initdelay = 700; /* PM delay in millisecs */
187module_param(initdelay, ulong, 0);
188static unsigned long powerdown = -1; /* turn on/off powerdown processing in driver */
189module_param(powerdown, ulong, 0);
190#define DMABUF_DEFAULTORDER 3
191static unsigned long defaultorder = DMABUF_DEFAULTORDER;
192module_param(defaultorder, ulong, 0);
193
194static int external_amp;
195module_param(external_amp, bool, 0);
196static int thinkpad;
197module_param(thinkpad, bool, 0);
198
199/*
200* set the powerdown module parm to 0 to disable all
201* powerdown. also set thinkpad to 1 to disable powerdown,
202* but also to enable the clkrun functionality.
203*/
204static unsigned cs_powerdown = 1;
205static unsigned cs_laptop_wait = 1;
206
207/* An instance of the 4610 channel */
208struct cs_channel
209{
210 int used;
211 int num;
212 void *state;
213};
214
215#define CS46XX_MAJOR_VERSION "1"
216#define CS46XX_MINOR_VERSION "28"
217
218#ifdef __ia64__
219#define CS46XX_ARCH "64" //architecture key
220#else
221#define CS46XX_ARCH "32" //architecture key
222#endif
223
224static struct list_head cs46xx_devs = { &cs46xx_devs, &cs46xx_devs };
225
226/* magic numbers to protect our data structures */
227#define CS_CARD_MAGIC 0x43525553 /* "CRUS" */
228#define CS_STATE_MAGIC 0x4c4f4749 /* "LOGI" */
229#define NR_HW_CH 3
230
231/* maxinum number of AC97 codecs connected, AC97 2.0 defined 4 */
232#define NR_AC97 2
233
234static const unsigned sample_size[] = { 1, 2, 2, 4 };
235static const unsigned sample_shift[] = { 0, 1, 1, 2 };
236
237/* "software" or virtual channel, an instance of opened /dev/dsp */
238struct cs_state {
239 unsigned int magic;
240 struct cs_card *card; /* Card info */
241
242 /* single open lock mechanism, only used for recording */
243 struct mutex open_mutex;
244 wait_queue_head_t open_wait;
245
246 /* file mode */
247 mode_t open_mode;
248
249 /* virtual channel number */
250 int virt;
251
252 struct dmabuf {
253 /* wave sample stuff */
254 unsigned int rate;
255 unsigned char fmt, enable;
256
257 /* hardware channel */
258 struct cs_channel *channel;
259 int pringbuf; /* Software ring slot */
260 void *pbuf; /* 4K hardware DMA buffer */
261
262 /* OSS buffer management stuff */
263 void *rawbuf;
264 dma_addr_t dma_handle;
265 unsigned buforder;
266 unsigned numfrag;
267 unsigned fragshift;
268 unsigned divisor;
269 unsigned type;
270 void *tmpbuff; /* tmp buffer for sample conversions */
271 dma_addr_t dmaaddr;
272 dma_addr_t dmaaddr_tmpbuff;
273 unsigned buforder_tmpbuff; /* Log base 2 of size in bytes.. */
274
275 /* our buffer acts like a circular ring */
276 unsigned hwptr; /* where dma last started, updated by update_ptr */
277 unsigned swptr; /* where driver last clear/filled, updated by read/write */
278 int count; /* bytes to be comsumed or been generated by dma machine */
279 unsigned total_bytes; /* total bytes dmaed by hardware */
280 unsigned blocks; /* total blocks */
281
282 unsigned error; /* number of over/underruns */
283 unsigned underrun; /* underrun pending before next write has occurred */
284 wait_queue_head_t wait; /* put process on wait queue when no more space in buffer */
285
286 /* redundant, but makes calculations easier */
287 unsigned fragsize;
288 unsigned dmasize;
289 unsigned fragsamples;
290
291 /* OSS stuff */
292 unsigned mapped:1;
293 unsigned ready:1;
294 unsigned endcleared:1;
295 unsigned SGok:1;
296 unsigned update_flag;
297 unsigned ossfragshift;
298 int ossmaxfrags;
299 unsigned subdivision;
300 } dmabuf;
301 /* Guard against mmap/write/read races */
302 struct mutex sem;
303};
304
305struct cs_card {
306 struct cs_channel channel[2];
307 unsigned int magic;
308
309 /* We keep cs461x cards in a linked list */
310 struct cs_card *next;
311
312 /* The cs461x has a certain amount of cross channel interaction
313 so we use a single per card lock */
314 spinlock_t lock;
315
316 /* Keep AC97 sane */
317 spinlock_t ac97_lock;
318
319 /* mixer use count */
320 atomic_t mixer_use_cnt;
321
322 /* PCI device stuff */
323 struct pci_dev *pci_dev;
324 struct list_head list;
325
326 unsigned int pctl, cctl; /* Hardware DMA flag sets */
327
328 /* soundcore stuff */
329 int dev_audio;
330 int dev_midi;
331
332 /* structures for abstraction of hardware facilities, codecs, banks and channels*/
333 struct ac97_codec *ac97_codec[NR_AC97];
334 struct cs_state *states[2];
335
336 u16 ac97_features;
337
338 int amplifier; /* Amplifier control */
339 void (*amplifier_ctrl)(struct cs_card *, int);
340 void (*amp_init)(struct cs_card *);
341
342 int active; /* Active clocking */
343 void (*active_ctrl)(struct cs_card *, int);
344
345 /* hardware resources */
346 unsigned long ba0_addr;
347 unsigned long ba1_addr;
348 u32 irq;
349
350 /* mappings */
351 void __iomem *ba0;
352 union
353 {
354 struct
355 {
356 u8 __iomem *data0;
357 u8 __iomem *data1;
358 u8 __iomem *pmem;
359 u8 __iomem *reg;
360 } name;
361 u8 __iomem *idx[4];
362 } ba1;
363
364 /* Function support */
365 struct cs_channel *(*alloc_pcm_channel)(struct cs_card *);
366 struct cs_channel *(*alloc_rec_pcm_channel)(struct cs_card *);
367 void (*free_pcm_channel)(struct cs_card *, int chan);
368
369 /* /dev/midi stuff */
370 struct {
371 unsigned ird, iwr, icnt;
372 unsigned ord, owr, ocnt;
373 wait_queue_head_t open_wait;
374 wait_queue_head_t iwait;
375 wait_queue_head_t owait;
376 spinlock_t lock;
377 unsigned char ibuf[CS_MIDIINBUF];
378 unsigned char obuf[CS_MIDIOUTBUF];
379 mode_t open_mode;
380 struct mutex open_mutex;
381 } midi;
382 struct cs46xx_pm pm;
383};
384
385static int cs_open_mixdev(struct inode *inode, struct file *file);
386static int cs_release_mixdev(struct inode *inode, struct file *file);
387static int cs_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd,
388 unsigned long arg);
389static int cs_hardware_init(struct cs_card *card);
390static int cs46xx_powerup(struct cs_card *card, unsigned int type);
391static int cs461x_powerdown(struct cs_card *card, unsigned int type, int suspendflag);
392static void cs461x_clear_serial_FIFOs(struct cs_card *card, int type);
393#ifdef CONFIG_PM
394static int cs46xx_suspend_tbl(struct pci_dev *pcidev, pm_message_t state);
395static int cs46xx_resume_tbl(struct pci_dev *pcidev);
396#endif
397
398#if CSDEBUG
399
400/* DEBUG ROUTINES */
401
402#define SOUND_MIXER_CS_GETDBGLEVEL _SIOWR('M',120, int)
403#define SOUND_MIXER_CS_SETDBGLEVEL _SIOWR('M',121, int)
404#define SOUND_MIXER_CS_GETDBGMASK _SIOWR('M',122, int)
405#define SOUND_MIXER_CS_SETDBGMASK _SIOWR('M',123, int)
406#define SOUND_MIXER_CS_APM _SIOWR('M',124, int)
407
408static void printioctl(unsigned int x)
409{
410 unsigned int i;
411 unsigned char vidx;
412 /* these values are incorrect for the ac97 driver, fix.
413 * Index of mixtable1[] member is Device ID
414 * and must be <= SOUND_MIXER_NRDEVICES.
415 * Value of array member is index into s->mix.vol[]
416 */
417 static const unsigned char mixtable1[SOUND_MIXER_NRDEVICES] = {
418 [SOUND_MIXER_PCM] = 1, /* voice */
419 [SOUND_MIXER_LINE1] = 2, /* AUX */
420 [SOUND_MIXER_CD] = 3, /* CD */
421 [SOUND_MIXER_LINE] = 4, /* Line */
422 [SOUND_MIXER_SYNTH] = 5, /* FM */
423 [SOUND_MIXER_MIC] = 6, /* Mic */
424 [SOUND_MIXER_SPEAKER] = 7, /* Speaker */
425 [SOUND_MIXER_RECLEV] = 8, /* Recording level */
426 [SOUND_MIXER_VOLUME] = 9 /* Master Volume */
427 };
428
429 switch (x) {
430 case SOUND_MIXER_CS_GETDBGMASK:
431 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_CS_GETDBGMASK: ") );
432 break;
433 case SOUND_MIXER_CS_GETDBGLEVEL:
434 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_CS_GETDBGLEVEL: ") );
435 break;
436 case SOUND_MIXER_CS_SETDBGMASK:
437 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_CS_SETDBGMASK: ") );
438 break;
439 case SOUND_MIXER_CS_SETDBGLEVEL:
440 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_CS_SETDBGLEVEL: ") );
441 break;
442 case OSS_GETVERSION:
443 CS_DBGOUT(CS_IOCTL, 4, printk("OSS_GETVERSION: ") );
444 break;
445 case SNDCTL_DSP_SYNC:
446 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SYNC: ") );
447 break;
448 case SNDCTL_DSP_SETDUPLEX:
449 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SETDUPLEX: ") );
450 break;
451 case SNDCTL_DSP_GETCAPS:
452 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETCAPS: ") );
453 break;
454 case SNDCTL_DSP_RESET:
455 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_RESET: ") );
456 break;
457 case SNDCTL_DSP_SPEED:
458 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SPEED: ") );
459 break;
460 case SNDCTL_DSP_STEREO:
461 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_STEREO: ") );
462 break;
463 case SNDCTL_DSP_CHANNELS:
464 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_CHANNELS: ") );
465 break;
466 case SNDCTL_DSP_GETFMTS:
467 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETFMTS: ") );
468 break;
469 case SNDCTL_DSP_SETFMT:
470 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SETFMT: ") );
471 break;
472 case SNDCTL_DSP_POST:
473 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_POST: ") );
474 break;
475 case SNDCTL_DSP_GETTRIGGER:
476 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETTRIGGER: ") );
477 break;
478 case SNDCTL_DSP_SETTRIGGER:
479 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SETTRIGGER: ") );
480 break;
481 case SNDCTL_DSP_GETOSPACE:
482 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETOSPACE: ") );
483 break;
484 case SNDCTL_DSP_GETISPACE:
485 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETISPACE: ") );
486 break;
487 case SNDCTL_DSP_NONBLOCK:
488 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_NONBLOCK: ") );
489 break;
490 case SNDCTL_DSP_GETODELAY:
491 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETODELAY: ") );
492 break;
493 case SNDCTL_DSP_GETIPTR:
494 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETIPTR: ") );
495 break;
496 case SNDCTL_DSP_GETOPTR:
497 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETOPTR: ") );
498 break;
499 case SNDCTL_DSP_GETBLKSIZE:
500 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_GETBLKSIZE: ") );
501 break;
502 case SNDCTL_DSP_SETFRAGMENT:
503 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SETFRAGMENT: ") );
504 break;
505 case SNDCTL_DSP_SUBDIVIDE:
506 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SUBDIVIDE: ") );
507 break;
508 case SOUND_PCM_READ_RATE:
509 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_PCM_READ_RATE: ") );
510 break;
511 case SOUND_PCM_READ_CHANNELS:
512 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_PCM_READ_CHANNELS: ") );
513 break;
514 case SOUND_PCM_READ_BITS:
515 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_PCM_READ_BITS: ") );
516 break;
517 case SOUND_PCM_WRITE_FILTER:
518 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_PCM_WRITE_FILTER: ") );
519 break;
520 case SNDCTL_DSP_SETSYNCRO:
521 CS_DBGOUT(CS_IOCTL, 4, printk("SNDCTL_DSP_SETSYNCRO: ") );
522 break;
523 case SOUND_PCM_READ_FILTER:
524 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_PCM_READ_FILTER: ") );
525 break;
526 case SOUND_MIXER_PRIVATE1:
527 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_PRIVATE1: ") );
528 break;
529 case SOUND_MIXER_PRIVATE2:
530 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_PRIVATE2: ") );
531 break;
532 case SOUND_MIXER_PRIVATE3:
533 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_PRIVATE3: ") );
534 break;
535 case SOUND_MIXER_PRIVATE4:
536 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_PRIVATE4: ") );
537 break;
538 case SOUND_MIXER_PRIVATE5:
539 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_PRIVATE5: ") );
540 break;
541 case SOUND_MIXER_INFO:
542 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_INFO: ") );
543 break;
544 case SOUND_OLD_MIXER_INFO:
545 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_OLD_MIXER_INFO: ") );
546 break;
547 default:
548 switch (_IOC_NR(x)) {
549 case SOUND_MIXER_VOLUME:
550 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_VOLUME: ") );
551 break;
552 case SOUND_MIXER_SPEAKER:
553 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_SPEAKER: ") );
554 break;
555 case SOUND_MIXER_RECLEV:
556 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_RECLEV: ") );
557 break;
558 case SOUND_MIXER_MIC:
559 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_MIC: ") );
560 break;
561 case SOUND_MIXER_SYNTH:
562 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_SYNTH: ") );
563 break;
564 case SOUND_MIXER_RECSRC:
565 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_RECSRC: ") );
566 break;
567 case SOUND_MIXER_DEVMASK:
568 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_DEVMASK: ") );
569 break;
570 case SOUND_MIXER_RECMASK:
571 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_RECMASK: ") );
572 break;
573 case SOUND_MIXER_STEREODEVS:
574 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_STEREODEVS: ") );
575 break;
576 case SOUND_MIXER_CAPS:
577 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_CAPS:") );
578 break;
579 default:
580 i = _IOC_NR(x);
581 if (i >= SOUND_MIXER_NRDEVICES || !(vidx = mixtable1[i])) {
582 CS_DBGOUT(CS_IOCTL, 4, printk("UNKNOWN IOCTL: 0x%.8x NR=%d ",x,i) );
583 } else {
584 CS_DBGOUT(CS_IOCTL, 4, printk("SOUND_MIXER_IOCTL AC9x: 0x%.8x NR=%d ",
585 x,i));
586 }
587 break;
588 }
589 }
590 CS_DBGOUT(CS_IOCTL, 4, printk("command = 0x%x IOC_NR=%d\n",x, _IOC_NR(x)) );
591}
592#endif
593
594/*
595 * common I/O routines
596 */
597
598static void cs461x_poke(struct cs_card *codec, unsigned long reg, unsigned int val)
599{
600 writel(val, codec->ba1.idx[(reg >> 16) & 3] + (reg & 0xffff));
601}
602
603static unsigned int cs461x_peek(struct cs_card *codec, unsigned long reg)
604{
605 return readl(codec->ba1.idx[(reg >> 16) & 3] + (reg & 0xffff));
606}
607
608static void cs461x_pokeBA0(struct cs_card *codec, unsigned long reg, unsigned int val)
609{
610 writel(val, codec->ba0 + reg);
611}
612
613static unsigned int cs461x_peekBA0(struct cs_card *codec, unsigned long reg)
614{
615 return readl(codec->ba0 + reg);
616}
617
618
619static u16 cs_ac97_get(struct ac97_codec *dev, u8 reg);
620static void cs_ac97_set(struct ac97_codec *dev, u8 reg, u16 data);
621
622static struct cs_channel *cs_alloc_pcm_channel(struct cs_card *card)
623{
624 if (card->channel[1].used == 1)
625 return NULL;
626 card->channel[1].used = 1;
627 card->channel[1].num = 1;
628 return &card->channel[1];
629}
630
631static struct cs_channel *cs_alloc_rec_pcm_channel(struct cs_card *card)
632{
633 if (card->channel[0].used == 1)
634 return NULL;
635 card->channel[0].used = 1;
636 card->channel[0].num = 0;
637 return &card->channel[0];
638}
639
640static void cs_free_pcm_channel(struct cs_card *card, int channel)
641{
642 card->channel[channel].state = NULL;
643 card->channel[channel].used = 0;
644}
645
646/*
647 * setup a divisor value to help with conversion from
648 * 16bit Stereo, down to 8bit stereo/mono or 16bit mono.
649 * assign a divisor of 1 if using 16bit Stereo as that is
650 * the only format that the static image will capture.
651 */
652static void cs_set_divisor(struct dmabuf *dmabuf)
653{
654 if (dmabuf->type == CS_TYPE_DAC)
655 dmabuf->divisor = 1;
656 else if (!(dmabuf->fmt & CS_FMT_STEREO) &&
657 (dmabuf->fmt & CS_FMT_16BIT))
658 dmabuf->divisor = 2;
659 else if ((dmabuf->fmt & CS_FMT_STEREO) &&
660 !(dmabuf->fmt & CS_FMT_16BIT))
661 dmabuf->divisor = 2;
662 else if (!(dmabuf->fmt & CS_FMT_STEREO) &&
663 !(dmabuf->fmt & CS_FMT_16BIT))
664 dmabuf->divisor = 4;
665 else
666 dmabuf->divisor = 1;
667
668 CS_DBGOUT(CS_PARMS | CS_FUNCTION, 8, printk(
669 "cs46xx: cs_set_divisor()- %s %d\n",
670 (dmabuf->type == CS_TYPE_ADC) ? "ADC" : "DAC",
671 dmabuf->divisor) );
672}
673
674/*
675* mute some of the more prevalent registers to avoid popping.
676*/
677static void cs_mute(struct cs_card *card, int state)
678{
679 struct ac97_codec *dev = card->ac97_codec[0];
680
681 CS_DBGOUT(CS_FUNCTION, 2, printk(KERN_INFO "cs46xx: cs_mute()+ %s\n",
682 (state == CS_TRUE) ? "Muting" : "UnMuting"));
683
684 if (state == CS_TRUE) {
685 /*
686 * fix pops when powering up on thinkpads
687 */
688 card->pm.u32AC97_master_volume = (u32)cs_ac97_get( dev,
689 (u8)BA0_AC97_MASTER_VOLUME);
690 card->pm.u32AC97_headphone_volume = (u32)cs_ac97_get(dev,
691 (u8)BA0_AC97_HEADPHONE_VOLUME);
692 card->pm.u32AC97_master_volume_mono = (u32)cs_ac97_get(dev,
693 (u8)BA0_AC97_MASTER_VOLUME_MONO);
694 card->pm.u32AC97_pcm_out_volume = (u32)cs_ac97_get(dev,
695 (u8)BA0_AC97_PCM_OUT_VOLUME);
696
697 cs_ac97_set(dev, (u8)BA0_AC97_MASTER_VOLUME, 0x8000);
698 cs_ac97_set(dev, (u8)BA0_AC97_HEADPHONE_VOLUME, 0x8000);
699 cs_ac97_set(dev, (u8)BA0_AC97_MASTER_VOLUME_MONO, 0x8000);
700 cs_ac97_set(dev, (u8)BA0_AC97_PCM_OUT_VOLUME, 0x8000);
701 } else {
702 cs_ac97_set(dev, (u8)BA0_AC97_MASTER_VOLUME, card->pm.u32AC97_master_volume);
703 cs_ac97_set(dev, (u8)BA0_AC97_HEADPHONE_VOLUME, card->pm.u32AC97_headphone_volume);
704 cs_ac97_set(dev, (u8)BA0_AC97_MASTER_VOLUME_MONO, card->pm.u32AC97_master_volume_mono);
705 cs_ac97_set(dev, (u8)BA0_AC97_PCM_OUT_VOLUME, card->pm.u32AC97_pcm_out_volume);
706 }
707 CS_DBGOUT(CS_FUNCTION, 2, printk(KERN_INFO "cs46xx: cs_mute()-\n"));
708}
709
710/* set playback sample rate */
711static unsigned int cs_set_dac_rate(struct cs_state * state, unsigned int rate)
712{
713 struct dmabuf *dmabuf = &state->dmabuf;
714 unsigned int tmp1, tmp2;
715 unsigned int phiIncr;
716 unsigned int correctionPerGOF, correctionPerSec;
717 unsigned long flags;
718
719 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_set_dac_rate()+ %d\n",rate) );
720
721 /*
722 * Compute the values used to drive the actual sample rate conversion.
723 * The following formulas are being computed, using inline assembly
724 * since we need to use 64 bit arithmetic to compute the values:
725 *
726 * phiIncr = floor((Fs,in * 2^26) / Fs,out)
727 * correctionPerGOF = floor((Fs,in * 2^26 - Fs,out * phiIncr) /
728 * GOF_PER_SEC)
729 * ulCorrectionPerSec = Fs,in * 2^26 - Fs,out * phiIncr -M
730 * GOF_PER_SEC * correctionPerGOF
731 *
732 * i.e.
733 *
734 * phiIncr:other = dividend:remainder((Fs,in * 2^26) / Fs,out)
735 * correctionPerGOF:correctionPerSec =
736 * dividend:remainder(ulOther / GOF_PER_SEC)
737 */
738 tmp1 = rate << 16;
739 phiIncr = tmp1 / 48000;
740 tmp1 -= phiIncr * 48000;
741 tmp1 <<= 10;
742 phiIncr <<= 10;
743 tmp2 = tmp1 / 48000;
744 phiIncr += tmp2;
745 tmp1 -= tmp2 * 48000;
746 correctionPerGOF = tmp1 / GOF_PER_SEC;
747 tmp1 -= correctionPerGOF * GOF_PER_SEC;
748 correctionPerSec = tmp1;
749
750 /*
751 * Fill in the SampleRateConverter control block.
752 */
753 spin_lock_irqsave(&state->card->lock, flags);
754 cs461x_poke(state->card, BA1_PSRC,
755 ((correctionPerSec << 16) & 0xFFFF0000) | (correctionPerGOF & 0xFFFF));
756 cs461x_poke(state->card, BA1_PPI, phiIncr);
757 spin_unlock_irqrestore(&state->card->lock, flags);
758 dmabuf->rate = rate;
759
760 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_set_dac_rate()- %d\n",rate) );
761 return rate;
762}
763
764/* set recording sample rate */
765static unsigned int cs_set_adc_rate(struct cs_state *state, unsigned int rate)
766{
767 struct dmabuf *dmabuf = &state->dmabuf;
768 struct cs_card *card = state->card;
769 unsigned int phiIncr, coeffIncr, tmp1, tmp2;
770 unsigned int correctionPerGOF, correctionPerSec, initialDelay;
771 unsigned int frameGroupLength, cnt;
772 unsigned long flags;
773 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_set_adc_rate()+ %d\n",rate) );
774
775 /*
776 * We can only decimate by up to a factor of 1/9th the hardware rate.
777 * Correct the value if an attempt is made to stray outside that limit.
778 */
779 if ((rate * 9) < 48000)
780 rate = 48000 / 9;
781
782 /*
783 * We cannot capture at at rate greater than the Input Rate (48000).
784 * Return an error if an attempt is made to stray outside that limit.
785 */
786 if (rate > 48000)
787 rate = 48000;
788
789 /*
790 * Compute the values used to drive the actual sample rate conversion.
791 * The following formulas are being computed, using inline assembly
792 * since we need to use 64 bit arithmetic to compute the values:
793 *
794 * coeffIncr = -floor((Fs,out * 2^23) / Fs,in)
795 * phiIncr = floor((Fs,in * 2^26) / Fs,out)
796 * correctionPerGOF = floor((Fs,in * 2^26 - Fs,out * phiIncr) /
797 * GOF_PER_SEC)
798 * correctionPerSec = Fs,in * 2^26 - Fs,out * phiIncr -
799 * GOF_PER_SEC * correctionPerGOF
800 * initialDelay = ceil((24 * Fs,in) / Fs,out)
801 *
802 * i.e.
803 *
804 * coeffIncr = neg(dividend((Fs,out * 2^23) / Fs,in))
805 * phiIncr:ulOther = dividend:remainder((Fs,in * 2^26) / Fs,out)
806 * correctionPerGOF:correctionPerSec =
807 * dividend:remainder(ulOther / GOF_PER_SEC)
808 * initialDelay = dividend(((24 * Fs,in) + Fs,out - 1) / Fs,out)
809 */
810 tmp1 = rate << 16;
811 coeffIncr = tmp1 / 48000;
812 tmp1 -= coeffIncr * 48000;
813 tmp1 <<= 7;
814 coeffIncr <<= 7;
815 coeffIncr += tmp1 / 48000;
816 coeffIncr ^= 0xFFFFFFFF;
817 coeffIncr++;
818 tmp1 = 48000 << 16;
819 phiIncr = tmp1 / rate;
820 tmp1 -= phiIncr * rate;
821 tmp1 <<= 10;
822 phiIncr <<= 10;
823 tmp2 = tmp1 / rate;
824 phiIncr += tmp2;
825 tmp1 -= tmp2 * rate;
826 correctionPerGOF = tmp1 / GOF_PER_SEC;
827 tmp1 -= correctionPerGOF * GOF_PER_SEC;
828 correctionPerSec = tmp1;
829 initialDelay = ((48000 * 24) + rate - 1) / rate;
830
831 /*
832 * Fill in the VariDecimate control block.
833 */
834 spin_lock_irqsave(&card->lock, flags);
835 cs461x_poke(card, BA1_CSRC,
836 ((correctionPerSec << 16) & 0xFFFF0000) | (correctionPerGOF & 0xFFFF));
837 cs461x_poke(card, BA1_CCI, coeffIncr);
838 cs461x_poke(card, BA1_CD,
839 (((BA1_VARIDEC_BUF_1 + (initialDelay << 2)) << 16) & 0xFFFF0000) | 0x80);
840 cs461x_poke(card, BA1_CPI, phiIncr);
841 spin_unlock_irqrestore(&card->lock, flags);
842
843 /*
844 * Figure out the frame group length for the write back task. Basically,
845 * this is just the factors of 24000 (2^6*3*5^3) that are not present in
846 * the output sample rate.
847 */
848 frameGroupLength = 1;
849 for (cnt = 2; cnt <= 64; cnt *= 2) {
850 if (((rate / cnt) * cnt) != rate)
851 frameGroupLength *= 2;
852 }
853 if (((rate / 3) * 3) != rate) {
854 frameGroupLength *= 3;
855 }
856 for (cnt = 5; cnt <= 125; cnt *= 5) {
857 if (((rate / cnt) * cnt) != rate)
858 frameGroupLength *= 5;
859 }
860
861 /*
862 * Fill in the WriteBack control block.
863 */
864 spin_lock_irqsave(&card->lock, flags);
865 cs461x_poke(card, BA1_CFG1, frameGroupLength);
866 cs461x_poke(card, BA1_CFG2, (0x00800000 | frameGroupLength));
867 cs461x_poke(card, BA1_CCST, 0x0000FFFF);
868 cs461x_poke(card, BA1_CSPB, ((65536 * rate) / 24000));
869 cs461x_poke(card, (BA1_CSPB + 4), 0x0000FFFF);
870 spin_unlock_irqrestore(&card->lock, flags);
871 dmabuf->rate = rate;
872 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_set_adc_rate()- %d\n",rate) );
873 return rate;
874}
875
876/* prepare channel attributes for playback */
877static void cs_play_setup(struct cs_state *state)
878{
879 struct dmabuf *dmabuf = &state->dmabuf;
880 struct cs_card *card = state->card;
881 unsigned int tmp, Count, playFormat;
882
883 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_play_setup()+\n") );
884 cs461x_poke(card, BA1_PVOL, 0x80008000);
885 if (!dmabuf->SGok)
886 cs461x_poke(card, BA1_PBA, virt_to_bus(dmabuf->pbuf));
887
888 Count = 4;
889 playFormat=cs461x_peek(card, BA1_PFIE);
890 if ((dmabuf->fmt & CS_FMT_STEREO)) {
891 playFormat &= ~DMA_RQ_C2_AC_MONO_TO_STEREO;
892 Count *= 2;
893 } else
894 playFormat |= DMA_RQ_C2_AC_MONO_TO_STEREO;
895
896 if ((dmabuf->fmt & CS_FMT_16BIT)) {
897 playFormat &= ~(DMA_RQ_C2_AC_8_TO_16_BIT
898 | DMA_RQ_C2_AC_SIGNED_CONVERT);
899 Count *= 2;
900 } else
901 playFormat |= (DMA_RQ_C2_AC_8_TO_16_BIT
902 | DMA_RQ_C2_AC_SIGNED_CONVERT);
903
904 cs461x_poke(card, BA1_PFIE, playFormat);
905
906 tmp = cs461x_peek(card, BA1_PDTC);
907 tmp &= 0xfffffe00;
908 cs461x_poke(card, BA1_PDTC, tmp | --Count);
909
910 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_play_setup()-\n") );
911}
912
913static struct InitStruct
914{
915 u32 off;
916 u32 val;
917} InitArray[] = { {0x00000040, 0x3fc0000f},
918 {0x0000004c, 0x04800000},
919
920 {0x000000b3, 0x00000780},
921 {0x000000b7, 0x00000000},
922 {0x000000bc, 0x07800000},
923
924 {0x000000cd, 0x00800000},
925 };
926
927/*
928 * "SetCaptureSPValues()" -- Initialize record task values before each
929 * capture startup.
930 */
931static void SetCaptureSPValues(struct cs_card *card)
932{
933 unsigned i, offset;
934 CS_DBGOUT(CS_FUNCTION, 8, printk("cs46xx: SetCaptureSPValues()+\n") );
935 for (i = 0; i < sizeof(InitArray) / sizeof(struct InitStruct); i++) {
936 offset = InitArray[i].off*4; /* 8bit to 32bit offset value */
937 cs461x_poke(card, offset, InitArray[i].val );
938 }
939 CS_DBGOUT(CS_FUNCTION, 8, printk("cs46xx: SetCaptureSPValues()-\n") );
940}
941
942/* prepare channel attributes for recording */
943static void cs_rec_setup(struct cs_state *state)
944{
945 struct cs_card *card = state->card;
946 struct dmabuf *dmabuf = &state->dmabuf;
947
948 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_rec_setup()+\n"));
949 SetCaptureSPValues(card);
950
951 /*
952 * set the attenuation to 0dB
953 */
954 cs461x_poke(card, BA1_CVOL, 0x80008000);
955
956 /*
957 * set the physical address of the capture buffer into the SP
958 */
959 cs461x_poke(card, BA1_CBA, virt_to_bus(dmabuf->rawbuf));
960
961 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_rec_setup()-\n") );
962}
963
964
965/* get current playback/recording dma buffer pointer (byte offset from LBA),
966 called with spinlock held! */
967
968static inline unsigned cs_get_dma_addr(struct cs_state *state)
969{
970 struct dmabuf *dmabuf = &state->dmabuf;
971 u32 offset;
972
973 if ( (!(dmabuf->enable & DAC_RUNNING)) &&
974 (!(dmabuf->enable & ADC_RUNNING) ) )
975 {
976 CS_DBGOUT(CS_ERROR, 2, printk(
977 "cs46xx: ERROR cs_get_dma_addr(): not enabled \n") );
978 return 0;
979 }
980
981 /*
982 * granularity is byte boundary, good part.
983 */
984 if (dmabuf->enable & DAC_RUNNING)
985 offset = cs461x_peek(state->card, BA1_PBA);
986 else /* ADC_RUNNING must be set */
987 offset = cs461x_peek(state->card, BA1_CBA);
988
989 CS_DBGOUT(CS_PARMS | CS_FUNCTION, 9,
990 printk("cs46xx: cs_get_dma_addr() %d\n",offset) );
991 offset = (u32)bus_to_virt((unsigned long)offset) - (u32)dmabuf->rawbuf;
992 CS_DBGOUT(CS_PARMS | CS_FUNCTION, 8,
993 printk("cs46xx: cs_get_dma_addr()- %d\n",offset) );
994 return offset;
995}
996
997static void resync_dma_ptrs(struct cs_state *state)
998{
999 struct dmabuf *dmabuf;
1000
1001 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: resync_dma_ptrs()+ \n") );
1002 if (state) {
1003 dmabuf = &state->dmabuf;
1004 dmabuf->hwptr=dmabuf->swptr = 0;
1005 dmabuf->pringbuf = 0;
1006 }
1007 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: resync_dma_ptrs()- \n") );
1008}
1009
1010/* Stop recording (lock held) */
1011static inline void __stop_adc(struct cs_state *state)
1012{
1013 struct dmabuf *dmabuf = &state->dmabuf;
1014 struct cs_card *card = state->card;
1015 unsigned int tmp;
1016
1017 dmabuf->enable &= ~ADC_RUNNING;
1018
1019 tmp = cs461x_peek(card, BA1_CCTL);
1020 tmp &= 0xFFFF0000;
1021 cs461x_poke(card, BA1_CCTL, tmp );
1022}
1023
1024static void stop_adc(struct cs_state *state)
1025{
1026 unsigned long flags;
1027
1028 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: stop_adc()+ \n") );
1029 spin_lock_irqsave(&state->card->lock, flags);
1030 __stop_adc(state);
1031 spin_unlock_irqrestore(&state->card->lock, flags);
1032 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: stop_adc()- \n") );
1033}
1034
1035static void start_adc(struct cs_state *state)
1036{
1037 struct dmabuf *dmabuf = &state->dmabuf;
1038 struct cs_card *card = state->card;
1039 unsigned long flags;
1040 unsigned int tmp;
1041
1042 spin_lock_irqsave(&card->lock, flags);
1043 if (!(dmabuf->enable & ADC_RUNNING) &&
1044 ((dmabuf->mapped || dmabuf->count < (signed)dmabuf->dmasize)
1045 && dmabuf->ready) &&
1046 ((card->pm.flags & CS46XX_PM_IDLE) ||
1047 (card->pm.flags & CS46XX_PM_RESUMED)) )
1048 {
1049 dmabuf->enable |= ADC_RUNNING;
1050 cs_set_divisor(dmabuf);
1051 tmp = cs461x_peek(card, BA1_CCTL);
1052 tmp &= 0xFFFF0000;
1053 tmp |= card->cctl;
1054 CS_DBGOUT(CS_FUNCTION, 2, printk(
1055 "cs46xx: start_adc() poke 0x%x \n",tmp) );
1056 cs461x_poke(card, BA1_CCTL, tmp);
1057 }
1058 spin_unlock_irqrestore(&card->lock, flags);
1059}
1060
1061/* stop playback (lock held) */
1062static inline void __stop_dac(struct cs_state *state)
1063{
1064 struct dmabuf *dmabuf = &state->dmabuf;
1065 struct cs_card *card = state->card;
1066 unsigned int tmp;
1067
1068 dmabuf->enable &= ~DAC_RUNNING;
1069
1070 tmp=cs461x_peek(card, BA1_PCTL);
1071 tmp&=0xFFFF;
1072 cs461x_poke(card, BA1_PCTL, tmp);
1073}
1074
1075static void stop_dac(struct cs_state *state)
1076{
1077 unsigned long flags;
1078
1079 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: stop_dac()+ \n") );
1080 spin_lock_irqsave(&state->card->lock, flags);
1081 __stop_dac(state);
1082 spin_unlock_irqrestore(&state->card->lock, flags);
1083 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: stop_dac()- \n") );
1084}
1085
1086static void start_dac(struct cs_state *state)
1087{
1088 struct dmabuf *dmabuf = &state->dmabuf;
1089 struct cs_card *card = state->card;
1090 unsigned long flags;
1091 int tmp;
1092
1093 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: start_dac()+ \n") );
1094 spin_lock_irqsave(&card->lock, flags);
1095 if (!(dmabuf->enable & DAC_RUNNING) &&
1096 ((dmabuf->mapped || dmabuf->count > 0) && dmabuf->ready) &&
1097 ((card->pm.flags & CS46XX_PM_IDLE) ||
1098 (card->pm.flags & CS46XX_PM_RESUMED)) )
1099 {
1100 dmabuf->enable |= DAC_RUNNING;
1101 tmp = cs461x_peek(card, BA1_PCTL);
1102 tmp &= 0xFFFF;
1103 tmp |= card->pctl;
1104 CS_DBGOUT(CS_PARMS, 6, printk(
1105 "cs46xx: start_dac() poke card=%p tmp=0x%.08x addr=%p \n",
1106 card, (unsigned)tmp,
1107 card->ba1.idx[(BA1_PCTL >> 16) & 3]+(BA1_PCTL&0xffff) ) );
1108 cs461x_poke(card, BA1_PCTL, tmp);
1109 }
1110 spin_unlock_irqrestore(&card->lock, flags);
1111 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: start_dac()- \n") );
1112}
1113
1114#define DMABUF_MINORDER 1
1115
1116/*
1117 * allocate DMA buffer, playback and recording buffers are separate.
1118 */
1119static int alloc_dmabuf(struct cs_state *state)
1120{
1121
1122 struct cs_card *card=state->card;
1123 struct dmabuf *dmabuf = &state->dmabuf;
1124 void *rawbuf = NULL;
1125 void *tmpbuff = NULL;
1126 int order;
1127 struct page *map, *mapend;
1128 unsigned long df;
1129
1130 dmabuf->ready = dmabuf->mapped = 0;
1131 dmabuf->SGok = 0;
1132/*
1133* check for order within limits, but do not overwrite value.
1134*/
1135 if ((defaultorder > 1) && (defaultorder < 12))
1136 df = defaultorder;
1137 else
1138 df = 2;
1139
1140 for (order = df; order >= DMABUF_MINORDER; order--)
1141 if ((rawbuf = (void *)pci_alloc_consistent(
1142 card->pci_dev, PAGE_SIZE << order, &dmabuf->dmaaddr)))
1143 break;
1144 if (!rawbuf) {
1145 CS_DBGOUT(CS_ERROR, 1, printk(KERN_ERR
1146 "cs46xx: alloc_dmabuf(): unable to allocate rawbuf\n"));
1147 return -ENOMEM;
1148 }
1149 dmabuf->buforder = order;
1150 dmabuf->rawbuf = rawbuf;
1151 // Now mark the pages as reserved; otherwise the
1152 // remap_pfn_range() in cs46xx_mmap doesn't work.
1153 // 1. get index to last page in mem_map array for rawbuf.
1154 mapend = virt_to_page(dmabuf->rawbuf +
1155 (PAGE_SIZE << dmabuf->buforder) - 1);
1156
1157 // 2. mark each physical page in range as 'reserved'.
1158 for (map = virt_to_page(dmabuf->rawbuf); map <= mapend; map++)
1159 cs4x_mem_map_reserve(map);
1160
1161 CS_DBGOUT(CS_PARMS, 9, printk("cs46xx: alloc_dmabuf(): allocated %ld (order = %d) bytes at %p\n",
1162 PAGE_SIZE << order, order, rawbuf) );
1163
1164/*
1165* only allocate the conversion buffer for the ADC
1166*/
1167 if (dmabuf->type == CS_TYPE_DAC) {
1168 dmabuf->tmpbuff = NULL;
1169 dmabuf->buforder_tmpbuff = 0;
1170 return 0;
1171 }
1172/*
1173 * now the temp buffer for 16/8 conversions
1174 */
1175
1176 tmpbuff = (void *) pci_alloc_consistent(
1177 card->pci_dev, PAGE_SIZE << order, &dmabuf->dmaaddr_tmpbuff);
1178
1179 if (!tmpbuff)
1180 return -ENOMEM;
1181 CS_DBGOUT(CS_PARMS, 9, printk("cs46xx: allocated %ld (order = %d) bytes at %p\n",
1182 PAGE_SIZE << order, order, tmpbuff) );
1183
1184 dmabuf->tmpbuff = tmpbuff;
1185 dmabuf->buforder_tmpbuff = order;
1186
1187 // Now mark the pages as reserved; otherwise the
1188 // remap_pfn_range() in cs46xx_mmap doesn't work.
1189 // 1. get index to last page in mem_map array for rawbuf.
1190 mapend = virt_to_page(dmabuf->tmpbuff +
1191 (PAGE_SIZE << dmabuf->buforder_tmpbuff) - 1);
1192
1193 // 2. mark each physical page in range as 'reserved'.
1194 for (map = virt_to_page(dmabuf->tmpbuff); map <= mapend; map++)
1195 cs4x_mem_map_reserve(map);
1196 return 0;
1197}
1198
1199/* free DMA buffer */
1200static void dealloc_dmabuf(struct cs_state *state)
1201{
1202 struct dmabuf *dmabuf = &state->dmabuf;
1203 struct page *map, *mapend;
1204
1205 if (dmabuf->rawbuf) {
1206 // Undo prog_dmabuf()'s marking the pages as reserved
1207 mapend = virt_to_page(dmabuf->rawbuf +
1208 (PAGE_SIZE << dmabuf->buforder) - 1);
1209 for (map = virt_to_page(dmabuf->rawbuf); map <= mapend; map++)
1210 cs4x_mem_map_unreserve(map);
1211 free_dmabuf(state->card, dmabuf);
1212 }
1213
1214 if (dmabuf->tmpbuff) {
1215 // Undo prog_dmabuf()'s marking the pages as reserved
1216 mapend = virt_to_page(dmabuf->tmpbuff +
1217 (PAGE_SIZE << dmabuf->buforder_tmpbuff) - 1);
1218 for (map = virt_to_page(dmabuf->tmpbuff); map <= mapend; map++)
1219 cs4x_mem_map_unreserve(map);
1220 free_dmabuf2(state->card, dmabuf);
1221 }
1222
1223 dmabuf->rawbuf = NULL;
1224 dmabuf->tmpbuff = NULL;
1225 dmabuf->mapped = dmabuf->ready = 0;
1226 dmabuf->SGok = 0;
1227}
1228
1229static int __prog_dmabuf(struct cs_state *state)
1230{
1231 struct dmabuf *dmabuf = &state->dmabuf;
1232 unsigned long flags;
1233 unsigned long allocated_pages, allocated_bytes;
1234 unsigned long tmp1, tmp2, fmt=0;
1235 unsigned long *ptmp = (unsigned long *) dmabuf->pbuf;
1236 unsigned long SGarray[9], nSGpages=0;
1237 int ret;
1238
1239 CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: prog_dmabuf()+ \n"));
1240/*
1241 * check for CAPTURE and use only non-sg for initial release
1242 */
1243 if (dmabuf->type == CS_TYPE_ADC) {
1244 CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: prog_dmabuf() ADC\n"));
1245 /*
1246 * add in non-sg support for capture.
1247 */
1248 spin_lock_irqsave(&state->card->lock, flags);
1249 /* add code to reset the rawbuf memory. TRW */
1250 resync_dma_ptrs(state);
1251 dmabuf->total_bytes = dmabuf->blocks = 0;
1252 dmabuf->count = dmabuf->error = dmabuf->underrun = 0;
1253
1254 dmabuf->SGok = 0;
1255
1256 spin_unlock_irqrestore(&state->card->lock, flags);
1257
1258 /* allocate DMA buffer if not allocated yet */
1259 if (!dmabuf->rawbuf || !dmabuf->tmpbuff)
1260 if ((ret = alloc_dmabuf(state)))
1261 return ret;
1262 /*
1263 * static image only supports 16Bit signed, stereo - hard code fmt
1264 */
1265 fmt = CS_FMT_16BIT | CS_FMT_STEREO;
1266
1267 dmabuf->numfrag = 2;
1268 dmabuf->fragsize = 2048;
1269 dmabuf->fragsamples = 2048 >> sample_shift[fmt];
1270 dmabuf->dmasize = 4096;
1271 dmabuf->fragshift = 11;
1272
1273 memset(dmabuf->rawbuf, (fmt & CS_FMT_16BIT) ? 0 : 0x80,
1274 dmabuf->dmasize);
1275 memset(dmabuf->tmpbuff, (fmt & CS_FMT_16BIT) ? 0 : 0x80,
1276 PAGE_SIZE<<dmabuf->buforder_tmpbuff);
1277
1278 /*
1279 * Now set up the ring
1280 */
1281
1282 spin_lock_irqsave(&state->card->lock, flags);
1283 cs_rec_setup(state);
1284 spin_unlock_irqrestore(&state->card->lock, flags);
1285
1286 /* set the ready flag for the dma buffer */
1287 dmabuf->ready = 1;
1288
1289 CS_DBGOUT(CS_PARMS, 4, printk(
1290 "cs46xx: prog_dmabuf(): CAPTURE rate=%d fmt=0x%x numfrag=%d "
1291 "fragsize=%d dmasize=%d\n",
1292 dmabuf->rate, dmabuf->fmt, dmabuf->numfrag,
1293 dmabuf->fragsize, dmabuf->dmasize) );
1294
1295 CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: prog_dmabuf()- 0 \n"));
1296 return 0;
1297 } else if (dmabuf->type == CS_TYPE_DAC) {
1298 /*
1299 * Must be DAC
1300 */
1301 CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: prog_dmabuf() DAC\n"));
1302 spin_lock_irqsave(&state->card->lock, flags);
1303 resync_dma_ptrs(state);
1304 dmabuf->total_bytes = dmabuf->blocks = 0;
1305 dmabuf->count = dmabuf->error = dmabuf->underrun = 0;
1306
1307 dmabuf->SGok = 0;
1308
1309 spin_unlock_irqrestore(&state->card->lock, flags);
1310
1311 /* allocate DMA buffer if not allocated yet */
1312 if (!dmabuf->rawbuf)
1313 if ((ret = alloc_dmabuf(state)))
1314 return ret;
1315
1316 allocated_pages = 1 << dmabuf->buforder;
1317 allocated_bytes = allocated_pages*PAGE_SIZE;
1318
1319 if (allocated_pages < 2) {
1320 CS_DBGOUT(CS_FUNCTION, 4, printk(
1321 "cs46xx: prog_dmabuf() Error: allocated_pages too small (%d)\n",
1322 (unsigned)allocated_pages));
1323 return -ENOMEM;
1324 }
1325
1326 /* Use all the pages allocated, fragsize 4k. */
1327 /* Use 'pbuf' for S/G page map table. */
1328 dmabuf->SGok = 1; /* Use S/G. */
1329
1330 nSGpages = allocated_bytes/4096; /* S/G pages always 4k. */
1331
1332 /* Set up S/G variables. */
1333 *ptmp = virt_to_bus(dmabuf->rawbuf);
1334 *(ptmp + 1) = 0x00000008;
1335 for (tmp1 = 1; tmp1 < nSGpages; tmp1++) {
1336 *(ptmp + 2 * tmp1) = virt_to_bus((dmabuf->rawbuf) + 4096 * tmp1);
1337 if (tmp1 == nSGpages - 1)
1338 tmp2 = 0xbfff0000;
1339 else
1340 tmp2 = 0x80000000 + 8 * (tmp1 + 1);
1341 *(ptmp + 2 * tmp1 + 1) = tmp2;
1342 }
1343 SGarray[0] = 0x82c0200d;
1344 SGarray[1] = 0xffff0000;
1345 SGarray[2] = *ptmp;
1346 SGarray[3] = 0x00010600;
1347 SGarray[4] = *(ptmp+2);
1348 SGarray[5] = 0x80000010;
1349 SGarray[6] = *ptmp;
1350 SGarray[7] = *(ptmp+2);
1351 SGarray[8] = (virt_to_bus(dmabuf->pbuf) & 0xffff000) | 0x10;
1352
1353 if (dmabuf->SGok) {
1354 dmabuf->numfrag = nSGpages;
1355 dmabuf->fragsize = 4096;
1356 dmabuf->fragsamples = 4096 >> sample_shift[dmabuf->fmt];
1357 dmabuf->fragshift = 12;
1358 dmabuf->dmasize = dmabuf->numfrag * 4096;
1359 } else {
1360 SGarray[0] = 0xf2c0000f;
1361 SGarray[1] = 0x00000200;
1362 SGarray[2] = 0;
1363 SGarray[3] = 0x00010600;
1364 SGarray[4]=SGarray[5]=SGarray[6]=SGarray[7]=SGarray[8] = 0;
1365 dmabuf->numfrag = 2;
1366 dmabuf->fragsize = 2048;
1367 dmabuf->fragsamples = 2048 >> sample_shift[dmabuf->fmt];
1368 dmabuf->dmasize = 4096;
1369 dmabuf->fragshift = 11;
1370 }
1371 for (tmp1 = 0; tmp1 < sizeof(SGarray) / 4; tmp1++)
1372 cs461x_poke(state->card, BA1_PDTC+tmp1 * 4, SGarray[tmp1]);
1373
1374 memset(dmabuf->rawbuf, (dmabuf->fmt & CS_FMT_16BIT) ? 0 : 0x80,
1375 dmabuf->dmasize);
1376
1377 /*
1378 * Now set up the ring
1379 */
1380
1381 spin_lock_irqsave(&state->card->lock, flags);
1382 cs_play_setup(state);
1383 spin_unlock_irqrestore(&state->card->lock, flags);
1384
1385 /* set the ready flag for the dma buffer */
1386 dmabuf->ready = 1;
1387
1388 CS_DBGOUT(CS_PARMS, 4, printk(
1389 "cs46xx: prog_dmabuf(): PLAYBACK rate=%d fmt=0x%x numfrag=%d "
1390 "fragsize=%d dmasize=%d\n",
1391 dmabuf->rate, dmabuf->fmt, dmabuf->numfrag,
1392 dmabuf->fragsize, dmabuf->dmasize) );
1393
1394 CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: prog_dmabuf()- \n"));
1395 return 0;
1396 } else {
1397 CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: prog_dmabuf()- Invalid Type %d\n",
1398 dmabuf->type));
1399 }
1400 return 1;
1401}
1402
1403static int prog_dmabuf(struct cs_state *state)
1404{
1405 int ret;
1406
1407 mutex_lock(&state->sem);
1408 ret = __prog_dmabuf(state);
1409 mutex_unlock(&state->sem);
1410
1411 return ret;
1412}
1413
1414static void cs_clear_tail(struct cs_state *state)
1415{
1416}
1417
1418static int drain_dac(struct cs_state *state, int nonblock)
1419{
1420 DECLARE_WAITQUEUE(wait, current);
1421 struct dmabuf *dmabuf = &state->dmabuf;
1422 struct cs_card *card=state->card;
1423 unsigned long flags;
1424 unsigned long tmo;
1425 int count;
1426
1427 CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: drain_dac()+ \n"));
1428 if (dmabuf->mapped || !dmabuf->ready)
1429 {
1430 CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: drain_dac()- 0, not ready\n"));
1431 return 0;
1432 }
1433
1434 add_wait_queue(&dmabuf->wait, &wait);
1435 for (;;) {
1436 /* It seems that we have to set the current state to TASK_INTERRUPTIBLE
1437 every time to make the process really go to sleep */
1438 current->state = TASK_INTERRUPTIBLE;
1439
1440 spin_lock_irqsave(&state->card->lock, flags);
1441 count = dmabuf->count;
1442 spin_unlock_irqrestore(&state->card->lock, flags);
1443
1444 if (count <= 0)
1445 break;
1446
1447 if (signal_pending(current))
1448 break;
1449
1450 if (nonblock) {
1451 remove_wait_queue(&dmabuf->wait, &wait);
1452 current->state = TASK_RUNNING;
1453 return -EBUSY;
1454 }
1455
1456 tmo = (dmabuf->dmasize * HZ) / dmabuf->rate;
1457 tmo >>= sample_shift[dmabuf->fmt];
1458 tmo += (2048*HZ)/dmabuf->rate;
1459
1460 if (!schedule_timeout(tmo ? tmo : 1) && tmo){
1461 printk(KERN_ERR "cs46xx: drain_dac, dma timeout? %d\n", count);
1462 break;
1463 }
1464 }
1465 remove_wait_queue(&dmabuf->wait, &wait);
1466 current->state = TASK_RUNNING;
1467 if (signal_pending(current)) {
1468 CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: drain_dac()- -ERESTARTSYS\n"));
1469 /*
1470 * set to silence and let that clear the fifos.
1471 */
1472 cs461x_clear_serial_FIFOs(card, CS_TYPE_DAC);
1473 return -ERESTARTSYS;
1474 }
1475
1476 CS_DBGOUT(CS_FUNCTION, 4, printk("cs46xx: drain_dac()- 0\n"));
1477 return 0;
1478}
1479
1480
1481/* update buffer manangement pointers, especially, dmabuf->count and dmabuf->hwptr */
1482static void cs_update_ptr(struct cs_card *card, int wake)
1483{
1484 struct cs_state *state;
1485 struct dmabuf *dmabuf;
1486 unsigned hwptr;
1487 int diff;
1488
1489 /* error handling and process wake up for ADC */
1490 state = card->states[0];
1491 if (state) {
1492 dmabuf = &state->dmabuf;
1493 if (dmabuf->enable & ADC_RUNNING) {
1494 /* update hardware pointer */
1495 hwptr = cs_get_dma_addr(state);
1496
1497 diff = (dmabuf->dmasize + hwptr - dmabuf->hwptr) % dmabuf->dmasize;
1498 CS_DBGOUT(CS_PARMS, 9, printk(
1499 "cs46xx: cs_update_ptr()+ ADC hwptr=%d diff=%d\n",
1500 hwptr,diff) );
1501 dmabuf->hwptr = hwptr;
1502 dmabuf->total_bytes += diff;
1503 dmabuf->count += diff;
1504 if (dmabuf->count > dmabuf->dmasize)
1505 dmabuf->count = dmabuf->dmasize;
1506
1507 if (dmabuf->mapped) {
1508 if (wake && dmabuf->count >= (signed)dmabuf->fragsize)
1509 wake_up(&dmabuf->wait);
1510 } else {
1511 if (wake && dmabuf->count > 0)
1512 wake_up(&dmabuf->wait);
1513 }
1514 }
1515 }
1516
1517/*
1518 * Now the DAC
1519 */
1520 state = card->states[1];
1521 if (state) {
1522 dmabuf = &state->dmabuf;
1523 /* error handling and process wake up for DAC */
1524 if (dmabuf->enable & DAC_RUNNING) {
1525 /* update hardware pointer */
1526 hwptr = cs_get_dma_addr(state);
1527
1528 diff = (dmabuf->dmasize + hwptr - dmabuf->hwptr) % dmabuf->dmasize;
1529 CS_DBGOUT(CS_PARMS, 9, printk(
1530 "cs46xx: cs_update_ptr()+ DAC hwptr=%d diff=%d\n",
1531 hwptr,diff) );
1532 dmabuf->hwptr = hwptr;
1533 dmabuf->total_bytes += diff;
1534 if (dmabuf->mapped) {
1535 dmabuf->count += diff;
1536 if (wake && dmabuf->count >= (signed)dmabuf->fragsize)
1537 wake_up(&dmabuf->wait);
1538 /*
1539 * other drivers use fragsize, but don't see any sense
1540 * in that, since dmasize is the buffer asked for
1541 * via mmap.
1542 */
1543 if (dmabuf->count > dmabuf->dmasize)
1544 dmabuf->count &= dmabuf->dmasize-1;
1545 } else {
1546 dmabuf->count -= diff;
1547 /*
1548 * backfill with silence and clear out the last
1549 * "diff" number of bytes.
1550 */
1551 if (hwptr >= diff) {
1552 memset(dmabuf->rawbuf + hwptr - diff,
1553 (dmabuf->fmt & CS_FMT_16BIT) ? 0 : 0x80, diff);
1554 } else {
1555 memset(dmabuf->rawbuf,
1556 (dmabuf->fmt & CS_FMT_16BIT) ? 0 : 0x80,
1557 (unsigned)hwptr);
1558 memset((char *)dmabuf->rawbuf +
1559 dmabuf->dmasize + hwptr - diff,
1560 (dmabuf->fmt & CS_FMT_16BIT) ? 0 : 0x80,
1561 diff - hwptr);
1562 }
1563
1564 if (dmabuf->count < 0 || dmabuf->count > dmabuf->dmasize) {
1565 CS_DBGOUT(CS_ERROR, 2, printk(KERN_INFO
1566 "cs46xx: ERROR DAC count<0 or count > dmasize (%d)\n",
1567 dmabuf->count));
1568 /*
1569 * buffer underrun or buffer overrun, reset the
1570 * count of bytes written back to 0.
1571 */
1572 if (dmabuf->count < 0)
1573 dmabuf->underrun = 1;
1574 dmabuf->count = 0;
1575 dmabuf->error++;
1576 }
1577 if (wake && dmabuf->count < (signed)dmabuf->dmasize / 2)
1578 wake_up(&dmabuf->wait);
1579 }
1580 }
1581 }
1582}
1583
1584
1585/* hold spinlock for the following! */
1586static void cs_handle_midi(struct cs_card *card)
1587{
1588 unsigned char ch;
1589 int wake;
1590 unsigned temp1;
1591
1592 wake = 0;
1593 while (!(cs461x_peekBA0(card, BA0_MIDSR) & MIDSR_RBE)) {
1594 ch = cs461x_peekBA0(card, BA0_MIDRP);
1595 if (card->midi.icnt < CS_MIDIINBUF) {
1596 card->midi.ibuf[card->midi.iwr] = ch;
1597 card->midi.iwr = (card->midi.iwr + 1) % CS_MIDIINBUF;
1598 card->midi.icnt++;
1599 }
1600 wake = 1;
1601 }
1602 if (wake)
1603 wake_up(&card->midi.iwait);
1604 wake = 0;
1605 while (!(cs461x_peekBA0(card, BA0_MIDSR) & MIDSR_TBF) && card->midi.ocnt > 0) {
1606 temp1 = ( card->midi.obuf[card->midi.ord] ) & 0x000000ff;
1607 cs461x_pokeBA0(card, BA0_MIDWP,temp1);
1608 card->midi.ord = (card->midi.ord + 1) % CS_MIDIOUTBUF;
1609 card->midi.ocnt--;
1610 if (card->midi.ocnt < CS_MIDIOUTBUF-16)
1611 wake = 1;
1612 }
1613 if (wake)
1614 wake_up(&card->midi.owait);
1615}
1616
1617static irqreturn_t cs_interrupt(int irq, void *dev_id)
1618{
1619 struct cs_card *card = (struct cs_card *)dev_id;
1620 /* Single channel card */
1621 struct cs_state *recstate = card->channel[0].state;
1622 struct cs_state *playstate = card->channel[1].state;
1623 u32 status;
1624
1625 CS_DBGOUT(CS_INTERRUPT, 9, printk("cs46xx: cs_interrupt()+ \n"));
1626
1627 spin_lock(&card->lock);
1628
1629 status = cs461x_peekBA0(card, BA0_HISR);
1630
1631 if ((status & 0x7fffffff) == 0) {
1632 cs461x_pokeBA0(card, BA0_HICR, HICR_CHGM|HICR_IEV);
1633 spin_unlock(&card->lock);
1634 return IRQ_HANDLED; /* Might be IRQ_NONE.. */
1635 }
1636
1637 /*
1638 * check for playback or capture interrupt only
1639 */
1640 if (((status & HISR_VC0) && playstate && playstate->dmabuf.ready) ||
1641 (((status & HISR_VC1) && recstate && recstate->dmabuf.ready))) {
1642 CS_DBGOUT(CS_INTERRUPT, 8, printk(
1643 "cs46xx: cs_interrupt() interrupt bit(s) set (0x%x)\n",status));
1644 cs_update_ptr(card, CS_TRUE);
1645 }
1646
1647 if (status & HISR_MIDI)
1648 cs_handle_midi(card);
1649
1650 /* clear 'em */
1651 cs461x_pokeBA0(card, BA0_HICR, HICR_CHGM|HICR_IEV);
1652 spin_unlock(&card->lock);
1653 CS_DBGOUT(CS_INTERRUPT, 9, printk("cs46xx: cs_interrupt()- \n"));
1654 return IRQ_HANDLED;
1655}
1656
1657
1658/**********************************************************************/
1659
1660static ssize_t cs_midi_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
1661{
1662 struct cs_card *card = file->private_data;
1663 ssize_t ret;
1664 unsigned long flags;
1665 unsigned ptr;
1666 int cnt;
1667
1668 if (!access_ok(VERIFY_WRITE, buffer, count))
1669 return -EFAULT;
1670 ret = 0;
1671 while (count > 0) {
1672 spin_lock_irqsave(&card->lock, flags);
1673 ptr = card->midi.ird;
1674 cnt = CS_MIDIINBUF - ptr;
1675 if (card->midi.icnt < cnt)
1676 cnt = card->midi.icnt;
1677 spin_unlock_irqrestore(&card->lock, flags);
1678 if (cnt > count)
1679 cnt = count;
1680 if (cnt <= 0) {
1681 if (file->f_flags & O_NONBLOCK)
1682 return ret ? ret : -EAGAIN;
1683 interruptible_sleep_on(&card->midi.iwait);
1684 if (signal_pending(current))
1685 return ret ? ret : -ERESTARTSYS;
1686 continue;
1687 }
1688 if (copy_to_user(buffer, card->midi.ibuf + ptr, cnt))
1689 return ret ? ret : -EFAULT;
1690 ptr = (ptr + cnt) % CS_MIDIINBUF;
1691 spin_lock_irqsave(&card->lock, flags);
1692 card->midi.ird = ptr;
1693 card->midi.icnt -= cnt;
1694 spin_unlock_irqrestore(&card->lock, flags);
1695 count -= cnt;
1696 buffer += cnt;
1697 ret += cnt;
1698 }
1699 return ret;
1700}
1701
1702
1703static ssize_t cs_midi_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
1704{
1705 struct cs_card *card = file->private_data;
1706 ssize_t ret;
1707 unsigned long flags;
1708 unsigned ptr;
1709 int cnt;
1710
1711 if (!access_ok(VERIFY_READ, buffer, count))
1712 return -EFAULT;
1713 ret = 0;
1714 while (count > 0) {
1715 spin_lock_irqsave(&card->lock, flags);
1716 ptr = card->midi.owr;
1717 cnt = CS_MIDIOUTBUF - ptr;
1718 if (card->midi.ocnt + cnt > CS_MIDIOUTBUF)
1719 cnt = CS_MIDIOUTBUF - card->midi.ocnt;
1720 if (cnt <= 0)
1721 cs_handle_midi(card);
1722 spin_unlock_irqrestore(&card->lock, flags);
1723 if (cnt > count)
1724 cnt = count;
1725 if (cnt <= 0) {
1726 if (file->f_flags & O_NONBLOCK)
1727 return ret ? ret : -EAGAIN;
1728 interruptible_sleep_on(&card->midi.owait);
1729 if (signal_pending(current))
1730 return ret ? ret : -ERESTARTSYS;
1731 continue;
1732 }
1733 if (copy_from_user(card->midi.obuf + ptr, buffer, cnt))
1734 return ret ? ret : -EFAULT;
1735 ptr = (ptr + cnt) % CS_MIDIOUTBUF;
1736 spin_lock_irqsave(&card->lock, flags);
1737 card->midi.owr = ptr;
1738 card->midi.ocnt += cnt;
1739 spin_unlock_irqrestore(&card->lock, flags);
1740 count -= cnt;
1741 buffer += cnt;
1742 ret += cnt;
1743 spin_lock_irqsave(&card->lock, flags);
1744 cs_handle_midi(card);
1745 spin_unlock_irqrestore(&card->lock, flags);
1746 }
1747 return ret;
1748}
1749
1750
1751static unsigned int cs_midi_poll(struct file *file, struct poll_table_struct *wait)
1752{
1753 struct cs_card *card = file->private_data;
1754 unsigned long flags;
1755 unsigned int mask = 0;
1756
1757 if (file->f_flags & FMODE_WRITE)
1758 poll_wait(file, &card->midi.owait, wait);
1759 if (file->f_flags & FMODE_READ)
1760 poll_wait(file, &card->midi.iwait, wait);
1761 spin_lock_irqsave(&card->lock, flags);
1762 if (file->f_flags & FMODE_READ) {
1763 if (card->midi.icnt > 0)
1764 mask |= POLLIN | POLLRDNORM;
1765 }
1766 if (file->f_flags & FMODE_WRITE) {
1767 if (card->midi.ocnt < CS_MIDIOUTBUF)
1768 mask |= POLLOUT | POLLWRNORM;
1769 }
1770 spin_unlock_irqrestore(&card->lock, flags);
1771 return mask;
1772}
1773
1774
1775static int cs_midi_open(struct inode *inode, struct file *file)
1776{
1777 unsigned int minor = iminor(inode);
1778 struct cs_card *card = NULL;
1779 unsigned long flags;
1780 struct list_head *entry;
1781
1782 list_for_each(entry, &cs46xx_devs) {
1783 card = list_entry(entry, struct cs_card, list);
1784 if (card->dev_midi == minor)
1785 break;
1786 }
1787
1788 if (entry == &cs46xx_devs)
1789 return -ENODEV;
1790 if (!card) {
1791 CS_DBGOUT(CS_FUNCTION | CS_OPEN, 2, printk(KERN_INFO
1792 "cs46xx: cs46xx_midi_open(): Error - unable to find card struct\n"));
1793 return -ENODEV;
1794 }
1795
1796 file->private_data = card;
1797 /* wait for device to become free */
1798 mutex_lock(&card->midi.open_mutex);
1799 while (card->midi.open_mode & file->f_mode) {
1800 if (file->f_flags & O_NONBLOCK) {
1801 mutex_unlock(&card->midi.open_mutex);
1802 return -EBUSY;
1803 }
1804 mutex_unlock(&card->midi.open_mutex);
1805 interruptible_sleep_on(&card->midi.open_wait);
1806 if (signal_pending(current))
1807 return -ERESTARTSYS;
1808 mutex_lock(&card->midi.open_mutex);
1809 }
1810 spin_lock_irqsave(&card->midi.lock, flags);
1811 if (!(card->midi.open_mode & (FMODE_READ | FMODE_WRITE))) {
1812 card->midi.ird = card->midi.iwr = card->midi.icnt = 0;
1813 card->midi.ord = card->midi.owr = card->midi.ocnt = 0;
1814 card->midi.ird = card->midi.iwr = card->midi.icnt = 0;
1815 cs461x_pokeBA0(card, BA0_MIDCR, 0x0000000f); /* Enable xmit, rcv. */
1816 cs461x_pokeBA0(card, BA0_HICR, HICR_IEV | HICR_CHGM); /* Enable interrupts */
1817 }
1818 if (file->f_mode & FMODE_READ)
1819 card->midi.ird = card->midi.iwr = card->midi.icnt = 0;
1820 if (file->f_mode & FMODE_WRITE)
1821 card->midi.ord = card->midi.owr = card->midi.ocnt = 0;
1822 spin_unlock_irqrestore(&card->midi.lock, flags);
1823 card->midi.open_mode |= (file->f_mode & (FMODE_READ | FMODE_WRITE));
1824 mutex_unlock(&card->midi.open_mutex);
1825 return 0;
1826}
1827
1828
1829static int cs_midi_release(struct inode *inode, struct file *file)
1830{
1831 struct cs_card *card = file->private_data;
1832 DECLARE_WAITQUEUE(wait, current);
1833 unsigned long flags;
1834 unsigned count, tmo;
1835
1836 if (file->f_mode & FMODE_WRITE) {
1837 current->state = TASK_INTERRUPTIBLE;
1838 add_wait_queue(&card->midi.owait, &wait);
1839 for (;;) {
1840 spin_lock_irqsave(&card->midi.lock, flags);
1841 count = card->midi.ocnt;
1842 spin_unlock_irqrestore(&card->midi.lock, flags);
1843 if (count <= 0)
1844 break;
1845 if (signal_pending(current))
1846 break;
1847 if (file->f_flags & O_NONBLOCK)
1848 break;
1849 tmo = (count * HZ) / 3100;
1850 if (!schedule_timeout(tmo ? : 1) && tmo)
1851 printk(KERN_DEBUG "cs46xx: midi timed out??\n");
1852 }
1853 remove_wait_queue(&card->midi.owait, &wait);
1854 current->state = TASK_RUNNING;
1855 }
1856 mutex_lock(&card->midi.open_mutex);
1857 card->midi.open_mode &= (~(file->f_mode & (FMODE_READ | FMODE_WRITE)));
1858 mutex_unlock(&card->midi.open_mutex);
1859 wake_up(&card->midi.open_wait);
1860 return 0;
1861}
1862
1863/*
1864 * Midi file operations struct.
1865 */
1866static /*const*/ struct file_operations cs_midi_fops = {
1867 CS_OWNER CS_THIS_MODULE
1868 .llseek = no_llseek,
1869 .read = cs_midi_read,
1870 .write = cs_midi_write,
1871 .poll = cs_midi_poll,
1872 .open = cs_midi_open,
1873 .release = cs_midi_release,
1874};
1875
1876/*
1877 *
1878 * CopySamples copies 16-bit stereo signed samples from the source to the
1879 * destination, possibly converting down to unsigned 8-bit and/or mono.
1880 * count specifies the number of output bytes to write.
1881 *
1882 * Arguments:
1883 *
1884 * dst - Pointer to a destination buffer.
1885 * src - Pointer to a source buffer
1886 * count - The number of bytes to copy into the destination buffer.
1887 * fmt - CS_FMT_16BIT and/or CS_FMT_STEREO bits
1888 * dmabuf - pointer to the dma buffer structure
1889 *
1890 * NOTES: only call this routine if the output desired is not 16 Signed Stereo
1891 *
1892 *
1893 */
1894static void CopySamples(char *dst, char *src, int count, unsigned fmt,
1895 struct dmabuf *dmabuf)
1896{
1897 s32 s32AudioSample;
1898 s16 *psSrc = (s16 *)src;
1899 s16 *psDst = (s16 *)dst;
1900 u8 *pucDst = (u8 *)dst;
1901
1902 CS_DBGOUT(CS_FUNCTION, 2, printk(KERN_INFO "cs46xx: CopySamples()+ ") );
1903 CS_DBGOUT(CS_WAVE_READ, 8, printk(KERN_INFO
1904 " dst=%p src=%p count=%d fmt=0x%x\n",
1905 dst,src,count,fmt) );
1906
1907 /*
1908 * See if the data should be output as 8-bit unsigned stereo.
1909 */
1910 if ((fmt & CS_FMT_STEREO) && !(fmt & CS_FMT_16BIT)) {
1911 /*
1912 * Convert each 16-bit signed stereo sample to 8-bit unsigned
1913 * stereo using rounding.
1914 */
1915 psSrc = (s16 *)src;
1916 count = count / 2;
1917 while (count--)
1918 *(pucDst++) = (u8)(((s16)(*psSrc++) + (s16)0x8000) >> 8);
1919 }
1920 /*
1921 * See if the data should be output at 8-bit unsigned mono.
1922 */
1923 else if (!(fmt & CS_FMT_STEREO) && !(fmt & CS_FMT_16BIT)) {
1924 /*
1925 * Convert each 16-bit signed stereo sample to 8-bit unsigned
1926 * mono using averaging and rounding.
1927 */
1928 psSrc = (s16 *)src;
1929 count = count / 2;
1930 while (count--) {
1931 s32AudioSample = ((*psSrc) + (*(psSrc + 1))) / 2 + (s32)0x80;
1932 if (s32AudioSample > 0x7fff)
1933 s32AudioSample = 0x7fff;
1934 *(pucDst++) = (u8)(((s16)s32AudioSample + (s16)0x8000) >> 8);
1935 psSrc += 2;
1936 }
1937 }
1938 /*
1939 * See if the data should be output at 16-bit signed mono.
1940 */
1941 else if (!(fmt & CS_FMT_STEREO) && (fmt & CS_FMT_16BIT)) {
1942 /*
1943 * Convert each 16-bit signed stereo sample to 16-bit signed
1944 * mono using averaging.
1945 */
1946 psSrc = (s16 *)src;
1947 count = count / 2;
1948 while (count--) {
1949 *(psDst++) = (s16)((*psSrc) + (*(psSrc + 1))) / 2;
1950 psSrc += 2;
1951 }
1952 }
1953}
1954
1955/*
1956 * cs_copy_to_user()
1957 * replacement for the standard copy_to_user, to allow for a conversion from
1958 * 16 bit to 8 bit and from stereo to mono, if the record conversion is active.
1959 * The current CS46xx/CS4280 static image only records in 16bit unsigned Stereo,
1960 * so we convert from any of the other format combinations.
1961 */
1962static unsigned cs_copy_to_user(
1963 struct cs_state *s,
1964 void __user *dest,
1965 void *hwsrc,
1966 unsigned cnt,
1967 unsigned *copied)
1968{
1969 struct dmabuf *dmabuf = &s->dmabuf;
1970 void *src = hwsrc; /* default to the standard destination buffer addr */
1971
1972 CS_DBGOUT(CS_FUNCTION, 6, printk(KERN_INFO
1973 "cs_copy_to_user()+ fmt=0x%x cnt=%d dest=%p\n",
1974 dmabuf->fmt,(unsigned)cnt,dest) );
1975
1976 if (cnt > dmabuf->dmasize)
1977 cnt = dmabuf->dmasize;
1978 if (!cnt) {
1979 *copied = 0;
1980 return 0;
1981 }
1982 if (dmabuf->divisor != 1) {
1983 if (!dmabuf->tmpbuff) {
1984 *copied = cnt / dmabuf->divisor;
1985 return 0;
1986 }
1987
1988 CopySamples((char *)dmabuf->tmpbuff, (char *)hwsrc, cnt,
1989 dmabuf->fmt, dmabuf);
1990 src = dmabuf->tmpbuff;
1991 cnt = cnt/dmabuf->divisor;
1992 }
1993 if (copy_to_user(dest, src, cnt)) {
1994 CS_DBGOUT(CS_FUNCTION, 2, printk(KERN_ERR
1995 "cs46xx: cs_copy_to_user()- fault dest=%p src=%p cnt=%d\n",
1996 dest,src,cnt));
1997 *copied = 0;
1998 return -EFAULT;
1999 }
2000 *copied = cnt;
2001 CS_DBGOUT(CS_FUNCTION, 2, printk(KERN_INFO
2002 "cs46xx: cs_copy_to_user()- copied bytes is %d \n",cnt));
2003 return 0;
2004}
2005
2006/* in this loop, dmabuf.count signifies the amount of data that is waiting to be copied to
2007 the user's buffer. it is filled by the dma machine and drained by this loop. */
2008static ssize_t cs_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
2009{
2010 struct cs_card *card = file->private_data;
2011 struct cs_state *state;
2012 DECLARE_WAITQUEUE(wait, current);
2013 struct dmabuf *dmabuf;
2014 ssize_t ret = 0;
2015 unsigned long flags;
2016 unsigned swptr;
2017 int cnt;
2018 unsigned copied = 0;
2019
2020 CS_DBGOUT(CS_WAVE_READ | CS_FUNCTION, 4,
2021 printk("cs46xx: cs_read()+ %zd\n",count) );
2022 state = card->states[0];
2023 if (!state)
2024 return -ENODEV;
2025 dmabuf = &state->dmabuf;
2026
2027 if (dmabuf->mapped)
2028 return -ENXIO;
2029 if (!access_ok(VERIFY_WRITE, buffer, count))
2030 return -EFAULT;
2031
2032 mutex_lock(&state->sem);
2033 if (!dmabuf->ready && (ret = __prog_dmabuf(state)))
2034 goto out2;
2035
2036 add_wait_queue(&state->dmabuf.wait, &wait);
2037 while (count > 0) {
2038 while (!(card->pm.flags & CS46XX_PM_IDLE)) {
2039 schedule();
2040 if (signal_pending(current)) {
2041 if (!ret)
2042 ret = -ERESTARTSYS;
2043 goto out;
2044 }
2045 }
2046 spin_lock_irqsave(&state->card->lock, flags);
2047 swptr = dmabuf->swptr;
2048 cnt = dmabuf->dmasize - swptr;
2049 if (dmabuf->count < cnt)
2050 cnt = dmabuf->count;
2051 if (cnt <= 0)
2052 __set_current_state(TASK_INTERRUPTIBLE);
2053 spin_unlock_irqrestore(&state->card->lock, flags);
2054
2055 if (cnt > (count * dmabuf->divisor))
2056 cnt = count * dmabuf->divisor;
2057 if (cnt <= 0) {
2058 /* buffer is empty, start the dma machine and wait for data to be
2059 recorded */
2060 start_adc(state);
2061 if (file->f_flags & O_NONBLOCK) {
2062 if (!ret)
2063 ret = -EAGAIN;
2064 goto out;
2065 }
2066 mutex_unlock(&state->sem);
2067 schedule();
2068 if (signal_pending(current)) {
2069 if (!ret)
2070 ret = -ERESTARTSYS;
2071 goto out;
2072 }
2073 mutex_lock(&state->sem);
2074 if (dmabuf->mapped) {
2075 if (!ret)
2076 ret = -ENXIO;
2077 goto out;
2078 }
2079 continue;
2080 }
2081
2082 CS_DBGOUT(CS_WAVE_READ, 2, printk(KERN_INFO
2083 "_read() copy_to cnt=%d count=%zd ", cnt,count) );
2084 CS_DBGOUT(CS_WAVE_READ, 8, printk(KERN_INFO
2085 " .dmasize=%d .count=%d buffer=%p ret=%zd\n",
2086 dmabuf->dmasize,dmabuf->count,buffer,ret));
2087
2088 if (cs_copy_to_user(state, buffer,
2089 (char *)dmabuf->rawbuf + swptr, cnt, &copied)) {
2090 if (!ret)
2091 ret = -EFAULT;
2092 goto out;
2093 }
2094 swptr = (swptr + cnt) % dmabuf->dmasize;
2095 spin_lock_irqsave(&card->lock, flags);
2096 dmabuf->swptr = swptr;
2097 dmabuf->count -= cnt;
2098 spin_unlock_irqrestore(&card->lock, flags);
2099 count -= copied;
2100 buffer += copied;
2101 ret += copied;
2102 start_adc(state);
2103 }
2104out:
2105 remove_wait_queue(&state->dmabuf.wait, &wait);
2106out2:
2107 mutex_unlock(&state->sem);
2108 set_current_state(TASK_RUNNING);
2109 CS_DBGOUT(CS_WAVE_READ | CS_FUNCTION, 4,
2110 printk("cs46xx: cs_read()- %zd\n",ret) );
2111 return ret;
2112}
2113
2114/* in this loop, dmabuf.count signifies the amount of data that is waiting to be dma to
2115 the soundcard. it is drained by the dma machine and filled by this loop. */
2116static ssize_t cs_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
2117{
2118 struct cs_card *card = file->private_data;
2119 struct cs_state *state;
2120 DECLARE_WAITQUEUE(wait, current);
2121 struct dmabuf *dmabuf;
2122 ssize_t ret;
2123 unsigned long flags;
2124 unsigned swptr;
2125 int cnt;
2126
2127 CS_DBGOUT(CS_WAVE_WRITE | CS_FUNCTION, 4,
2128 printk("cs46xx: cs_write called, count = %zd\n", count) );
2129 state = card->states[1];
2130 if (!state)
2131 return -ENODEV;
2132 if (!access_ok(VERIFY_READ, buffer, count))
2133 return -EFAULT;
2134 dmabuf = &state->dmabuf;
2135
2136 mutex_lock(&state->sem);
2137 if (dmabuf->mapped) {
2138 ret = -ENXIO;
2139 goto out;
2140 }
2141
2142 if (!dmabuf->ready && (ret = __prog_dmabuf(state)))
2143 goto out;
2144 add_wait_queue(&state->dmabuf.wait, &wait);
2145 ret = 0;
2146/*
2147* Start the loop to read from the user's buffer and write to the dma buffer.
2148* check for PM events and underrun/overrun in the loop.
2149*/
2150 while (count > 0) {
2151 while (!(card->pm.flags & CS46XX_PM_IDLE)) {
2152 schedule();
2153 if (signal_pending(current)) {
2154 if (!ret)
2155 ret = -ERESTARTSYS;
2156 goto out;
2157 }
2158 }
2159 spin_lock_irqsave(&state->card->lock, flags);
2160 if (dmabuf->count < 0) {
2161 /* buffer underrun, we are recovering from sleep_on_timeout,
2162 resync hwptr and swptr */
2163 dmabuf->count = 0;
2164 dmabuf->swptr = dmabuf->hwptr;
2165 }
2166 if (dmabuf->underrun) {
2167 dmabuf->underrun = 0;
2168 dmabuf->hwptr = cs_get_dma_addr(state);
2169 dmabuf->swptr = dmabuf->hwptr;
2170 }
2171
2172 swptr = dmabuf->swptr;
2173 cnt = dmabuf->dmasize - swptr;
2174 if (dmabuf->count + cnt > dmabuf->dmasize)
2175 cnt = dmabuf->dmasize - dmabuf->count;
2176 if (cnt <= 0)
2177 __set_current_state(TASK_INTERRUPTIBLE);
2178 spin_unlock_irqrestore(&state->card->lock, flags);
2179
2180 if (cnt > count)
2181 cnt = count;
2182 if (cnt <= 0) {
2183 /* buffer is full, start the dma machine and wait for data to be
2184 played */
2185 start_dac(state);
2186 if (file->f_flags & O_NONBLOCK) {
2187 if (!ret)
2188 ret = -EAGAIN;
2189 goto out;
2190 }
2191 mutex_unlock(&state->sem);
2192 schedule();
2193 if (signal_pending(current)) {
2194 if (!ret)
2195 ret = -ERESTARTSYS;
2196 goto out;
2197 }
2198 mutex_lock(&state->sem);
2199 if (dmabuf->mapped) {
2200 if (!ret)
2201 ret = -ENXIO;
2202 goto out;
2203 }
2204 continue;
2205 }
2206 if (copy_from_user(dmabuf->rawbuf + swptr, buffer, cnt)) {
2207 if (!ret)
2208 ret = -EFAULT;
2209 goto out;
2210 }
2211 spin_lock_irqsave(&state->card->lock, flags);
2212 swptr = (swptr + cnt) % dmabuf->dmasize;
2213 dmabuf->swptr = swptr;
2214 dmabuf->count += cnt;
2215 if (dmabuf->count > dmabuf->dmasize) {
2216 CS_DBGOUT(CS_WAVE_WRITE | CS_ERROR, 2, printk(
2217 "cs46xx: cs_write() d->count > dmasize - resetting\n"));
2218 dmabuf->count = dmabuf->dmasize;
2219 }
2220 dmabuf->endcleared = 0;
2221 spin_unlock_irqrestore(&state->card->lock, flags);
2222
2223 count -= cnt;
2224 buffer += cnt;
2225 ret += cnt;
2226 start_dac(state);
2227 }
2228out:
2229 mutex_unlock(&state->sem);
2230 remove_wait_queue(&state->dmabuf.wait, &wait);
2231 set_current_state(TASK_RUNNING);
2232
2233 CS_DBGOUT(CS_WAVE_WRITE | CS_FUNCTION, 2,
2234 printk("cs46xx: cs_write()- ret=%zd\n", ret));
2235 return ret;
2236}
2237
2238static unsigned int cs_poll(struct file *file, struct poll_table_struct *wait)
2239{
2240 struct cs_card *card = file->private_data;
2241 struct dmabuf *dmabuf;
2242 struct cs_state *state;
2243 unsigned long flags;
2244 unsigned int mask = 0;
2245
2246 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_poll()+ \n"));
2247 if (!(file->f_mode & (FMODE_WRITE | FMODE_READ))) {
2248 return -EINVAL;
2249 }
2250 if (file->f_mode & FMODE_WRITE) {
2251 state = card->states[1];
2252 if (state) {
2253 dmabuf = &state->dmabuf;
2254 poll_wait(file, &dmabuf->wait, wait);
2255 }
2256 }
2257 if (file->f_mode & FMODE_READ) {
2258 state = card->states[0];
2259 if (state) {
2260 dmabuf = &state->dmabuf;
2261 poll_wait(file, &dmabuf->wait, wait);
2262 }
2263 }
2264
2265 spin_lock_irqsave(&card->lock, flags);
2266 cs_update_ptr(card, CS_FALSE);
2267 if (file->f_mode & FMODE_READ) {
2268 state = card->states[0];
2269 if (state) {
2270 dmabuf = &state->dmabuf;
2271 if (dmabuf->count >= (signed)dmabuf->fragsize)
2272 mask |= POLLIN | POLLRDNORM;
2273 }
2274 }
2275 if (file->f_mode & FMODE_WRITE) {
2276 state = card->states[1];
2277 if (state) {
2278 dmabuf = &state->dmabuf;
2279 if (dmabuf->mapped) {
2280 if (dmabuf->count >= (signed)dmabuf->fragsize)
2281 mask |= POLLOUT | POLLWRNORM;
2282 } else {
2283 if ((signed)dmabuf->dmasize >= dmabuf->count
2284 + (signed)dmabuf->fragsize)
2285 mask |= POLLOUT | POLLWRNORM;
2286 }
2287 }
2288 }
2289 spin_unlock_irqrestore(&card->lock, flags);
2290
2291 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_poll()- (0x%x) \n",
2292 mask));
2293 return mask;
2294}
2295
2296/*
2297 * We let users mmap the ring buffer. Its not the real DMA buffer but
2298 * that side of the code is hidden in the IRQ handling. We do a software
2299 * emulation of DMA from a 64K or so buffer into a 2K FIFO.
2300 * (the hardware probably deserves a moan here but Crystal send me nice
2301 * toys ;)).
2302 */
2303
2304static int cs_mmap(struct file *file, struct vm_area_struct *vma)
2305{
2306 struct cs_card *card = file->private_data;
2307 struct cs_state *state;
2308 struct dmabuf *dmabuf;
2309 int ret = 0;
2310 unsigned long size;
2311
2312 CS_DBGOUT(CS_FUNCTION | CS_PARMS, 2, printk("cs46xx: cs_mmap()+ file=%p %s %s\n",
2313 file, vma->vm_flags & VM_WRITE ? "VM_WRITE" : "",
2314 vma->vm_flags & VM_READ ? "VM_READ" : "") );
2315
2316 if (vma->vm_flags & VM_WRITE) {
2317 state = card->states[1];
2318 if (state) {
2319 CS_DBGOUT(CS_OPEN, 2, printk(
2320 "cs46xx: cs_mmap() VM_WRITE - state TRUE prog_dmabuf DAC\n") );
2321 if ((ret = prog_dmabuf(state)) != 0)
2322 return ret;
2323 }
2324 } else if (vma->vm_flags & VM_READ) {
2325 state = card->states[0];
2326 if (state) {
2327 CS_DBGOUT(CS_OPEN, 2, printk(
2328 "cs46xx: cs_mmap() VM_READ - state TRUE prog_dmabuf ADC\n") );
2329 if ((ret = prog_dmabuf(state)) != 0)
2330 return ret;
2331 }
2332 } else {
2333 CS_DBGOUT(CS_ERROR, 2, printk(
2334 "cs46xx: cs_mmap() return -EINVAL\n") );
2335 return -EINVAL;
2336 }
2337
2338/*
2339 * For now ONLY support playback, but seems like the only way to use
2340 * mmap() is to open an FD with RDWR, just read or just write access
2341 * does not function, get an error back from the kernel.
2342 * Also, QuakeIII opens with RDWR! So, there must be something
2343 * to needing read/write access mapping. So, allow read/write but
2344 * use the DAC only.
2345 */
2346 state = card->states[1];
2347 if (!state) {
2348 ret = -EINVAL;
2349 goto out;
2350 }
2351
2352 mutex_lock(&state->sem);
2353 dmabuf = &state->dmabuf;
2354 if (cs4x_pgoff(vma) != 0) {
2355 ret = -EINVAL;
2356 goto out;
2357 }
2358 size = vma->vm_end - vma->vm_start;
2359
2360 CS_DBGOUT(CS_PARMS, 2, printk("cs46xx: cs_mmap(): size=%d\n",(unsigned)size) );
2361
2362 if (size > (PAGE_SIZE << dmabuf->buforder)) {
2363 ret = -EINVAL;
2364 goto out;
2365 }
2366 if (remap_pfn_range(vma, vma->vm_start,
2367 virt_to_phys(dmabuf->rawbuf) >> PAGE_SHIFT,
2368 size, vma->vm_page_prot)) {
2369 ret = -EAGAIN;
2370 goto out;
2371 }
2372 dmabuf->mapped = 1;
2373
2374 CS_DBGOUT(CS_FUNCTION, 2, printk("cs46xx: cs_mmap()-\n") );
2375out:
2376 mutex_unlock(&state->sem);
2377 return ret;
2378}
2379
2380static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
2381{
2382 struct cs_card *card = file->private_data;
2383 struct cs_state *state;
2384 struct dmabuf *dmabuf = NULL;
2385 unsigned long flags;
2386 audio_buf_info abinfo;
2387 count_info cinfo;
2388 int val, valsave, ret;
2389 int mapped = 0;
2390 void __user *argp = (void __user *)arg;
2391 int __user *p = argp;
2392
2393 state = card->states[0];
2394 if (state) {
2395 dmabuf = &state->dmabuf;
2396 mapped = (file->f_mode & FMODE_READ) && dmabuf->mapped;
2397 }
2398 state = card->states[1];
2399 if (state) {
2400 dmabuf = &state->dmabuf;
2401 mapped |= (file->f_mode & FMODE_WRITE) && dmabuf->mapped;
2402 }
2403
2404#if CSDEBUG
2405 printioctl(cmd);
2406#endif
2407
2408 switch (cmd) {
2409 case OSS_GETVERSION:
2410 return put_user(SOUND_VERSION, p);
2411 case SNDCTL_DSP_RESET:
2412 /* FIXME: spin_lock ? */
2413 if (file->f_mode & FMODE_WRITE) {
2414 state = card->states[1];
2415 if (state) {
2416 dmabuf = &state->dmabuf;
2417 stop_dac(state);
2418 synchronize_irq(card->irq);
2419 dmabuf->ready = 0;
2420 resync_dma_ptrs(state);
2421 dmabuf->swptr = dmabuf->hwptr = 0;
2422 dmabuf->count = dmabuf->total_bytes = 0;
2423 dmabuf->blocks = 0;
2424 dmabuf->SGok = 0;
2425 }
2426 }
2427 if (file->f_mode & FMODE_READ) {
2428 state = card->states[0];
2429 if (state) {
2430 dmabuf = &state->dmabuf;
2431 stop_adc(state);
2432 synchronize_irq(card->irq);
2433 resync_dma_ptrs(state);
2434 dmabuf->ready = 0;
2435 dmabuf->swptr = dmabuf->hwptr = 0;
2436 dmabuf->count = dmabuf->total_bytes = 0;
2437 dmabuf->blocks = 0;
2438 dmabuf->SGok = 0;
2439 }
2440 }
2441 CS_DBGOUT(CS_IOCTL, 2, printk("cs46xx: DSP_RESET()-\n") );
2442 return 0;
2443 case SNDCTL_DSP_SYNC:
2444 if (file->f_mode & FMODE_WRITE)
2445 return drain_dac(state, file->f_flags & O_NONBLOCK);
2446 return 0;
2447 case SNDCTL_DSP_SPEED: /* set sample rate */
2448 if (get_user(val, p))
2449 return -EFAULT;
2450 if (val >= 0) {
2451 if (file->f_mode & FMODE_READ) {
2452 state = card->states[0];
2453 if (state) {
2454 dmabuf = &state->dmabuf;
2455 stop_adc(state);
2456 dmabuf->ready = 0;
2457 dmabuf->SGok = 0;
2458 cs_set_adc_rate(state, val);
2459 cs_set_divisor(dmabuf);
2460 }
2461 }
2462 if (file->f_mode & FMODE_WRITE) {
2463 state = card->states[1];
2464 if (state) {
2465 dmabuf = &state->dmabuf;
2466 stop_dac(state);
2467 dmabuf->ready = 0;
2468 dmabuf->SGok = 0;
2469 cs_set_dac_rate(state, val);
2470 cs_set_divisor(dmabuf);
2471 }
2472 }
2473 CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk(
2474 "cs46xx: cs_ioctl() DSP_SPEED %s %s %d\n",
2475 file->f_mode & FMODE_WRITE ? "DAC" : "",
2476 file->f_mode & FMODE_READ ? "ADC" : "",
2477 dmabuf->rate ) );
2478 return put_user(dmabuf->rate, p);
2479 }
2480 return put_user(0, p);
2481 case SNDCTL_DSP_STEREO: /* set stereo or mono channel */
2482 if (get_user(val, p))
2483 return -EFAULT;
2484 if (file->f_mode & FMODE_WRITE) {
2485 state = card->states[1];
2486 if (state) {
2487 dmabuf = &state->dmabuf;
2488 stop_dac(state);
2489 dmabuf->ready = 0;
2490 dmabuf->SGok = 0;
2491 if (val)
2492 dmabuf->fmt |= CS_FMT_STEREO;
2493 else
2494 dmabuf->fmt &= ~CS_FMT_STEREO;
2495 cs_set_divisor(dmabuf);
2496 CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk(
2497 "cs46xx: DSP_STEREO() DAC %s\n",
2498 (dmabuf->fmt & CS_FMT_STEREO) ?
2499 "STEREO":"MONO") );
2500 }
2501 }
2502 if (file->f_mode & FMODE_READ) {
2503 state = card->states[0];
2504 if (state) {
2505 dmabuf = &state->dmabuf;
2506 stop_adc(state);
2507 dmabuf->ready = 0;
2508 dmabuf->SGok = 0;
2509 if (val)
2510 dmabuf->fmt |= CS_FMT_STEREO;
2511 else
2512 dmabuf->fmt &= ~CS_FMT_STEREO;
2513 cs_set_divisor(dmabuf);
2514 CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk(
2515 "cs46xx: DSP_STEREO() ADC %s\n",
2516 (dmabuf->fmt & CS_FMT_STEREO) ?
2517 "STEREO":"MONO") );
2518 }
2519 }
2520 return 0;
2521 case SNDCTL_DSP_GETBLKSIZE:
2522 if (file->f_mode & FMODE_WRITE) {
2523 state = card->states[1];
2524 if (state) {
2525 dmabuf = &state->dmabuf;
2526 if ((val = prog_dmabuf(state)))
2527 return val;
2528 return put_user(dmabuf->fragsize, p);
2529 }
2530 }
2531 if (file->f_mode & FMODE_READ) {
2532 state = card->states[0];
2533 if (state) {
2534 dmabuf = &state->dmabuf;
2535 if ((val = prog_dmabuf(state)))
2536 return val;
2537 return put_user(dmabuf->fragsize/dmabuf->divisor,
2538 p);
2539 }
2540 }
2541 return put_user(0, p);
2542 case SNDCTL_DSP_GETFMTS: /* Returns a mask of supported sample format*/
2543 return put_user(AFMT_S16_LE | AFMT_U8, p);
2544 case SNDCTL_DSP_SETFMT: /* Select sample format */
2545 if (get_user(val, p))
2546 return -EFAULT;
2547 CS_DBGOUT(CS_IOCTL | CS_PARMS, 4, printk(
2548 "cs46xx: cs_ioctl() DSP_SETFMT %s %s %s %s\n",
2549 file->f_mode & FMODE_WRITE ? "DAC" : "",
2550 file->f_mode & FMODE_READ ? "ADC" : "",
2551 val == AFMT_S16_LE ? "16Bit Signed" : "",
2552 val == AFMT_U8 ? "8Bit Unsigned" : "") );
2553 valsave = val;
2554 if (val != AFMT_QUERY) {
2555 if (val==AFMT_S16_LE || val==AFMT_U8) {
2556 if (file->f_mode & FMODE_WRITE) {
2557 state = card->states[1];
2558 if (state) {
2559 dmabuf = &state->dmabuf;
2560 stop_dac(state);
2561 dmabuf->ready = 0;
2562 dmabuf->SGok = 0;
2563 if (val == AFMT_S16_LE)
2564 dmabuf->fmt |= CS_FMT_16BIT;
2565 else
2566 dmabuf->fmt &= ~CS_FMT_16BIT;
2567 cs_set_divisor(dmabuf);
2568 if ((ret = prog_dmabuf(state)))
2569 return ret;
2570 }
2571 }
2572 if (file->f_mode & FMODE_READ) {
2573 val = valsave;
2574 state = card->states[0];
2575 if (state) {
2576 dmabuf = &state->dmabuf;
2577 stop_adc(state);
2578 dmabuf->ready = 0;
2579 dmabuf->SGok = 0;
2580 if (val == AFMT_S16_LE)
2581 dmabuf->fmt |= CS_FMT_16BIT;
2582 else
2583 dmabuf->fmt &= ~CS_FMT_16BIT;
2584 cs_set_divisor(dmabuf);
2585 if ((ret = prog_dmabuf(state)))
2586 return ret;
2587 }
2588 }
2589 } else {
2590 CS_DBGOUT(CS_IOCTL | CS_ERROR, 2, printk(
2591 "cs46xx: DSP_SETFMT() Unsupported format (0x%x)\n",
2592 valsave) );
2593 }
2594 } else {
2595 if (file->f_mode & FMODE_WRITE) {
2596 state = card->states[1];
2597 if (state)
2598 dmabuf = &state->dmabuf;
2599 } else if (file->f_mode & FMODE_READ) {
2600 state = card->states[0];
2601 if (state)
2602 dmabuf = &state->dmabuf;
2603 }
2604 }
2605 if (dmabuf) {
2606 if (dmabuf->fmt & CS_FMT_16BIT)
2607 return put_user(AFMT_S16_LE, p);
2608 else
2609 return put_user(AFMT_U8, p);
2610 }
2611 return put_user(0, p);
2612 case SNDCTL_DSP_CHANNELS:
2613 if (get_user(val, p))
2614 return -EFAULT;
2615 if (val != 0) {
2616 if (file->f_mode & FMODE_WRITE) {
2617 state = card->states[1];
2618 if (state) {
2619 dmabuf = &state->dmabuf;
2620 stop_dac(state);
2621 dmabuf->ready = 0;
2622 dmabuf->SGok = 0;
2623 if (val > 1)
2624 dmabuf->fmt |= CS_FMT_STEREO;
2625 else
2626 dmabuf->fmt &= ~CS_FMT_STEREO;
2627 cs_set_divisor(dmabuf);
2628 if (prog_dmabuf(state))
2629 return 0;
2630 }
2631 }
2632 if (file->f_mode & FMODE_READ) {
2633 state = card->states[0];
2634 if (state) {
2635 dmabuf = &state->dmabuf;
2636 stop_adc(state);
2637 dmabuf->ready = 0;
2638 dmabuf->SGok = 0;
2639 if (val > 1)
2640 dmabuf->fmt |= CS_FMT_STEREO;
2641 else
2642 dmabuf->fmt &= ~CS_FMT_STEREO;
2643 cs_set_divisor(dmabuf);
2644 if (prog_dmabuf(state))
2645 return 0;
2646 }
2647 }
2648 }
2649 return put_user((dmabuf->fmt & CS_FMT_STEREO) ? 2 : 1,
2650 p);
2651 case SNDCTL_DSP_POST:
2652 /*
2653 * There will be a longer than normal pause in the data.
2654 * so... do nothing, because there is nothing that we can do.
2655 */
2656 return 0;
2657 case SNDCTL_DSP_SUBDIVIDE:
2658 if (file->f_mode & FMODE_WRITE) {
2659 state = card->states[1];
2660 if (state) {
2661 dmabuf = &state->dmabuf;
2662 if (dmabuf->subdivision)
2663 return -EINVAL;
2664 if (get_user(val, p))
2665 return -EFAULT;
2666 if (val != 1 && val != 2)
2667 return -EINVAL;
2668 dmabuf->subdivision = val;
2669 }
2670 }
2671 if (file->f_mode & FMODE_READ) {
2672 state = card->states[0];
2673 if (state) {
2674 dmabuf = &state->dmabuf;
2675 if (dmabuf->subdivision)
2676 return -EINVAL;
2677 if (get_user(val, p))
2678 return -EFAULT;
2679 if (val != 1 && val != 2)
2680 return -EINVAL;
2681 dmabuf->subdivision = val;
2682 }
2683 }
2684 return 0;
2685 case SNDCTL_DSP_SETFRAGMENT:
2686 if (get_user(val, p))
2687 return -EFAULT;
2688 if (file->f_mode & FMODE_WRITE) {
2689 state = card->states[1];
2690 if (state) {
2691 dmabuf = &state->dmabuf;
2692 dmabuf->ossfragshift = val & 0xffff;
2693 dmabuf->ossmaxfrags = (val >> 16) & 0xffff;
2694 }
2695 }
2696 if (file->f_mode & FMODE_READ) {
2697 state = card->states[0];
2698 if (state) {
2699 dmabuf = &state->dmabuf;
2700 dmabuf->ossfragshift = val & 0xffff;
2701 dmabuf->ossmaxfrags = (val >> 16) & 0xffff;
2702 }
2703 }
2704 return 0;
2705 case SNDCTL_DSP_GETOSPACE:
2706 if (!(file->f_mode & FMODE_WRITE))
2707 return -EINVAL;
2708 state = card->states[1];
2709 if (state) {
2710 dmabuf = &state->dmabuf;
2711 spin_lock_irqsave(&state->card->lock, flags);
2712 cs_update_ptr(card, CS_TRUE);
2713 abinfo.fragsize = dmabuf->fragsize;
2714 abinfo.fragstotal = dmabuf->numfrag;
2715 /*
2716 * for mmap we always have total space available
2717 */
2718 if (dmabuf->mapped)
2719 abinfo.bytes = dmabuf->dmasize;
2720 else
2721 abinfo.bytes = dmabuf->dmasize - dmabuf->count;
2722
2723 abinfo.fragments = abinfo.bytes >> dmabuf->fragshift;
2724 spin_unlock_irqrestore(&state->card->lock, flags);
2725 return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
2726 }
2727 return -ENODEV;
2728 case SNDCTL_DSP_GETISPACE:
2729 if (!(file->f_mode & FMODE_READ))
2730 return -EINVAL;
2731 state = card->states[0];
2732 if (state) {
2733 dmabuf = &state->dmabuf;
2734 spin_lock_irqsave(&state->card->lock, flags);
2735 cs_update_ptr(card, CS_TRUE);
2736 abinfo.fragsize = dmabuf->fragsize/dmabuf->divisor;
2737 abinfo.bytes = dmabuf->count/dmabuf->divisor;
2738 abinfo.fragstotal = dmabuf->numfrag;
2739 abinfo.fragments = abinfo.bytes >> dmabuf->fragshift;
2740 spin_unlock_irqrestore(&state->card->lock, flags);
2741 return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
2742 }
2743 return -ENODEV;
2744 case SNDCTL_DSP_NONBLOCK:
2745 file->f_flags |= O_NONBLOCK;
2746 return 0;
2747 case SNDCTL_DSP_GETCAPS:
2748 return put_user(DSP_CAP_REALTIME|DSP_CAP_TRIGGER|DSP_CAP_MMAP,
2749 p);
2750 case SNDCTL_DSP_GETTRIGGER:
2751 val = 0;
2752 CS_DBGOUT(CS_IOCTL, 2, printk("cs46xx: DSP_GETTRIGGER()+\n") );
2753 if (file->f_mode & FMODE_WRITE) {
2754 state = card->states[1];
2755 if (state) {
2756 dmabuf = &state->dmabuf;
2757 if (dmabuf->enable & DAC_RUNNING)
2758 val |= PCM_ENABLE_INPUT;
2759 }
2760 }
2761 if (file->f_mode & FMODE_READ) {
2762 if (state) {
2763 state = card->states[0];
2764 dmabuf = &state->dmabuf;
2765 if (dmabuf->enable & ADC_RUNNING)
2766 val |= PCM_ENABLE_OUTPUT;
2767 }
2768 }
2769 CS_DBGOUT(CS_IOCTL, 2, printk("cs46xx: DSP_GETTRIGGER()- val=0x%x\n",val) );
2770 return put_user(val, p);
2771 case SNDCTL_DSP_SETTRIGGER:
2772 if (get_user(val, p))
2773 return -EFAULT;
2774 if (file->f_mode & FMODE_READ) {
2775 state = card->states[0];
2776 if (state) {
2777 dmabuf = &state->dmabuf;
2778 if (val & PCM_ENABLE_INPUT) {
2779 if (!dmabuf->ready && (ret = prog_dmabuf(state)))
2780 return ret;
2781 start_adc(state);
2782 } else
2783 stop_adc(state);
2784 }
2785 }
2786 if (file->f_mode & FMODE_WRITE) {
2787 state = card->states[1];
2788 if (state) {
2789 dmabuf = &state->dmabuf;
2790 if (val & PCM_ENABLE_OUTPUT) {
2791 if (!dmabuf->ready && (ret = prog_dmabuf(state)))
2792 return ret;
2793 start_dac(state);
2794 } else
2795 stop_dac(state);
2796 }
2797 }
2798 return 0;
2799 case SNDCTL_DSP_GETIPTR:
2800 if (!(file->f_mode & FMODE_READ))
2801 return -EINVAL;
2802 state = card->states[0];
2803 if (state) {
2804 dmabuf = &state->dmabuf;
2805 spin_lock_irqsave(&state->card->lock, flags);
2806 cs_update_ptr(card, CS_TRUE);
2807 cinfo.bytes = dmabuf->total_bytes/dmabuf->divisor;
2808 cinfo.blocks = dmabuf->count/dmabuf->divisor >> dmabuf->fragshift;
2809 cinfo.ptr = dmabuf->hwptr/dmabuf->divisor;
2810 spin_unlock_irqrestore(&state->card->lock, flags);
2811 if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
2812 return -EFAULT;
2813 return 0;
2814 }
2815 return -ENODEV;
2816 case SNDCTL_DSP_GETOPTR:
2817 if (!(file->f_mode & FMODE_WRITE))
2818 return -EINVAL;
2819 state = card->states[1];
2820 if (state) {
2821 dmabuf = &state->dmabuf;
2822 spin_lock_irqsave(&state->card->lock, flags);
2823 cs_update_ptr(card, CS_TRUE);
2824 cinfo.bytes = dmabuf->total_bytes;
2825 if (dmabuf->mapped) {
2826 cinfo.blocks = (cinfo.bytes >> dmabuf->fragshift)
2827 - dmabuf->blocks;
2828 CS_DBGOUT(CS_PARMS, 8,
2829 printk("total_bytes=%d blocks=%d dmabuf->blocks=%d\n",
2830 cinfo.bytes,cinfo.blocks,dmabuf->blocks) );
2831 dmabuf->blocks = cinfo.bytes >> dmabuf->fragshift;
2832 } else {
2833 cinfo.blocks = dmabuf->count >> dmabuf->fragshift;
2834 }
2835 cinfo.ptr = dmabuf->hwptr;
2836
2837 CS_DBGOUT(CS_PARMS, 4, printk(
2838 "cs46xx: GETOPTR bytes=%d blocks=%d ptr=%d\n",
2839 cinfo.bytes,cinfo.blocks,cinfo.ptr) );
2840 spin_unlock_irqrestore(&state->card->lock, flags);
2841 if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
2842 return -EFAULT;
2843 return 0;
2844 }
2845 return -ENODEV;
2846 case SNDCTL_DSP_SETDUPLEX:
2847 return 0;
2848 case SNDCTL_DSP_GETODELAY:
2849 if (!(file->f_mode & FMODE_WRITE))
2850 return -EINVAL;
2851 state = card->states[1];
2852 if (state) {
2853 dmabuf = &state->dmabuf;
2854 spin_lock_irqsave(&state->card->lock, flags);
2855 cs_update_ptr(card, CS_TRUE);
2856 val = dmabuf->count;
2857 spin_unlock_irqrestore(&state->card->lock, flags);
2858 } else
2859 val = 0;
2860 return put_user(val, p);
2861 case SOUND_PCM_READ_RATE:
2862 if (file->f_mode & FMODE_READ)
2863 state = card->states[0];
2864 else
2865 state = card->states[1];
2866 if (state) {
2867 dmabuf = &state->dmabuf;
2868 return put_user(dmabuf->rate, p);
2869 }
2870 return put_user(0, p);
2871 case SOUND_PCM_READ_CHANNELS:
2872 if (file->f_mode & FMODE_READ)
2873 state = card->states[0];
2874 else
2875 state = card->states[1];
2876 if (state) {
2877 dmabuf = &state->dmabuf;
2878 return put_user((dmabuf->fmt & CS_FMT_STEREO) ? 2 : 1,
2879 p);
2880 }
2881 return put_user(0, p);
2882 case SOUND_PCM_READ_BITS:
2883 if (file->f_mode & FMODE_READ)
2884 state = card->states[0];
2885 else
2886 state = card->states[1];
2887 if (state) {
2888 dmabuf = &state->dmabuf;
2889 return put_user((dmabuf->fmt & CS_FMT_16BIT) ?
2890 AFMT_S16_LE : AFMT_U8, p);
2891
2892 }
2893 return put_user(0, p);
2894 case SNDCTL_DSP_MAPINBUF:
2895 case SNDCTL_DSP_MAPOUTBUF:
2896 case SNDCTL_DSP_SETSYNCRO:
2897 case SOUND_PCM_WRITE_FILTER:
2898 case SOUND_PCM_READ_FILTER:
2899 return -EINVAL;
2900 }
2901 return -EINVAL;
2902}
2903
2904
2905/*
2906 * AMP control - null AMP
2907 */
2908
2909static void amp_none(struct cs_card *card, int change)
2910{
2911}
2912
2913/*
2914 * Crystal EAPD mode
2915 */
2916
2917static void amp_voyetra(struct cs_card *card, int change)
2918{
2919 /* Manage the EAPD bit on the Crystal 4297
2920 and the Analog AD1885 */
2921
2922 int old = card->amplifier;
2923
2924 card->amplifier+=change;
2925 if (card->amplifier && !old) {
2926 /* Turn the EAPD amp on */
2927 cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL,
2928 cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) |
2929 0x8000);
2930 } else if(old && !card->amplifier) {
2931 /* Turn the EAPD amp off */
2932 cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL,
2933 cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
2934 ~0x8000);
2935 }
2936}
2937
2938
2939/*
2940 * Game Theatre XP card - EGPIO[2] is used to enable the external amp.
2941 */
2942
2943static void amp_hercules(struct cs_card *card, int change)
2944{
2945 int old = card->amplifier;
2946 if (!card) {
2947 CS_DBGOUT(CS_ERROR, 2, printk(KERN_INFO
2948 "cs46xx: amp_hercules() called before initialized.\n"));
2949 return;
2950 }
2951 card->amplifier+=change;
2952 if ((card->amplifier && !old) && !(hercules_egpio_disable)) {
2953 CS_DBGOUT(CS_PARMS, 4, printk(KERN_INFO
2954 "cs46xx: amp_hercules() external amp enabled\n"));
2955 cs461x_pokeBA0(card, BA0_EGPIODR,
2956 EGPIODR_GPOE2); /* enable EGPIO2 output */
2957 cs461x_pokeBA0(card, BA0_EGPIOPTR,
2958 EGPIOPTR_GPPT2); /* open-drain on output */
2959 } else if (old && !card->amplifier) {
2960 CS_DBGOUT(CS_PARMS, 4, printk(KERN_INFO
2961 "cs46xx: amp_hercules() external amp disabled\n"));
2962 cs461x_pokeBA0(card, BA0_EGPIODR, 0); /* disable */
2963 cs461x_pokeBA0(card, BA0_EGPIOPTR, 0); /* disable */
2964 }
2965}
2966
2967/*
2968 * Handle the CLKRUN on a thinkpad. We must disable CLKRUN support
2969 * whenever we need to beat on the chip.
2970 *
2971 * The original idea and code for this hack comes from David Kaiser at
2972 * Linuxcare. Perhaps one day Crystal will document their chips well
2973 * enough to make them useful.
2974 */
2975
2976static void clkrun_hack(struct cs_card *card, int change)
2977{
2978 struct pci_dev *acpi_dev;
2979 u16 control;
2980 u8 pp;
2981 unsigned long port;
2982 int old = card->active;
2983
2984 card->active+=change;
2985
2986 acpi_dev = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, NULL);
2987 if (acpi_dev == NULL)
2988 return; /* Not a thinkpad thats for sure */
2989
2990 /* Find the control port */
2991 pci_read_config_byte(acpi_dev, 0x41, &pp);
2992 port = pp << 8;
2993
2994 /* Read ACPI port */
2995 control = inw(port + 0x10);
2996
2997 /* Flip CLKRUN off while running */
2998 if (!card->active && old) {
2999 CS_DBGOUT(CS_PARMS , 9, printk( KERN_INFO
3000 "cs46xx: clkrun() enable clkrun - change=%d active=%d\n",
3001 change,card->active));
3002 outw(control|0x2000, port+0x10);
3003 } else {
3004 /*
3005 * sometimes on a resume the bit is set, so always reset the bit.
3006 */
3007 CS_DBGOUT(CS_PARMS , 9, printk( KERN_INFO
3008 "cs46xx: clkrun() disable clkrun - change=%d active=%d\n",
3009 change,card->active));
3010 outw(control&~0x2000, port+0x10);
3011 }
3012 pci_dev_put(acpi_dev);
3013}
3014
3015
3016static int cs_open(struct inode *inode, struct file *file)
3017{
3018 struct cs_card *card = file->private_data;
3019 struct cs_state *state = NULL;
3020 struct dmabuf *dmabuf = NULL;
3021 struct list_head *entry;
3022 unsigned int minor = iminor(inode);
3023 int ret = 0;
3024 unsigned int tmp;
3025
3026 CS_DBGOUT(CS_OPEN | CS_FUNCTION, 2, printk("cs46xx: cs_open()+ file=%p %s %s\n",
3027 file, file->f_mode & FMODE_WRITE ? "FMODE_WRITE" : "",
3028 file->f_mode & FMODE_READ ? "FMODE_READ" : "") );
3029
3030 list_for_each(entry, &cs46xx_devs) {
3031 card = list_entry(entry, struct cs_card, list);
3032
3033 if (!((card->dev_audio ^ minor) & ~0xf))
3034 break;
3035 }
3036 if (entry == &cs46xx_devs)
3037 return -ENODEV;
3038 if (!card) {
3039 CS_DBGOUT(CS_FUNCTION | CS_OPEN, 2, printk(KERN_INFO
3040 "cs46xx: cs_open(): Error - unable to find audio card struct\n"));
3041 return -ENODEV;
3042 }
3043
3044 /*
3045 * hardcode state[0] for capture, [1] for playback
3046 */
3047 if (file->f_mode & FMODE_READ) {
3048 CS_DBGOUT(CS_WAVE_READ, 2, printk("cs46xx: cs_open() FMODE_READ\n") );
3049 if (card->states[0] == NULL) {
3050 state = card->states[0] =
3051 kzalloc(sizeof(struct cs_state), GFP_KERNEL);
3052 if (state == NULL)
3053 return -ENOMEM;
3054 mutex_init(&state->sem);
3055 dmabuf = &state->dmabuf;
3056 dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
3057 if (dmabuf->pbuf == NULL) {
3058 kfree(state);
3059 card->states[0] = NULL;
3060 return -ENOMEM;
3061 }
3062 } else {
3063 state = card->states[0];
3064 if (state->open_mode & FMODE_READ)
3065 return -EBUSY;
3066 }
3067 dmabuf->channel = card->alloc_rec_pcm_channel(card);
3068
3069 if (dmabuf->channel == NULL) {
3070 kfree(card->states[0]);
3071 card->states[0] = NULL;
3072 return -ENODEV;
3073 }
3074
3075 /* Now turn on external AMP if needed */
3076 state->card = card;
3077 state->card->active_ctrl(state->card, 1);
3078 state->card->amplifier_ctrl(state->card, 1);
3079
3080 if ((tmp = cs46xx_powerup(card, CS_POWER_ADC))) {
3081 CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO
3082 "cs46xx: cs46xx_powerup of ADC failed (0x%x)\n", tmp));
3083 return -EIO;
3084 }
3085
3086 dmabuf->channel->state = state;
3087 /* initialize the virtual channel */
3088 state->virt = 0;
3089 state->magic = CS_STATE_MAGIC;
3090 init_waitqueue_head(&dmabuf->wait);
3091 mutex_init(&state->open_mutex);
3092 file->private_data = card;
3093
3094 mutex_lock(&state->open_mutex);
3095
3096 /* set default sample format. According to OSS Programmer's Guide /dev/dsp
3097 should be default to unsigned 8-bits, mono, with sample rate 8kHz and
3098 /dev/dspW will accept 16-bits sample */
3099
3100 /* Default input is 8bit mono */
3101 dmabuf->fmt &= ~CS_FMT_MASK;
3102 dmabuf->type = CS_TYPE_ADC;
3103 dmabuf->ossfragshift = 0;
3104 dmabuf->ossmaxfrags = 0;
3105 dmabuf->subdivision = 0;
3106 cs_set_adc_rate(state, 8000);
3107 cs_set_divisor(dmabuf);
3108
3109 state->open_mode |= FMODE_READ;
3110 mutex_unlock(&state->open_mutex);
3111 }
3112 if (file->f_mode & FMODE_WRITE) {
3113 CS_DBGOUT(CS_OPEN, 2, printk("cs46xx: cs_open() FMODE_WRITE\n") );
3114 if (card->states[1] == NULL) {
3115 state = card->states[1] =
3116 kzalloc(sizeof(struct cs_state), GFP_KERNEL);
3117 if (state == NULL)
3118 return -ENOMEM;
3119 mutex_init(&state->sem);
3120 dmabuf = &state->dmabuf;
3121 dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
3122 if (dmabuf->pbuf == NULL) {
3123 kfree(state);
3124 card->states[1] = NULL;
3125 return -ENOMEM;
3126 }
3127 } else {
3128 state = card->states[1];
3129 if (state->open_mode & FMODE_WRITE)
3130 return -EBUSY;
3131 }
3132 dmabuf->channel = card->alloc_pcm_channel(card);
3133
3134 if (dmabuf->channel == NULL) {
3135 kfree(card->states[1]);
3136 card->states[1] = NULL;
3137 return -ENODEV;
3138 }
3139
3140 /* Now turn on external AMP if needed */
3141 state->card = card;
3142 state->card->active_ctrl(state->card, 1);
3143 state->card->amplifier_ctrl(state->card, 1);
3144
3145 if ((tmp = cs46xx_powerup(card, CS_POWER_DAC))) {
3146 CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO
3147 "cs46xx: cs46xx_powerup of DAC failed (0x%x)\n", tmp));
3148 return -EIO;
3149 }
3150
3151 dmabuf->channel->state = state;
3152 /* initialize the virtual channel */
3153 state->virt = 1;
3154 state->magic = CS_STATE_MAGIC;
3155 init_waitqueue_head(&dmabuf->wait);
3156 mutex_init(&state->open_mutex);
3157 file->private_data = card;
3158
3159 mutex_lock(&state->open_mutex);
3160
3161 /* set default sample format. According to OSS Programmer's Guide /dev/dsp
3162 should be default to unsigned 8-bits, mono, with sample rate 8kHz and
3163 /dev/dspW will accept 16-bits sample */
3164
3165 /* Default output is 8bit mono. */
3166 dmabuf->fmt &= ~CS_FMT_MASK;
3167 dmabuf->type = CS_TYPE_DAC;
3168 dmabuf->ossfragshift = 0;
3169 dmabuf->ossmaxfrags = 0;
3170 dmabuf->subdivision = 0;
3171 cs_set_dac_rate(state, 8000);
3172 cs_set_divisor(dmabuf);
3173
3174 state->open_mode |= FMODE_WRITE;
3175 mutex_unlock(&state->open_mutex);
3176 if ((ret = prog_dmabuf(state)))
3177 return ret;
3178 }
3179 CS_DBGOUT(CS_OPEN | CS_FUNCTION, 2, printk("cs46xx: cs_open()- 0\n"));
3180 return nonseekable_open(inode, file);
3181}
3182
3183static int cs_release(struct inode *inode, struct file *file)
3184{
3185 struct cs_card *card = file->private_data;
3186 struct dmabuf *dmabuf;
3187 struct cs_state *state;
3188 unsigned int tmp;
3189 CS_DBGOUT(CS_RELEASE | CS_FUNCTION, 2, printk("cs46xx: cs_release()+ file=%p %s %s\n",
3190 file, file->f_mode & FMODE_WRITE ? "FMODE_WRITE" : "",
3191 file->f_mode & FMODE_READ ? "FMODE_READ" : ""));
3192
3193 if (!(file->f_mode & (FMODE_WRITE | FMODE_READ)))
3194 return -EINVAL;
3195 state = card->states[1];
3196 if (state) {
3197 if ((state->open_mode & FMODE_WRITE) & (file->f_mode & FMODE_WRITE)) {
3198 CS_DBGOUT(CS_RELEASE, 2, printk("cs46xx: cs_release() FMODE_WRITE\n"));
3199 dmabuf = &state->dmabuf;
3200 cs_clear_tail(state);
3201 drain_dac(state, file->f_flags & O_NONBLOCK);
3202 /* stop DMA state machine and free DMA buffers/channels */
3203 mutex_lock(&state->open_mutex);
3204 stop_dac(state);
3205 dealloc_dmabuf(state);
3206 state->card->free_pcm_channel(state->card, dmabuf->channel->num);
3207 free_page((unsigned long)state->dmabuf.pbuf);
3208
3209 /* we're covered by the open_mutex */
3210 mutex_unlock(&state->open_mutex);
3211 state->card->states[state->virt] = NULL;
3212 state->open_mode &= (~file->f_mode) & (FMODE_READ|FMODE_WRITE);
3213
3214 if ((tmp = cs461x_powerdown(card, CS_POWER_DAC, CS_FALSE))) {
3215 CS_DBGOUT(CS_ERROR, 1, printk(KERN_INFO
3216 "cs46xx: cs_release_mixdev() powerdown DAC failure (0x%x)\n",tmp) );
3217 }
3218
3219 /* Now turn off external AMP if needed */
3220 state->card->amplifier_ctrl(state->card, -1);
3221 state->card->active_ctrl(state->card, -1);
3222 kfree(state);
3223 }
3224 }
3225
3226 state = card->states[0];
3227 if (state) {
3228 if ((state->open_mode & FMODE_READ) & (file->f_mode & FMODE_READ)) {
3229 CS_DBGOUT(CS_RELEASE, 2, printk("cs46xx: cs_release() FMODE_READ\n"));
3230 dmabuf = &state->dmabuf;
3231 mutex_lock(&state->open_mutex);
3232 stop_adc(state);
3233 dealloc_dmabuf(state);
3234 state->card->free_pcm_channel(state->card, dmabuf->channel->num);
3235 free_page((unsigned long)state->dmabuf.pbuf);
3236
3237 /* we're covered by the open_mutex */
3238 mutex_unlock(&state->open_mutex);
3239 state->card->states[state->virt] = NULL;
3240 state->open_mode &= (~file->f_mode) & (FMODE_READ|FMODE_WRITE);
3241
3242 if ((tmp = cs461x_powerdown(card, CS_POWER_ADC, CS_FALSE))) {
3243 CS_DBGOUT(CS_ERROR, 1, printk(KERN_INFO
3244 "cs46xx: cs_release_mixdev() powerdown ADC failure (0x%x)\n",tmp) );
3245 }
3246
3247 /* Now turn off external AMP if needed */
3248 state->card->amplifier_ctrl(state->card, -1);
3249 state->card->active_ctrl(state->card, -1);
3250 kfree(state);
3251 }
3252 }
3253
3254 CS_DBGOUT(CS_FUNCTION | CS_RELEASE, 2, printk("cs46xx: cs_release()- 0\n"));
3255 return 0;
3256}
3257
3258static void printpm(struct cs_card *s)
3259{
3260 CS_DBGOUT(CS_PM, 9, printk("pm struct:\n"));
3261 CS_DBGOUT(CS_PM, 9, printk("flags:0x%x u32CLKCR1_SAVE: 0%x u32SSPMValue: 0x%x\n",
3262 (unsigned)s->pm.flags,s->pm.u32CLKCR1_SAVE,s->pm.u32SSPMValue));
3263 CS_DBGOUT(CS_PM, 9, printk("u32PPLVCvalue: 0x%x u32PPRVCvalue: 0x%x\n",
3264 s->pm.u32PPLVCvalue,s->pm.u32PPRVCvalue));
3265 CS_DBGOUT(CS_PM, 9, printk("u32FMLVCvalue: 0x%x u32FMRVCvalue: 0x%x\n",
3266 s->pm.u32FMLVCvalue,s->pm.u32FMRVCvalue));
3267 CS_DBGOUT(CS_PM, 9, printk("u32GPIORvalue: 0x%x u32JSCTLvalue: 0x%x\n",
3268 s->pm.u32GPIORvalue,s->pm.u32JSCTLvalue));
3269 CS_DBGOUT(CS_PM, 9, printk("u32SSCR: 0x%x u32SRCSA: 0x%x\n",
3270 s->pm.u32SSCR,s->pm.u32SRCSA));
3271 CS_DBGOUT(CS_PM, 9, printk("u32DacASR: 0x%x u32AdcASR: 0x%x\n",
3272 s->pm.u32DacASR,s->pm.u32AdcASR));
3273 CS_DBGOUT(CS_PM, 9, printk("u32DacSR: 0x%x u32AdcSR: 0x%x\n",
3274 s->pm.u32DacSR,s->pm.u32AdcSR));
3275 CS_DBGOUT(CS_PM, 9, printk("u32MIDCR_Save: 0x%x\n",
3276 s->pm.u32MIDCR_Save));
3277 CS_DBGOUT(CS_PM, 9, printk("u32AC97_powerdown: 0x%x _general_purpose 0x%x\n",
3278 s->pm.u32AC97_powerdown,s->pm.u32AC97_general_purpose));
3279 CS_DBGOUT(CS_PM, 9, printk("u32AC97_master_volume: 0x%x\n",
3280 s->pm.u32AC97_master_volume));
3281 CS_DBGOUT(CS_PM, 9, printk("u32AC97_headphone_volume: 0x%x\n",
3282 s->pm.u32AC97_headphone_volume));
3283 CS_DBGOUT(CS_PM, 9, printk("u32AC97_master_volume_mono: 0x%x\n",
3284 s->pm.u32AC97_master_volume_mono));
3285 CS_DBGOUT(CS_PM, 9, printk("u32AC97_pcm_out_volume: 0x%x\n",
3286 s->pm.u32AC97_pcm_out_volume));
3287 CS_DBGOUT(CS_PM, 9, printk("dmabuf_swptr_play: 0x%x dmabuf_count_play: %d\n",
3288 s->pm.dmabuf_swptr_play,s->pm.dmabuf_count_play));
3289 CS_DBGOUT(CS_PM, 9, printk("dmabuf_swptr_capture: 0x%x dmabuf_count_capture: %d\n",
3290 s->pm.dmabuf_swptr_capture,s->pm.dmabuf_count_capture));
3291
3292}
3293
3294/****************************************************************************
3295*
3296* Suspend - save the ac97 regs, mute the outputs and power down the part.
3297*
3298****************************************************************************/
3299static void cs46xx_ac97_suspend(struct cs_card *card)
3300{
3301 int Count,i;
3302 struct ac97_codec *dev=card->ac97_codec[0];
3303 unsigned int tmp;
3304
3305 CS_DBGOUT(CS_PM, 9, printk("cs46xx: cs46xx_ac97_suspend()+\n"));
3306
3307 if (card->states[1]) {
3308 stop_dac(card->states[1]);
3309 resync_dma_ptrs(card->states[1]);
3310 }
3311 if (card->states[0]) {
3312 stop_adc(card->states[0]);
3313 resync_dma_ptrs(card->states[0]);
3314 }
3315
3316 for (Count = 0x2, i = 0; (Count <= CS46XX_AC97_HIGHESTREGTORESTORE)
3317 && (i < CS46XX_AC97_NUMBER_RESTORE_REGS);
3318 Count += 2, i++) {
3319 card->pm.ac97[i] = cs_ac97_get(dev, BA0_AC97_RESET + Count);
3320 }
3321/*
3322* Save the ac97 volume registers as well as the current powerdown state.
3323* Now, mute the all the outputs (master, headphone, and mono), as well
3324* as the PCM volume, in preparation for powering down the entire part.
3325 card->pm.u32AC97_master_volume = (u32)cs_ac97_get( dev,
3326 (u8)BA0_AC97_MASTER_VOLUME);
3327 card->pm.u32AC97_headphone_volume = (u32)cs_ac97_get(dev,
3328 (u8)BA0_AC97_HEADPHONE_VOLUME);
3329 card->pm.u32AC97_master_volume_mono = (u32)cs_ac97_get(dev,
3330 (u8)BA0_AC97_MASTER_VOLUME_MONO);
3331 card->pm.u32AC97_pcm_out_volume = (u32)cs_ac97_get(dev,
3332 (u8)BA0_AC97_PCM_OUT_VOLUME);
3333*/
3334/*
3335* mute the outputs
3336*/
3337 cs_ac97_set(dev, (u8)BA0_AC97_MASTER_VOLUME, 0x8000);
3338 cs_ac97_set(dev, (u8)BA0_AC97_HEADPHONE_VOLUME, 0x8000);
3339 cs_ac97_set(dev, (u8)BA0_AC97_MASTER_VOLUME_MONO, 0x8000);
3340 cs_ac97_set(dev, (u8)BA0_AC97_PCM_OUT_VOLUME, 0x8000);
3341
3342/*
3343* save the registers that cause pops
3344*/
3345 card->pm.u32AC97_powerdown = (u32)cs_ac97_get(dev, (u8)AC97_POWER_CONTROL);
3346 card->pm.u32AC97_general_purpose = (u32)cs_ac97_get(dev, (u8)BA0_AC97_GENERAL_PURPOSE);
3347/*
3348* And power down everything on the AC97 codec.
3349* well, for now, only power down the DAC/ADC and MIXER VREFON components.
3350* trouble with removing VREF.
3351*/
3352 if ((tmp = cs461x_powerdown(card, CS_POWER_DAC | CS_POWER_ADC |
3353 CS_POWER_MIXVON, CS_TRUE))) {
3354 CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO
3355 "cs46xx: cs46xx_ac97_suspend() failure (0x%x)\n",tmp));
3356 }
3357
3358 CS_DBGOUT(CS_PM, 9, printk("cs46xx: cs46xx_ac97_suspend()-\n"));
3359}
3360
3361/****************************************************************************
3362*
3363* Resume - power up the part and restore its registers..
3364*
3365****************************************************************************/
3366static void cs46xx_ac97_resume(struct cs_card *card)
3367{
3368 int Count,i;
3369 struct ac97_codec *dev=card->ac97_codec[0];
3370
3371 CS_DBGOUT(CS_PM, 9, printk("cs46xx: cs46xx_ac97_resume()+\n"));
3372
3373/*
3374* First, we restore the state of the general purpose register. This
3375* contains the mic select (mic1 or mic2) and if we restore this after
3376* we restore the mic volume/boost state and mic2 was selected at
3377* suspend time, we will end up with a brief period of time where mic1
3378* is selected with the volume/boost settings for mic2, causing
3379* acoustic feedback. So we restore the general purpose register
3380* first, thereby getting the correct mic selected before we restore
3381* the mic volume/boost.
3382*/
3383 cs_ac97_set(dev, (u8)BA0_AC97_GENERAL_PURPOSE,
3384 (u16)card->pm.u32AC97_general_purpose);
3385/*
3386* Now, while the outputs are still muted, restore the state of power
3387* on the AC97 part.
3388*/
3389 cs_ac97_set(dev, (u8)BA0_AC97_POWERDOWN, (u16)card->pm.u32AC97_powerdown);
3390 mdelay(5 * cs_laptop_wait);
3391/*
3392* Restore just the first set of registers, from register number
3393* 0x02 to the register number that ulHighestRegToRestore specifies.
3394*/
3395 for (Count = 0x2, i=0; (Count <= CS46XX_AC97_HIGHESTREGTORESTORE) &&
3396 (i < CS46XX_AC97_NUMBER_RESTORE_REGS); Count += 2, i++) {
3397 cs_ac97_set(dev, (u8)(BA0_AC97_RESET + Count), (u16)card->pm.ac97[i]);
3398 }
3399
3400 /* Check if we have to init the amplifier */
3401 if (card->amp_init)
3402 card->amp_init(card);
3403
3404 CS_DBGOUT(CS_PM, 9, printk("cs46xx: cs46xx_ac97_resume()-\n"));
3405}
3406
3407
3408static int cs46xx_restart_part(struct cs_card *card)
3409{
3410 struct dmabuf *dmabuf;
3411
3412 CS_DBGOUT(CS_PM | CS_FUNCTION, 4,
3413 printk( "cs46xx: cs46xx_restart_part()+\n"));
3414 if (card->states[1]) {
3415 dmabuf = &card->states[1]->dmabuf;
3416 dmabuf->ready = 0;
3417 resync_dma_ptrs(card->states[1]);
3418 cs_set_divisor(dmabuf);
3419 if (__prog_dmabuf(card->states[1])) {
3420 CS_DBGOUT(CS_PM | CS_ERROR, 1,
3421 printk("cs46xx: cs46xx_restart_part()- (-1) prog_dmabuf() dac error\n"));
3422 return -1;
3423 }
3424 cs_set_dac_rate(card->states[1], dmabuf->rate);
3425 }
3426 if (card->states[0]) {
3427 dmabuf = &card->states[0]->dmabuf;
3428 dmabuf->ready = 0;
3429 resync_dma_ptrs(card->states[0]);
3430 cs_set_divisor(dmabuf);
3431 if (__prog_dmabuf(card->states[0])) {
3432 CS_DBGOUT(CS_PM | CS_ERROR, 1,
3433 printk("cs46xx: cs46xx_restart_part()- (-1) prog_dmabuf() adc error\n"));
3434 return -1;
3435 }
3436 cs_set_adc_rate(card->states[0], dmabuf->rate);
3437 }
3438 card->pm.flags |= CS46XX_PM_RESUMED;
3439 if (card->states[0])
3440 start_adc(card->states[0]);
3441 if (card->states[1])
3442 start_dac(card->states[1]);
3443
3444 card->pm.flags |= CS46XX_PM_IDLE;
3445 card->pm.flags &= ~(CS46XX_PM_SUSPENDING | CS46XX_PM_SUSPENDED
3446 | CS46XX_PM_RESUMING | CS46XX_PM_RESUMED);
3447 if (card->states[0])
3448 wake_up(&card->states[0]->dmabuf.wait);
3449 if (card->states[1])
3450 wake_up(&card->states[1]->dmabuf.wait);
3451
3452 CS_DBGOUT(CS_PM | CS_FUNCTION, 4,
3453 printk( "cs46xx: cs46xx_restart_part()-\n"));
3454 return 0;
3455}
3456
3457static void cs461x_reset(struct cs_card *card);
3458static void cs461x_proc_stop(struct cs_card *card);
3459static int cs46xx_suspend(struct cs_card *card, pm_message_t state)
3460{
3461 unsigned int tmp;
3462
3463 CS_DBGOUT(CS_PM | CS_FUNCTION, 4,
3464 printk("cs46xx: cs46xx_suspend()+ flags=0x%x s=%p\n",
3465 (unsigned)card->pm.flags,card));
3466/*
3467* check the current state, only suspend if IDLE
3468*/
3469 if (!(card->pm.flags & CS46XX_PM_IDLE)) {
3470 CS_DBGOUT(CS_PM | CS_ERROR, 2,
3471 printk("cs46xx: cs46xx_suspend() unable to suspend, not IDLE\n"));
3472 return 1;
3473 }
3474 card->pm.flags &= ~CS46XX_PM_IDLE;
3475 card->pm.flags |= CS46XX_PM_SUSPENDING;
3476
3477 card->active_ctrl(card,1);
3478
3479 tmp = cs461x_peek(card, BA1_PFIE);
3480 tmp &= ~0x0000f03f;
3481 tmp |= 0x00000010;
3482 cs461x_poke(card, BA1_PFIE, tmp); /* playback interrupt disable */
3483
3484 tmp = cs461x_peek(card, BA1_CIE);
3485 tmp &= ~0x0000003f;
3486 tmp |= 0x00000011;
3487 cs461x_poke(card, BA1_CIE, tmp); /* capture interrupt disable */
3488
3489 /*
3490 * Stop playback DMA.
3491 */
3492 tmp = cs461x_peek(card, BA1_PCTL);
3493 cs461x_poke(card, BA1_PCTL, tmp & 0x0000ffff);
3494
3495 /*
3496 * Stop capture DMA.
3497 */
3498 tmp = cs461x_peek(card, BA1_CCTL);
3499 cs461x_poke(card, BA1_CCTL, tmp & 0xffff0000);
3500
3501 if (card->states[1]) {
3502 card->pm.dmabuf_swptr_play = card->states[1]->dmabuf.swptr;
3503 card->pm.dmabuf_count_play = card->states[1]->dmabuf.count;
3504 }
3505 if (card->states[0]) {
3506 card->pm.dmabuf_swptr_capture = card->states[0]->dmabuf.swptr;
3507 card->pm.dmabuf_count_capture = card->states[0]->dmabuf.count;
3508 }
3509
3510 cs46xx_ac97_suspend(card);
3511
3512 /*
3513 * Reset the processor.
3514 */
3515 cs461x_reset(card);
3516
3517 cs461x_proc_stop(card);
3518
3519 /*
3520 * Power down the DAC and ADC. For now leave the other areas on.
3521 */
3522 cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, 0x0300);
3523
3524 /*
3525 * Power down the PLL.
3526 */
3527 cs461x_pokeBA0(card, BA0_CLKCR1, 0);
3528
3529 /*
3530 * Turn off the Processor by turning off the software clock enable flag in
3531 * the clock control register.
3532 */
3533 tmp = cs461x_peekBA0(card, BA0_CLKCR1) & ~CLKCR1_SWCE;
3534 cs461x_pokeBA0(card, BA0_CLKCR1, tmp);
3535
3536 card->active_ctrl(card,-1);
3537
3538 card->pm.flags &= ~CS46XX_PM_SUSPENDING;
3539 card->pm.flags |= CS46XX_PM_SUSPENDED;
3540
3541 printpm(card);
3542
3543 CS_DBGOUT(CS_PM | CS_FUNCTION, 4,
3544 printk("cs46xx: cs46xx_suspend()- flags=0x%x\n",
3545 (unsigned)card->pm.flags));
3546 return 0;
3547}
3548
3549static int cs46xx_resume(struct cs_card *card)
3550{
3551 int i;
3552
3553 CS_DBGOUT(CS_PM | CS_FUNCTION, 4,
3554 printk( "cs46xx: cs46xx_resume()+ flags=0x%x\n",
3555 (unsigned)card->pm.flags));
3556 if (!(card->pm.flags & CS46XX_PM_SUSPENDED)) {
3557 CS_DBGOUT(CS_PM | CS_ERROR, 2,
3558 printk("cs46xx: cs46xx_resume() unable to resume, not SUSPENDED\n"));
3559 return 1;
3560 }
3561 card->pm.flags |= CS46XX_PM_RESUMING;
3562 card->pm.flags &= ~CS46XX_PM_SUSPENDED;
3563 printpm(card);
3564 card->active_ctrl(card, 1);
3565
3566 for (i = 0; i < 5; i++) {
3567 if (cs_hardware_init(card) != 0) {
3568 CS_DBGOUT(CS_PM | CS_ERROR, 4, printk(
3569 "cs46xx: cs46xx_resume()- ERROR in cs_hardware_init()\n"));
3570 mdelay(10 * cs_laptop_wait);
3571 cs461x_reset(card);
3572 continue;
3573 }
3574 break;
3575 }
3576 if (i >= 4) {
3577 CS_DBGOUT(CS_PM | CS_ERROR, 1, printk(
3578 "cs46xx: cs46xx_resume()- cs_hardware_init() failed, retried %d times.\n",i));
3579 return 0;
3580 }
3581
3582 if (cs46xx_restart_part(card)) {
3583 CS_DBGOUT(CS_PM | CS_ERROR, 4, printk(
3584 "cs46xx: cs46xx_resume(): cs46xx_restart_part() returned error\n"));
3585 }
3586
3587 card->active_ctrl(card, -1);
3588
3589 CS_DBGOUT(CS_PM | CS_FUNCTION, 4, printk("cs46xx: cs46xx_resume()- flags=0x%x\n",
3590 (unsigned)card->pm.flags));
3591 return 0;
3592}
3593
3594static /*const*/ struct file_operations cs461x_fops = {
3595 CS_OWNER CS_THIS_MODULE
3596 .llseek = no_llseek,
3597 .read = cs_read,
3598 .write = cs_write,
3599 .poll = cs_poll,
3600 .ioctl = cs_ioctl,
3601 .mmap = cs_mmap,
3602 .open = cs_open,
3603 .release = cs_release,
3604};
3605
3606/* Write AC97 codec registers */
3607
3608
3609static u16 _cs_ac97_get(struct ac97_codec *dev, u8 reg)
3610{
3611 struct cs_card *card = dev->private_data;
3612 int count,loopcnt;
3613 unsigned int tmp;
3614 u16 ret;
3615
3616 /*
3617 * 1. Write ACCAD = Command Address Register = 46Ch for AC97 register address
3618 * 2. Write ACCDA = Command Data Register = 470h for data to write to AC97
3619 * 3. Write ACCTL = Control Register = 460h for initiating the write
3620 * 4. Read ACCTL = 460h, DCV should be reset by now and 460h = 17h
3621 * 5. if DCV not cleared, break and return error
3622 * 6. Read ACSTS = Status Register = 464h, check VSTS bit
3623 */
3624
3625 cs461x_peekBA0(card, BA0_ACSDA);
3626
3627 /*
3628 * Setup the AC97 control registers on the CS461x to send the
3629 * appropriate command to the AC97 to perform the read.
3630 * ACCAD = Command Address Register = 46Ch
3631 * ACCDA = Command Data Register = 470h
3632 * ACCTL = Control Register = 460h
3633 * set DCV - will clear when process completed
3634 * set CRW - Read command
3635 * set VFRM - valid frame enabled
3636 * set ESYN - ASYNC generation enabled
3637 * set RSTN - ARST# inactive, AC97 codec not reset
3638 */
3639
3640 cs461x_pokeBA0(card, BA0_ACCAD, reg);
3641 cs461x_pokeBA0(card, BA0_ACCDA, 0);
3642 cs461x_pokeBA0(card, BA0_ACCTL, ACCTL_DCV | ACCTL_CRW |
3643 ACCTL_VFRM | ACCTL_ESYN |
3644 ACCTL_RSTN);
3645
3646
3647 /*
3648 * Wait for the read to occur.
3649 */
3650 if (!(card->pm.flags & CS46XX_PM_IDLE))
3651 loopcnt = 2000;
3652 else
3653 loopcnt = 500 * cs_laptop_wait;
3654 loopcnt *= cs_laptop_wait;
3655 for (count = 0; count < loopcnt; count++) {
3656 /*
3657 * First, we want to wait for a short time.
3658 */
3659 udelay(10 * cs_laptop_wait);
3660 /*
3661 * Now, check to see if the read has completed.
3662 * ACCTL = 460h, DCV should be reset by now and 460h = 17h
3663 */
3664 if (!(cs461x_peekBA0(card, BA0_ACCTL) & ACCTL_DCV))
3665 break;
3666 }
3667
3668 /*
3669 * Make sure the read completed.
3670 */
3671 if (cs461x_peekBA0(card, BA0_ACCTL) & ACCTL_DCV) {
3672 CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING
3673 "cs46xx: AC'97 read problem (ACCTL_DCV), reg = 0x%x returning 0xffff\n", reg));
3674 return 0xffff;
3675 }
3676
3677 /*
3678 * Wait for the valid status bit to go active.
3679 */
3680
3681 if (!(card->pm.flags & CS46XX_PM_IDLE))
3682 loopcnt = 2000;
3683 else
3684 loopcnt = 1000;
3685 loopcnt *= cs_laptop_wait;
3686 for (count = 0; count < loopcnt; count++) {
3687 /*
3688 * Read the AC97 status register.
3689 * ACSTS = Status Register = 464h
3690 * VSTS - Valid Status
3691 */
3692 if (cs461x_peekBA0(card, BA0_ACSTS) & ACSTS_VSTS)
3693 break;
3694 udelay(10 * cs_laptop_wait);
3695 }
3696
3697 /*
3698 * Make sure we got valid status.
3699 */
3700 if (!((tmp = cs461x_peekBA0(card, BA0_ACSTS)) & ACSTS_VSTS)) {
3701 CS_DBGOUT(CS_ERROR, 2, printk(KERN_WARNING
3702 "cs46xx: AC'97 read problem (ACSTS_VSTS), reg = 0x%x val=0x%x 0xffff \n",
3703 reg, tmp));
3704 return 0xffff;
3705 }
3706
3707 /*
3708 * Read the data returned from the AC97 register.
3709 * ACSDA = Status Data Register = 474h
3710 */
3711 CS_DBGOUT(CS_FUNCTION, 9, printk(KERN_INFO
3712 "cs46xx: cs_ac97_get() reg = 0x%x, val = 0x%x, BA0_ACCAD = 0x%x\n",
3713 reg, cs461x_peekBA0(card, BA0_ACSDA),
3714 cs461x_peekBA0(card, BA0_ACCAD)));
3715 ret = cs461x_peekBA0(card, BA0_ACSDA);
3716 return ret;
3717}
3718
3719static u16 cs_ac97_get(struct ac97_codec *dev, u8 reg)
3720{
3721 u16 ret;
3722 struct cs_card *card = dev->private_data;
3723
3724 spin_lock(&card->ac97_lock);
3725 ret = _cs_ac97_get(dev, reg);
3726 spin_unlock(&card->ac97_lock);
3727 return ret;
3728}
3729
3730static void cs_ac97_set(struct ac97_codec *dev, u8 reg, u16 val)
3731{
3732 struct cs_card *card = dev->private_data;
3733 int count;
3734 int val2 = 0;
3735
3736 spin_lock(&card->ac97_lock);
3737
3738 if (reg == AC97_CD_VOL)
3739 val2 = _cs_ac97_get(dev, AC97_CD_VOL);
3740
3741 /*
3742 * 1. Write ACCAD = Command Address Register = 46Ch for AC97 register address
3743 * 2. Write ACCDA = Command Data Register = 470h for data to write to AC97
3744 * 3. Write ACCTL = Control Register = 460h for initiating the write
3745 * 4. Read ACCTL = 460h, DCV should be reset by now and 460h = 07h
3746 * 5. if DCV not cleared, break and return error
3747 */
3748
3749 /*
3750 * Setup the AC97 control registers on the CS461x to send the
3751 * appropriate command to the AC97 to perform the read.
3752 * ACCAD = Command Address Register = 46Ch
3753 * ACCDA = Command Data Register = 470h
3754 * ACCTL = Control Register = 460h
3755 * set DCV - will clear when process completed
3756 * reset CRW - Write command
3757 * set VFRM - valid frame enabled
3758 * set ESYN - ASYNC generation enabled
3759 * set RSTN - ARST# inactive, AC97 codec not reset
3760 */
3761 cs461x_pokeBA0(card, BA0_ACCAD, reg);
3762 cs461x_pokeBA0(card, BA0_ACCDA, val);
3763 cs461x_peekBA0(card, BA0_ACCTL);
3764 cs461x_pokeBA0(card, BA0_ACCTL, 0 | ACCTL_VFRM | ACCTL_ESYN | ACCTL_RSTN);
3765 cs461x_pokeBA0(card, BA0_ACCTL, ACCTL_DCV | ACCTL_VFRM |
3766 ACCTL_ESYN | ACCTL_RSTN);
3767 for (count = 0; count < 1000; count++) {
3768 /*
3769 * First, we want to wait for a short time.
3770 */
3771 udelay(10 * cs_laptop_wait);
3772 /*
3773 * Now, check to see if the write has completed.
3774 * ACCTL = 460h, DCV should be reset by now and 460h = 07h
3775 */
3776 if (!(cs461x_peekBA0(card, BA0_ACCTL) & ACCTL_DCV))
3777 break;
3778 }
3779 /*
3780 * Make sure the write completed.
3781 */
3782 if (cs461x_peekBA0(card, BA0_ACCTL) & ACCTL_DCV) {
3783 CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING
3784 "cs46xx: AC'97 write problem, reg = 0x%x, val = 0x%x\n", reg, val));
3785 }
3786
3787 spin_unlock(&card->ac97_lock);
3788
3789 /*
3790 * Adjust power if the mixer is selected/deselected according
3791 * to the CD.
3792 *
3793 * IF the CD is a valid input source (mixer or direct) AND
3794 * the CD is not muted THEN power is needed
3795 *
3796 * We do two things. When record select changes the input to
3797 * add/remove the CD we adjust the power count if the CD is
3798 * unmuted.
3799 *
3800 * When the CD mute changes we adjust the power level if the
3801 * CD was a valid input.
3802 *
3803 * We also check for CD volume != 0, as the CD mute isn't
3804 * normally tweaked from userspace.
3805 */
3806
3807 /* CD mute change ? */
3808
3809 if (reg == AC97_CD_VOL) {
3810 /* Mute bit change ? */
3811 if ((val2^val) & 0x8000 ||
3812 ((val2 == 0x1f1f || val == 0x1f1f) && val2 != val)) {
3813 /* This is a hack but its cleaner than the alternatives.
3814 Right now card->ac97_codec[0] might be NULL as we are
3815 still doing codec setup. This does an early assignment
3816 to avoid the problem if it occurs */
3817
3818 if (card->ac97_codec[0] == NULL)
3819 card->ac97_codec[0] = dev;
3820
3821 /* Mute on */
3822 if (val & 0x8000 || val == 0x1f1f)
3823 card->amplifier_ctrl(card, -1);
3824 else { /* Mute off power on */
3825 if (card->amp_init)
3826 card->amp_init(card);
3827 card->amplifier_ctrl(card, 1);
3828 }
3829 }
3830 }
3831}
3832
3833/* OSS /dev/mixer file operation methods */
3834
3835static int cs_open_mixdev(struct inode *inode, struct file *file)
3836{
3837 int i = 0;
3838 unsigned int minor = iminor(inode);
3839 struct cs_card *card = NULL;
3840 struct list_head *entry;
3841 unsigned int tmp;
3842
3843 CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4,
3844 printk(KERN_INFO "cs46xx: cs_open_mixdev()+\n"));
3845
3846 list_for_each(entry, &cs46xx_devs) {
3847 card = list_entry(entry, struct cs_card, list);
3848 for (i = 0; i < NR_AC97; i++)
3849 if (card->ac97_codec[i] != NULL &&
3850 card->ac97_codec[i]->dev_mixer == minor)
3851 goto match;
3852 }
3853 if (!card) {
3854 CS_DBGOUT(CS_FUNCTION | CS_OPEN | CS_ERROR, 2,
3855 printk(KERN_INFO "cs46xx: cs46xx_open_mixdev()- -ENODEV\n"));
3856 return -ENODEV;
3857 }
3858 match:
3859 if (!card->ac97_codec[i])
3860 return -ENODEV;
3861 file->private_data = card->ac97_codec[i];
3862
3863 card->active_ctrl(card,1);
3864 if (!CS_IN_USE(&card->mixer_use_cnt)) {
3865 if ((tmp = cs46xx_powerup(card, CS_POWER_MIXVON))) {
3866 CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO
3867 "cs46xx: cs_open_mixdev() powerup failure (0x%x)\n", tmp));
3868 return -EIO;
3869 }
3870 }
3871 card->amplifier_ctrl(card, 1);
3872 CS_INC_USE_COUNT(&card->mixer_use_cnt);
3873 CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4,
3874 printk(KERN_INFO "cs46xx: cs_open_mixdev()- 0\n"));
3875 return nonseekable_open(inode, file);
3876}
3877
3878static int cs_release_mixdev(struct inode *inode, struct file *file)
3879{
3880 unsigned int minor = iminor(inode);
3881 struct cs_card *card = NULL;
3882 struct list_head *entry;
3883 int i;
3884 unsigned int tmp;
3885
3886 CS_DBGOUT(CS_FUNCTION | CS_RELEASE, 4,
3887 printk(KERN_INFO "cs46xx: cs_release_mixdev()+\n"));
3888 list_for_each(entry, &cs46xx_devs)
3889 {
3890 card = list_entry(entry, struct cs_card, list);
3891 for (i = 0; i < NR_AC97; i++)
3892 if (card->ac97_codec[i] != NULL &&
3893 card->ac97_codec[i]->dev_mixer == minor)
3894 goto match;
3895 }
3896 if (!card) {
3897 CS_DBGOUT(CS_FUNCTION | CS_OPEN | CS_ERROR, 2,
3898 printk(KERN_INFO "cs46xx: cs46xx_open_mixdev()- -ENODEV\n"));
3899 return -ENODEV;
3900 }
3901match:
3902 if (!CS_DEC_AND_TEST(&card->mixer_use_cnt)) {
3903 CS_DBGOUT(CS_FUNCTION | CS_RELEASE, 4,
3904 printk(KERN_INFO "cs46xx: cs_release_mixdev()- no powerdown, usecnt>0\n"));
3905 card->active_ctrl(card, -1);
3906 card->amplifier_ctrl(card, -1);
3907 return 0;
3908 }
3909/*
3910* ok, no outstanding mixer opens, so powerdown.
3911*/
3912 if ((tmp = cs461x_powerdown(card, CS_POWER_MIXVON, CS_FALSE))) {
3913 CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO
3914 "cs46xx: cs_release_mixdev() powerdown MIXVON failure (0x%x)\n", tmp));
3915 card->active_ctrl(card, -1);
3916 card->amplifier_ctrl(card, -1);
3917 return -EIO;
3918 }
3919 card->active_ctrl(card, -1);
3920 card->amplifier_ctrl(card, -1);
3921 CS_DBGOUT(CS_FUNCTION | CS_RELEASE, 4,
3922 printk(KERN_INFO "cs46xx: cs_release_mixdev()- 0\n"));
3923 return 0;
3924}
3925
3926static int cs_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd,
3927 unsigned long arg)
3928{
3929 struct ac97_codec *codec = file->private_data;
3930 struct cs_card *card = NULL;
3931 struct list_head *entry;
3932 unsigned long __user *p = (long __user *)arg;
3933#if CSDEBUG_INTERFACE
3934 int val;
3935
3936 if ( (cmd == SOUND_MIXER_CS_GETDBGMASK) ||
3937 (cmd == SOUND_MIXER_CS_SETDBGMASK) ||
3938 (cmd == SOUND_MIXER_CS_GETDBGLEVEL) ||
3939 (cmd == SOUND_MIXER_CS_SETDBGLEVEL) ||
3940 (cmd == SOUND_MIXER_CS_APM)) {
3941 switch (cmd) {
3942 case SOUND_MIXER_CS_GETDBGMASK:
3943 return put_user(cs_debugmask, p);
3944 case SOUND_MIXER_CS_GETDBGLEVEL:
3945 return put_user(cs_debuglevel, p);
3946 case SOUND_MIXER_CS_SETDBGMASK:
3947 if (get_user(val, p))
3948 return -EFAULT;
3949 cs_debugmask = val;
3950 return 0;
3951 case SOUND_MIXER_CS_SETDBGLEVEL:
3952 if (get_user(val, p))
3953 return -EFAULT;
3954 cs_debuglevel = val;
3955 return 0;
3956 case SOUND_MIXER_CS_APM:
3957 if (get_user(val, p))
3958 return -EFAULT;
3959 if (val == CS_IOCTL_CMD_SUSPEND) {
3960 list_for_each(entry, &cs46xx_devs) {
3961 card = list_entry(entry, struct cs_card, list);
3962 cs46xx_suspend(card, PMSG_ON);
3963 }
3964
3965 } else if (val == CS_IOCTL_CMD_RESUME) {
3966 list_for_each(entry, &cs46xx_devs) {
3967 card = list_entry(entry, struct cs_card, list);
3968 cs46xx_resume(card);
3969 }
3970 } else {
3971 CS_DBGOUT(CS_ERROR, 1, printk(KERN_INFO
3972 "cs46xx: mixer_ioctl(): invalid APM cmd (%d)\n",
3973 val));
3974 }
3975 return 0;
3976 default:
3977 CS_DBGOUT(CS_ERROR, 1, printk(KERN_INFO
3978 "cs46xx: mixer_ioctl(): ERROR unknown debug cmd\n"));
3979 return 0;
3980 }
3981 }
3982#endif
3983 return codec->mixer_ioctl(codec, cmd, arg);
3984}
3985
3986static /*const*/ struct file_operations cs_mixer_fops = {
3987 CS_OWNER CS_THIS_MODULE
3988 .llseek = no_llseek,
3989 .ioctl = cs_ioctl_mixdev,
3990 .open = cs_open_mixdev,
3991 .release = cs_release_mixdev,
3992};
3993
3994/* AC97 codec initialisation. */
3995static int __init cs_ac97_init(struct cs_card *card)
3996{
3997 int num_ac97 = 0;
3998 int ready_2nd = 0;
3999 struct ac97_codec *codec;
4000 u16 eid;
4001
4002 CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO
4003 "cs46xx: cs_ac97_init()+\n") );
4004
4005 for (num_ac97 = 0; num_ac97 < NR_AC97; num_ac97++) {
4006 if ((codec = ac97_alloc_codec()) == NULL)
4007 return -ENOMEM;
4008
4009 /* initialize some basic codec information, other fields will be filled
4010 in ac97_probe_codec */
4011 codec->private_data = card;
4012 codec->id = num_ac97;
4013
4014 codec->codec_read = cs_ac97_get;
4015 codec->codec_write = cs_ac97_set;
4016
4017 if (ac97_probe_codec(codec) == 0) {
4018 CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO
4019 "cs46xx: cs_ac97_init()- codec number %d not found\n",
4020 num_ac97) );
4021 card->ac97_codec[num_ac97] = NULL;
4022 break;
4023 }
4024 CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO
4025 "cs46xx: cs_ac97_init() found codec %d\n",num_ac97));
4026
4027 eid = cs_ac97_get(codec, AC97_EXTENDED_ID);
4028
4029 if (eid == 0xFFFF) {
4030 printk(KERN_WARNING "cs46xx: codec %d not present\n",num_ac97);
4031 ac97_release_codec(codec);
4032 break;
4033 }
4034
4035 card->ac97_features = eid;
4036
4037 if ((codec->dev_mixer = register_sound_mixer(&cs_mixer_fops, -1)) < 0) {
4038 printk(KERN_ERR "cs46xx: couldn't register mixer!\n");
4039 ac97_release_codec(codec);
4040 break;
4041 }
4042 card->ac97_codec[num_ac97] = codec;
4043
4044 CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO
4045 "cs46xx: cs_ac97_init() ac97_codec[%d] set to %p\n",
4046 (unsigned int)num_ac97,
4047 codec));
4048 /* if there is no secondary codec at all, don't probe any more */
4049 if (!ready_2nd)
4050 {
4051 num_ac97 += 1;
4052 break;
4053 }
4054 }
4055 CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO
4056 "cs46xx: cs_ac97_init()- %d\n", (unsigned int)num_ac97));
4057 return num_ac97;
4058}
4059
4060/*
4061 * load the static image into the DSP
4062 */
4063#include "cs461x_image.h"
4064static void cs461x_download_image(struct cs_card *card)
4065{
4066 unsigned i, j, temp1, temp2, offset, count;
4067 unsigned char __iomem *pBA1 = ioremap(card->ba1_addr, 0x40000);
4068 for (i = 0; i < CLEAR__COUNT; i++) {
4069 offset = ClrStat[i].BA1__DestByteOffset;
4070 count = ClrStat[i].BA1__SourceSize;
4071 for (temp1 = offset; temp1 < (offset + count); temp1 += 4)
4072 writel(0, pBA1+temp1);
4073 }
4074
4075 for (i = 0; i < FILL__COUNT; i++) {
4076 temp2 = FillStat[i].Offset;
4077 for (j = 0; j < (FillStat[i].Size) / 4; j++) {
4078 temp1 = (FillStat[i]).pFill[j];
4079 writel(temp1, pBA1+temp2 + j * 4);
4080 }
4081 }
4082 iounmap(pBA1);
4083}
4084
4085/*
4086 * Chip reset
4087 */
4088
4089static void cs461x_reset(struct cs_card *card)
4090{
4091 int idx;
4092
4093 /*
4094 * Write the reset bit of the SP control register.
4095 */
4096 cs461x_poke(card, BA1_SPCR, SPCR_RSTSP);
4097
4098 /*
4099 * Write the control register.
4100 */
4101 cs461x_poke(card, BA1_SPCR, SPCR_DRQEN);
4102
4103 /*
4104 * Clear the trap registers.
4105 */
4106 for (idx = 0; idx < 8; idx++) {
4107 cs461x_poke(card, BA1_DREG, DREG_REGID_TRAP_SELECT + idx);
4108 cs461x_poke(card, BA1_TWPR, 0xFFFF);
4109 }
4110 cs461x_poke(card, BA1_DREG, 0);
4111
4112 /*
4113 * Set the frame timer to reflect the number of cycles per frame.
4114 */
4115 cs461x_poke(card, BA1_FRMT, 0xadf);
4116}
4117
4118static void cs461x_clear_serial_FIFOs(struct cs_card *card, int type)
4119{
4120 int idx, loop, startfifo=0, endfifo=0, powerdown1 = 0;
4121 unsigned int tmp;
4122
4123 /*
4124 * See if the devices are powered down. If so, we must power them up first
4125 * or they will not respond.
4126 */
4127 if (!((tmp = cs461x_peekBA0(card, BA0_CLKCR1)) & CLKCR1_SWCE)) {
4128 cs461x_pokeBA0(card, BA0_CLKCR1, tmp | CLKCR1_SWCE);
4129 powerdown1 = 1;
4130 }
4131
4132 /*
4133 * We want to clear out the serial port FIFOs so we don't end up playing
4134 * whatever random garbage happens to be in them. We fill the sample FIFOS
4135 * with zero (silence).
4136 */
4137 cs461x_pokeBA0(card, BA0_SERBWP, 0);
4138
4139 /*
4140 * Check for which FIFO locations to clear, if we are currently
4141 * playing or capturing then we don't want to put in 128 bytes of
4142 * "noise".
4143 */
4144 if (type & CS_TYPE_DAC) {
4145 startfifo = 128;
4146 endfifo = 256;
4147 }
4148 if (type & CS_TYPE_ADC) {
4149 startfifo = 0;
4150 if (!endfifo)
4151 endfifo = 128;
4152 }
4153 /*
4154 * Fill sample FIFO locations (256 locations total).
4155 */
4156 for (idx = startfifo; idx < endfifo; idx++) {
4157 /*
4158 * Make sure the previous FIFO write operation has completed.
4159 */
4160 for (loop = 0; loop < 5; loop++) {
4161 udelay(50);
4162 if (!(cs461x_peekBA0(card, BA0_SERBST) & SERBST_WBSY))
4163 break;
4164 }
4165 if (cs461x_peekBA0(card, BA0_SERBST) & SERBST_WBSY) {
4166 if (powerdown1)
4167 cs461x_pokeBA0(card, BA0_CLKCR1, tmp);
4168 }
4169 /*
4170 * Write the serial port FIFO index.
4171 */
4172 cs461x_pokeBA0(card, BA0_SERBAD, idx);
4173 /*
4174 * Tell the serial port to load the new value into the FIFO location.
4175 */
4176 cs461x_pokeBA0(card, BA0_SERBCM, SERBCM_WRC);
4177 }
4178 /*
4179 * Now, if we powered up the devices, then power them back down again.
4180 * This is kinda ugly, but should never happen.
4181 */
4182 if (powerdown1)
4183 cs461x_pokeBA0(card, BA0_CLKCR1, tmp);
4184}
4185
4186
4187static int cs461x_powerdown(struct cs_card *card, unsigned int type, int suspendflag)
4188{
4189 int count;
4190 unsigned int tmp=0,muted=0;
4191
4192 CS_DBGOUT(CS_FUNCTION, 4, printk(KERN_INFO
4193 "cs46xx: cs461x_powerdown()+ type=0x%x\n",type));
4194 if (!cs_powerdown && !suspendflag) {
4195 CS_DBGOUT(CS_FUNCTION, 8, printk(KERN_INFO
4196 "cs46xx: cs461x_powerdown() DISABLED exiting\n"));
4197 return 0;
4198 }
4199 tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL);
4200 CS_DBGOUT(CS_FUNCTION, 8, printk(KERN_INFO
4201 "cs46xx: cs461x_powerdown() powerdown reg=0x%x\n",tmp));
4202/*
4203* if powering down only the VREF, and not powering down the DAC/ADC,
4204* then do not power down the VREF, UNLESS both the DAC and ADC are not
4205* currently powered down. If powering down DAC and ADC, then
4206* it is possible to power down the VREF (ON).
4207*/
4208 if (((type & CS_POWER_MIXVON) &&
4209 (!(type & CS_POWER_ADC) || (!(type & CS_POWER_DAC))))
4210 &&
4211 ((tmp & CS_AC97_POWER_CONTROL_ADC_ON) ||
4212 (tmp & CS_AC97_POWER_CONTROL_DAC_ON))) {
4213 CS_DBGOUT(CS_FUNCTION, 8, printk(KERN_INFO
4214 "cs46xx: cs461x_powerdown()- 0 unable to powerdown. tmp=0x%x\n",tmp));
4215 return 0;
4216 }
4217/*
4218* for now, always keep power to the mixer block.
4219* not sure why it's a problem but it seems to be if we power off.
4220*/
4221 type &= ~CS_POWER_MIXVON;
4222 type &= ~CS_POWER_MIXVOFF;
4223
4224 /*
4225 * Power down indicated areas.
4226 */
4227 if (type & CS_POWER_MIXVOFF) {
4228
4229 CS_DBGOUT(CS_FUNCTION, 4,
4230 printk(KERN_INFO "cs46xx: cs461x_powerdown()+ MIXVOFF\n"));
4231 /*
4232 * Power down the MIXER (VREF ON) on the AC97 card.
4233 */
4234 tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL);
4235 if (tmp & CS_AC97_POWER_CONTROL_MIXVOFF_ON) {
4236 if (!muted) {
4237 cs_mute(card, CS_TRUE);
4238 muted = 1;
4239 }
4240 tmp |= CS_AC97_POWER_CONTROL_MIXVOFF;
4241 cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp );
4242 /*
4243 * Now, we wait until we sample a ready state.
4244 */
4245 for (count = 0; count < 32; count++) {
4246 /*
4247 * First, lets wait a short while to let things settle out a
4248 * bit, and to prevent retrying the read too quickly.
4249 */
4250 udelay(500);
4251
4252 /*
4253 * Read the current state of the power control register.
4254 */
4255 if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4256 CS_AC97_POWER_CONTROL_MIXVOFF_ON))
4257 break;
4258 }
4259
4260 /*
4261 * Check the status..
4262 */
4263 if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4264 CS_AC97_POWER_CONTROL_MIXVOFF_ON) {
4265 CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING
4266 "cs46xx: powerdown MIXVOFF failed\n"));
4267 return 1;
4268 }
4269 }
4270 }
4271 if (type & CS_POWER_MIXVON) {
4272
4273 CS_DBGOUT(CS_FUNCTION, 4,
4274 printk(KERN_INFO "cs46xx: cs461x_powerdown()+ MIXVON\n"));
4275 /*
4276 * Power down the MIXER (VREF ON) on the AC97 card.
4277 */
4278 tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL);
4279 if (tmp & CS_AC97_POWER_CONTROL_MIXVON_ON) {
4280 if (!muted) {
4281 cs_mute(card, CS_TRUE);
4282 muted = 1;
4283 }
4284 tmp |= CS_AC97_POWER_CONTROL_MIXVON;
4285 cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp);
4286 /*
4287 * Now, we wait until we sample a ready state.
4288 */
4289 for (count = 0; count < 32; count++) {
4290 /*
4291 * First, lets wait a short while to let things settle out a
4292 * bit, and to prevent retrying the read too quickly.
4293 */
4294 udelay(500);
4295
4296 /*
4297 * Read the current state of the power control register.
4298 */
4299 if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4300 CS_AC97_POWER_CONTROL_MIXVON_ON))
4301 break;
4302 }
4303
4304 /*
4305 * Check the status..
4306 */
4307 if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4308 CS_AC97_POWER_CONTROL_MIXVON_ON) {
4309 CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING
4310 "cs46xx: powerdown MIXVON failed\n"));
4311 return 1;
4312 }
4313 }
4314 }
4315 if (type & CS_POWER_ADC) {
4316 /*
4317 * Power down the ADC on the AC97 card.
4318 */
4319 CS_DBGOUT(CS_FUNCTION, 4, printk(KERN_INFO "cs46xx: cs461x_powerdown()+ ADC\n"));
4320 tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL);
4321 if (tmp & CS_AC97_POWER_CONTROL_ADC_ON) {
4322 if (!muted) {
4323 cs_mute(card, CS_TRUE);
4324 muted = 1;
4325 }
4326 tmp |= CS_AC97_POWER_CONTROL_ADC;
4327 cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp);
4328
4329 /*
4330 * Now, we wait until we sample a ready state.
4331 */
4332 for (count = 0; count < 32; count++) {
4333 /*
4334 * First, lets wait a short while to let things settle out a
4335 * bit, and to prevent retrying the read too quickly.
4336 */
4337 udelay(500);
4338
4339 /*
4340 * Read the current state of the power control register.
4341 */
4342 if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4343 CS_AC97_POWER_CONTROL_ADC_ON))
4344 break;
4345 }
4346
4347 /*
4348 * Check the status..
4349 */
4350 if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4351 CS_AC97_POWER_CONTROL_ADC_ON) {
4352 CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING
4353 "cs46xx: powerdown ADC failed\n"));
4354 return 1;
4355 }
4356 }
4357 }
4358 if (type & CS_POWER_DAC) {
4359 /*
4360 * Power down the DAC on the AC97 card.
4361 */
4362
4363 CS_DBGOUT(CS_FUNCTION, 4,
4364 printk(KERN_INFO "cs46xx: cs461x_powerdown()+ DAC\n"));
4365 tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL);
4366 if (tmp & CS_AC97_POWER_CONTROL_DAC_ON) {
4367 if (!muted) {
4368 cs_mute(card, CS_TRUE);
4369 muted = 1;
4370 }
4371 tmp |= CS_AC97_POWER_CONTROL_DAC;
4372 cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp);
4373 /*
4374 * Now, we wait until we sample a ready state.
4375 */
4376 for (count = 0; count < 32; count++) {
4377 /*
4378 * First, lets wait a short while to let things settle out a
4379 * bit, and to prevent retrying the read too quickly.
4380 */
4381 udelay(500);
4382
4383 /*
4384 * Read the current state of the power control register.
4385 */
4386 if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4387 CS_AC97_POWER_CONTROL_DAC_ON))
4388 break;
4389 }
4390
4391 /*
4392 * Check the status..
4393 */
4394 if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4395 CS_AC97_POWER_CONTROL_DAC_ON) {
4396 CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING
4397 "cs46xx: powerdown DAC failed\n"));
4398 return 1;
4399 }
4400 }
4401 }
4402 tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL);
4403 if (muted)
4404 cs_mute(card, CS_FALSE);
4405 CS_DBGOUT(CS_FUNCTION, 4, printk(KERN_INFO
4406 "cs46xx: cs461x_powerdown()- 0 tmp=0x%x\n",tmp));
4407 return 0;
4408}
4409
4410static int cs46xx_powerup(struct cs_card *card, unsigned int type)
4411{
4412 int count;
4413 unsigned int tmp = 0, muted = 0;
4414
4415 CS_DBGOUT(CS_FUNCTION, 8, printk(KERN_INFO
4416 "cs46xx: cs46xx_powerup()+ type=0x%x\n",type));
4417 /*
4418 * check for VREF and powerup if need to.
4419 */
4420 if (type & CS_POWER_MIXVON)
4421 type |= CS_POWER_MIXVOFF;
4422 if (type & (CS_POWER_DAC | CS_POWER_ADC))
4423 type |= CS_POWER_MIXVON | CS_POWER_MIXVOFF;
4424
4425 /*
4426 * Power up indicated areas.
4427 */
4428 if (type & CS_POWER_MIXVOFF) {
4429
4430 CS_DBGOUT(CS_FUNCTION, 4,
4431 printk(KERN_INFO "cs46xx: cs46xx_powerup()+ MIXVOFF\n"));
4432 /*
4433 * Power up the MIXER (VREF ON) on the AC97 card.
4434 */
4435 tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL);
4436 if (!(tmp & CS_AC97_POWER_CONTROL_MIXVOFF_ON)) {
4437 if (!muted) {
4438 cs_mute(card, CS_TRUE);
4439 muted = 1;
4440 }
4441 tmp &= ~CS_AC97_POWER_CONTROL_MIXVOFF;
4442 cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp );
4443 /*
4444 * Now, we wait until we sample a ready state.
4445 */
4446 for (count = 0; count < 32; count++) {
4447 /*
4448 * First, lets wait a short while to let things settle out a
4449 * bit, and to prevent retrying the read too quickly.
4450 */
4451 udelay(500);
4452
4453 /*
4454 * Read the current state of the power control register.
4455 */
4456 if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4457 CS_AC97_POWER_CONTROL_MIXVOFF_ON)
4458 break;
4459 }
4460
4461 /*
4462 * Check the status..
4463 */
4464 if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4465 CS_AC97_POWER_CONTROL_MIXVOFF_ON)) {
4466 CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING
4467 "cs46xx: powerup MIXVOFF failed\n"));
4468 return 1;
4469 }
4470 }
4471 }
4472 if(type & CS_POWER_MIXVON) {
4473
4474 CS_DBGOUT(CS_FUNCTION, 4,
4475 printk(KERN_INFO "cs46xx: cs46xx_powerup()+ MIXVON\n"));
4476 /*
4477 * Power up the MIXER (VREF ON) on the AC97 card.
4478 */
4479 tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL);
4480 if (!(tmp & CS_AC97_POWER_CONTROL_MIXVON_ON)) {
4481 if (!muted) {
4482 cs_mute(card, CS_TRUE);
4483 muted = 1;
4484 }
4485 tmp &= ~CS_AC97_POWER_CONTROL_MIXVON;
4486 cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp );
4487 /*
4488 * Now, we wait until we sample a ready state.
4489 */
4490 for (count = 0; count < 32; count++) {
4491 /*
4492 * First, lets wait a short while to let things settle out a
4493 * bit, and to prevent retrying the read too quickly.
4494 */
4495 udelay(500);
4496
4497 /*
4498 * Read the current state of the power control register.
4499 */
4500 if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4501 CS_AC97_POWER_CONTROL_MIXVON_ON)
4502 break;
4503 }
4504
4505 /*
4506 * Check the status..
4507 */
4508 if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4509 CS_AC97_POWER_CONTROL_MIXVON_ON)) {
4510 CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING
4511 "cs46xx: powerup MIXVON failed\n"));
4512 return 1;
4513 }
4514 }
4515 }
4516 if (type & CS_POWER_ADC) {
4517 /*
4518 * Power up the ADC on the AC97 card.
4519 */
4520 CS_DBGOUT(CS_FUNCTION, 4, printk(KERN_INFO "cs46xx: cs46xx_powerup()+ ADC\n"));
4521 tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL);
4522 if (!(tmp & CS_AC97_POWER_CONTROL_ADC_ON)) {
4523 if (!muted) {
4524 cs_mute(card, CS_TRUE);
4525 muted = 1;
4526 }
4527 tmp &= ~CS_AC97_POWER_CONTROL_ADC;
4528 cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp );
4529
4530 /*
4531 * Now, we wait until we sample a ready state.
4532 */
4533 for (count = 0; count < 32; count++) {
4534 /*
4535 * First, lets wait a short while to let things settle out a
4536 * bit, and to prevent retrying the read too quickly.
4537 */
4538 udelay(500);
4539
4540 /*
4541 * Read the current state of the power control register.
4542 */
4543 if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4544 CS_AC97_POWER_CONTROL_ADC_ON)
4545 break;
4546 }
4547
4548 /*
4549 * Check the status..
4550 */
4551 if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4552 CS_AC97_POWER_CONTROL_ADC_ON)) {
4553 CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING
4554 "cs46xx: powerup ADC failed\n"));
4555 return 1;
4556 }
4557 }
4558 }
4559 if (type & CS_POWER_DAC) {
4560 /*
4561 * Power up the DAC on the AC97 card.
4562 */
4563
4564 CS_DBGOUT(CS_FUNCTION, 4,
4565 printk(KERN_INFO "cs46xx: cs46xx_powerup()+ DAC\n"));
4566 tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL);
4567 if (!(tmp & CS_AC97_POWER_CONTROL_DAC_ON)) {
4568 if (!muted) {
4569 cs_mute(card, CS_TRUE);
4570 muted = 1;
4571 }
4572 tmp &= ~CS_AC97_POWER_CONTROL_DAC;
4573 cs_ac97_set(card->ac97_codec[0], AC97_POWER_CONTROL, tmp );
4574 /*
4575 * Now, we wait until we sample a ready state.
4576 */
4577 for (count = 0; count < 32; count++) {
4578 /*
4579 * First, lets wait a short while to let things settle out a
4580 * bit, and to prevent retrying the read too quickly.
4581 */
4582 udelay(500);
4583
4584 /*
4585 * Read the current state of the power control register.
4586 */
4587 if (cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4588 CS_AC97_POWER_CONTROL_DAC_ON)
4589 break;
4590 }
4591
4592 /*
4593 * Check the status..
4594 */
4595 if (!(cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL) &
4596 CS_AC97_POWER_CONTROL_DAC_ON)) {
4597 CS_DBGOUT(CS_ERROR, 1, printk(KERN_WARNING
4598 "cs46xx: powerup DAC failed\n"));
4599 return 1;
4600 }
4601 }
4602 }
4603 tmp = cs_ac97_get(card->ac97_codec[0], AC97_POWER_CONTROL);
4604 if (muted)
4605 cs_mute(card, CS_FALSE);
4606 CS_DBGOUT(CS_FUNCTION, 4, printk(KERN_INFO
4607 "cs46xx: cs46xx_powerup()- 0 tmp=0x%x\n",tmp));
4608 return 0;
4609}
4610
4611static void cs461x_proc_start(struct cs_card *card)
4612{
4613 int cnt;
4614
4615 /*
4616 * Set the frame timer to reflect the number of cycles per frame.
4617 */
4618 cs461x_poke(card, BA1_FRMT, 0xadf);
4619 /*
4620 * Turn on the run, run at frame, and DMA enable bits in the local copy of
4621 * the SP control register.
4622 */
4623 cs461x_poke(card, BA1_SPCR, SPCR_RUN | SPCR_RUNFR | SPCR_DRQEN);
4624 /*
4625 * Wait until the run at frame bit resets itself in the SP control
4626 * register.
4627 */
4628 for (cnt = 0; cnt < 25; cnt++) {
4629 udelay(50);
4630 if (!(cs461x_peek(card, BA1_SPCR) & SPCR_RUNFR))
4631 break;
4632 }
4633
4634 if (cs461x_peek(card, BA1_SPCR) & SPCR_RUNFR)
4635 printk(KERN_WARNING "cs46xx: SPCR_RUNFR never reset\n");
4636}
4637
4638static void cs461x_proc_stop(struct cs_card *card)
4639{
4640 /*
4641 * Turn off the run, run at frame, and DMA enable bits in the local copy of
4642 * the SP control register.
4643 */
4644 cs461x_poke(card, BA1_SPCR, 0);
4645}
4646
4647static int cs_hardware_init(struct cs_card *card)
4648{
4649 unsigned long end_time;
4650 unsigned int tmp,count;
4651
4652 CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO
4653 "cs46xx: cs_hardware_init()+\n") );
4654 /*
4655 * First, blast the clock control register to zero so that the PLL starts
4656 * out in a known state, and blast the master serial port control register
4657 * to zero so that the serial ports also start out in a known state.
4658 */
4659 cs461x_pokeBA0(card, BA0_CLKCR1, 0);
4660 cs461x_pokeBA0(card, BA0_SERMC1, 0);
4661
4662 /*
4663 * If we are in AC97 mode, then we must set the part to a host controlled
4664 * AC-link. Otherwise, we won't be able to bring up the link.
4665 */
4666 cs461x_pokeBA0(card, BA0_SERACC, SERACC_HSP | SERACC_CODEC_TYPE_1_03); /* 1.03 card */
4667 /* cs461x_pokeBA0(card, BA0_SERACC, SERACC_HSP | SERACC_CODEC_TYPE_2_0); */ /* 2.00 card */
4668
4669 /*
4670 * Drive the ARST# pin low for a minimum of 1uS (as defined in the AC97
4671 * spec) and then drive it high. This is done for non AC97 modes since
4672 * there might be logic external to the CS461x that uses the ARST# line
4673 * for a reset.
4674 */
4675 cs461x_pokeBA0(card, BA0_ACCTL, 1);
4676 udelay(50);
4677 cs461x_pokeBA0(card, BA0_ACCTL, 0);
4678 udelay(50);
4679 cs461x_pokeBA0(card, BA0_ACCTL, ACCTL_RSTN);
4680
4681 /*
4682 * The first thing we do here is to enable sync generation. As soon
4683 * as we start receiving bit clock, we'll start producing the SYNC
4684 * signal.
4685 */
4686 cs461x_pokeBA0(card, BA0_ACCTL, ACCTL_ESYN | ACCTL_RSTN);
4687
4688 /*
4689 * Now wait for a short while to allow the AC97 part to start
4690 * generating bit clock (so we don't try to start the PLL without an
4691 * input clock).
4692 */
4693 mdelay(5 * cs_laptop_wait); /* 1 should be enough ?? (and pigs might fly) */
4694
4695 /*
4696 * Set the serial port timing configuration, so that
4697 * the clock control circuit gets its clock from the correct place.
4698 */
4699 cs461x_pokeBA0(card, BA0_SERMC1, SERMC1_PTC_AC97);
4700
4701 /*
4702 * The part seems to not be ready for a while after a resume.
4703 * so, if we are resuming, then wait for 700 mils. Note that 600 mils
4704 * is not enough for some platforms! tested on an IBM Thinkpads and
4705 * reference cards.
4706 */
4707 if (!(card->pm.flags & CS46XX_PM_IDLE))
4708 mdelay(initdelay);
4709 /*
4710 * Write the selected clock control setup to the hardware. Do not turn on
4711 * SWCE yet (if requested), so that the devices clocked by the output of
4712 * PLL are not clocked until the PLL is stable.
4713 */
4714 cs461x_pokeBA0(card, BA0_PLLCC, PLLCC_LPF_1050_2780_KHZ | PLLCC_CDR_73_104_MHZ);
4715 cs461x_pokeBA0(card, BA0_PLLM, 0x3a);
4716 cs461x_pokeBA0(card, BA0_CLKCR2, CLKCR2_PDIVS_8);
4717
4718 /*
4719 * Power up the PLL.
4720 */
4721 cs461x_pokeBA0(card, BA0_CLKCR1, CLKCR1_PLLP);
4722
4723 /*
4724 * Wait until the PLL has stabilized.
4725 */
4726 mdelay(5 * cs_laptop_wait); /* Again 1 should be enough ?? */
4727
4728 /*
4729 * Turn on clocking of the core so that we can setup the serial ports.
4730 */
4731 tmp = cs461x_peekBA0(card, BA0_CLKCR1) | CLKCR1_SWCE;
4732 cs461x_pokeBA0(card, BA0_CLKCR1, tmp);
4733
4734 /*
4735 * Fill the serial port FIFOs with silence.
4736 */
4737 cs461x_clear_serial_FIFOs(card,CS_TYPE_DAC | CS_TYPE_ADC);
4738
4739 /*
4740 * Set the serial port FIFO pointer to the first sample in the FIFO.
4741 */
4742 /* cs461x_pokeBA0(card, BA0_SERBSP, 0); */
4743
4744 /*
4745 * Write the serial port configuration to the part. The master
4746 * enable bit is not set until all other values have been written.
4747 */
4748 cs461x_pokeBA0(card, BA0_SERC1, SERC1_SO1F_AC97 | SERC1_SO1EN);
4749 cs461x_pokeBA0(card, BA0_SERC2, SERC2_SI1F_AC97 | SERC1_SO1EN);
4750 cs461x_pokeBA0(card, BA0_SERMC1, SERMC1_PTC_AC97 | SERMC1_MSPE);
4751
4752
4753 mdelay(5 * cs_laptop_wait); /* Shouldnt be needed ?? */
4754
4755/*
4756* If we are resuming under 2.2.x then we cannot schedule a timeout,
4757* so just spin the CPU.
4758*/
4759 if (card->pm.flags & CS46XX_PM_IDLE) {
4760 /*
4761 * Wait for the card ready signal from the AC97 card.
4762 */
4763 end_time = jiffies + 3 * (HZ >> 2);
4764 do {
4765 /*
4766 * Read the AC97 status register to see if we've seen a CODEC READY
4767 * signal from the AC97 card.
4768 */
4769 if (cs461x_peekBA0(card, BA0_ACSTS) & ACSTS_CRDY)
4770 break;
4771 current->state = TASK_UNINTERRUPTIBLE;
4772 schedule_timeout(1);
4773 } while (time_before(jiffies, end_time));
4774 } else {
4775 for (count = 0; count < 100; count++) {
4776 // First, we want to wait for a short time.
4777 udelay(25 * cs_laptop_wait);
4778
4779 if (cs461x_peekBA0(card, BA0_ACSTS) & ACSTS_CRDY)
4780 break;
4781 }
4782 }
4783
4784 /*
4785 * Make sure CODEC is READY.
4786 */
4787 if (!(cs461x_peekBA0(card, BA0_ACSTS) & ACSTS_CRDY)) {
4788 CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_WARNING
4789 "cs46xx: create - never read card ready from AC'97\n"));
4790 CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_WARNING
4791 "cs46xx: probably not a bug, try using the CS4232 driver,\n"));
4792 CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_WARNING
4793 "cs46xx: or turn off any automatic Power Management support in the BIOS.\n"));
4794 return -EIO;
4795 }
4796
4797 /*
4798 * Assert the vaid frame signal so that we can start sending commands
4799 * to the AC97 card.
4800 */
4801 cs461x_pokeBA0(card, BA0_ACCTL, ACCTL_VFRM | ACCTL_ESYN | ACCTL_RSTN);
4802
4803 if (card->pm.flags & CS46XX_PM_IDLE) {
4804 /*
4805 * Wait until we've sampled input slots 3 and 4 as valid, meaning that
4806 * the card is pumping ADC data across the AC-link.
4807 */
4808 end_time = jiffies + 3 * (HZ >> 2);
4809 do {
4810 /*
4811 * Read the input slot valid register and see if input slots 3 and
4812 * 4 are valid yet.
4813 */
4814 if ((cs461x_peekBA0(card, BA0_ACISV) & (ACISV_ISV3 | ACISV_ISV4)) == (ACISV_ISV3 | ACISV_ISV4))
4815 break;
4816 current->state = TASK_UNINTERRUPTIBLE;
4817 schedule_timeout(1);
4818 } while (time_before(jiffies, end_time));
4819 } else {
4820 for (count = 0; count < 100; count++) {
4821 // First, we want to wait for a short time.
4822 udelay(25 * cs_laptop_wait);
4823
4824 if ((cs461x_peekBA0(card, BA0_ACISV) & (ACISV_ISV3 | ACISV_ISV4)) == (ACISV_ISV3 | ACISV_ISV4))
4825 break;
4826 }
4827 }
4828 /*
4829 * Make sure input slots 3 and 4 are valid. If not, then return
4830 * an error.
4831 */
4832 if ((cs461x_peekBA0(card, BA0_ACISV) & (ACISV_ISV3 | ACISV_ISV4)) != (ACISV_ISV3 | ACISV_ISV4)) {
4833 printk(KERN_WARNING "cs46xx: create - never read ISV3 & ISV4 from AC'97\n");
4834 return -EIO;
4835 }
4836
4837 /*
4838 * Now, assert valid frame and the slot 3 and 4 valid bits. This will
4839 * commense the transfer of digital audio data to the AC97 card.
4840 */
4841 cs461x_pokeBA0(card, BA0_ACOSV, ACOSV_SLV3 | ACOSV_SLV4);
4842
4843 /*
4844 * Turn off the Processor by turning off the software clock enable flag in
4845 * the clock control register.
4846 */
4847 /* tmp = cs461x_peekBA0(card, BA0_CLKCR1) & ~CLKCR1_SWCE; */
4848 /* cs461x_pokeBA0(card, BA0_CLKCR1, tmp); */
4849
4850 /*
4851 * Reset the processor.
4852 */
4853 cs461x_reset(card);
4854
4855 /*
4856 * Download the image to the processor.
4857 */
4858
4859 cs461x_download_image(card);
4860
4861 /*
4862 * Stop playback DMA.
4863 */
4864 tmp = cs461x_peek(card, BA1_PCTL);
4865 card->pctl = tmp & 0xffff0000;
4866 cs461x_poke(card, BA1_PCTL, tmp & 0x0000ffff);
4867
4868 /*
4869 * Stop capture DMA.
4870 */
4871 tmp = cs461x_peek(card, BA1_CCTL);
4872 card->cctl = tmp & 0x0000ffff;
4873 cs461x_poke(card, BA1_CCTL, tmp & 0xffff0000);
4874
4875 /* initialize AC97 codec and register /dev/mixer */
4876 if (card->pm.flags & CS46XX_PM_IDLE) {
4877 if (cs_ac97_init(card) <= 0) {
4878 CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO
4879 "cs46xx: cs_ac97_init() failure\n"));
4880 return -EIO;
4881 }
4882 } else {
4883 cs46xx_ac97_resume(card);
4884 }
4885
4886 cs461x_proc_start(card);
4887
4888 /*
4889 * Enable interrupts on the part.
4890 */
4891 cs461x_pokeBA0(card, BA0_HICR, HICR_IEV | HICR_CHGM);
4892
4893 tmp = cs461x_peek(card, BA1_PFIE);
4894 tmp &= ~0x0000f03f;
4895 cs461x_poke(card, BA1_PFIE, tmp); /* playback interrupt enable */
4896
4897 tmp = cs461x_peek(card, BA1_CIE);
4898 tmp &= ~0x0000003f;
4899 tmp |= 0x00000001;
4900 cs461x_poke(card, BA1_CIE, tmp); /* capture interrupt enable */
4901
4902 /*
4903 * If IDLE then Power down the part. We will power components up
4904 * when we need them.
4905 */
4906 if (card->pm.flags & CS46XX_PM_IDLE) {
4907 if (!cs_powerdown) {
4908 if ((tmp = cs46xx_powerup(card, CS_POWER_DAC | CS_POWER_ADC |
4909 CS_POWER_MIXVON))) {
4910 CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO
4911 "cs46xx: cs461x_powerup() failure (0x%x)\n",tmp) );
4912 return -EIO;
4913 }
4914 } else {
4915 if ((tmp = cs461x_powerdown(card, CS_POWER_DAC | CS_POWER_ADC |
4916 CS_POWER_MIXVON, CS_FALSE))) {
4917 CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO
4918 "cs46xx: cs461x_powerdown() failure (0x%x)\n",tmp) );
4919 return -EIO;
4920 }
4921 }
4922 }
4923 CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO
4924 "cs46xx: cs_hardware_init()- 0\n"));
4925 return 0;
4926}
4927
4928/* install the driver, we do not allocate hardware channel nor DMA buffer now, they are defered
4929 until "ACCESS" time (in prog_dmabuf called by open/read/write/ioctl/mmap) */
4930
4931/*
4932 * Card subid table
4933 */
4934
4935struct cs_card_type
4936{
4937 u16 vendor;
4938 u16 id;
4939 char *name;
4940 void (*amp)(struct cs_card *, int);
4941 void (*amp_init)(struct cs_card *);
4942 void (*active)(struct cs_card *, int);
4943};
4944
4945static struct cs_card_type cards[] = {
4946 {
4947 .vendor = 0x1489,
4948 .id = 0x7001,
4949 .name = "Genius Soundmaker 128 value",
4950 .amp = amp_none,
4951 },
4952 {
4953 .vendor = 0x5053,
4954 .id = 0x3357,
4955 .name = "Voyetra",
4956 .amp = amp_voyetra,
4957 },
4958 {
4959 .vendor = 0x1071,
4960 .id = 0x6003,
4961 .name = "Mitac MI6020/21",
4962 .amp = amp_voyetra,
4963 },
4964 {
4965 .vendor = 0x14AF,
4966 .id = 0x0050,
4967 .name = "Hercules Game Theatre XP",
4968 .amp = amp_hercules,
4969 },
4970 {
4971 .vendor = 0x1681,
4972 .id = 0x0050,
4973 .name = "Hercules Game Theatre XP",
4974 .amp = amp_hercules,
4975 },
4976 {
4977 .vendor = 0x1681,
4978 .id = 0x0051,
4979 .name = "Hercules Game Theatre XP",
4980 .amp = amp_hercules,
4981 },
4982 {
4983 .vendor = 0x1681,
4984 .id = 0x0052,
4985 .name = "Hercules Game Theatre XP",
4986 .amp = amp_hercules,
4987 },
4988 {
4989 .vendor = 0x1681,
4990 .id = 0x0053,
4991 .name = "Hercules Game Theatre XP",
4992 .amp = amp_hercules,
4993 },
4994 {
4995 .vendor = 0x1681,
4996 .id = 0x0054,
4997 .name = "Hercules Game Theatre XP",
4998 .amp = amp_hercules,
4999 },
5000 {
5001 .vendor = 0x1681,
5002 .id = 0xa010,
5003 .name = "Hercules Fortissimo II",
5004 .amp = amp_none,
5005 },
5006 /* Not sure if the 570 needs the clkrun hack */
5007 {
5008 .vendor = PCI_VENDOR_ID_IBM,
5009 .id = 0x0132,
5010 .name = "Thinkpad 570",
5011 .amp = amp_none,
5012 .active = clkrun_hack,
5013 },
5014 {
5015 .vendor = PCI_VENDOR_ID_IBM,
5016 .id = 0x0153,
5017 .name = "Thinkpad 600X/A20/T20",
5018 .amp = amp_none,
5019 .active = clkrun_hack,
5020 },
5021 {
5022 .vendor = PCI_VENDOR_ID_IBM,
5023 .id = 0x1010,
5024 .name = "Thinkpad 600E (unsupported)",
5025 },
5026 {
5027 .name = "Card without SSID set",
5028 },
5029 { 0, },
5030};
5031
5032MODULE_AUTHOR("Alan Cox <alan@redhat.com>, Jaroslav Kysela, <pcaudio@crystal.cirrus.com>");
5033MODULE_DESCRIPTION("Crystal SoundFusion Audio Support");
5034MODULE_LICENSE("GPL");
5035
5036static const char cs46xx_banner[] = KERN_INFO "Crystal 4280/46xx + AC97 Audio, version " CS46XX_MAJOR_VERSION "." CS46XX_MINOR_VERSION "." CS46XX_ARCH ", " __TIME__ " " __DATE__ "\n";
5037static const char fndmsg[] = KERN_INFO "cs46xx: Found %d audio device(s).\n";
5038
5039static int __devinit cs46xx_probe(struct pci_dev *pci_dev,
5040 const struct pci_device_id *pciid)
5041{
5042 int i, j;
5043 u16 ss_card, ss_vendor;
5044 struct cs_card *card;
5045 dma_addr_t dma_mask;
5046 struct cs_card_type *cp = &cards[0];
5047
5048 CS_DBGOUT(CS_FUNCTION | CS_INIT, 2,
5049 printk(KERN_INFO "cs46xx: probe()+\n"));
5050
5051 dma_mask = 0xffffffff; /* this enables playback and recording */
5052 if (pci_enable_device(pci_dev)) {
5053 CS_DBGOUT(CS_INIT | CS_ERROR, 1, printk(KERN_ERR
5054 "cs46xx: pci_enable_device() failed\n"));
5055 return -1;
5056 }
5057 if (!RSRCISMEMORYREGION(pci_dev, 0) ||
5058 !RSRCISMEMORYREGION(pci_dev, 1)) {
5059 CS_DBGOUT(CS_ERROR, 1, printk(KERN_ERR
5060 "cs46xx: probe()- Memory region not assigned\n"));
5061 return -1;
5062 }
5063 if (pci_dev->irq == 0) {
5064 CS_DBGOUT(CS_ERROR, 1, printk(KERN_ERR
5065 "cs46xx: probe() IRQ not assigned\n"));
5066 return -1;
5067 }
5068 if (!pci_dma_supported(pci_dev, 0xffffffff)) {
5069 CS_DBGOUT(CS_ERROR, 1, printk(KERN_ERR
5070 "cs46xx: probe() architecture does not support 32bit PCI busmaster DMA\n"));
5071 return -1;
5072 }
5073 pci_read_config_word(pci_dev, PCI_SUBSYSTEM_VENDOR_ID, &ss_vendor);
5074 pci_read_config_word(pci_dev, PCI_SUBSYSTEM_ID, &ss_card);
5075
5076 if ((card = kzalloc(sizeof(struct cs_card), GFP_KERNEL)) == NULL) {
5077 printk(KERN_ERR "cs46xx: out of memory\n");
5078 return -ENOMEM;
5079 }
5080 card->ba0_addr = RSRCADDRESS(pci_dev, 0);
5081 card->ba1_addr = RSRCADDRESS(pci_dev, 1);
5082 card->pci_dev = pci_dev;
5083 card->irq = pci_dev->irq;
5084 card->magic = CS_CARD_MAGIC;
5085 spin_lock_init(&card->lock);
5086 spin_lock_init(&card->ac97_lock);
5087
5088 pci_set_master(pci_dev);
5089
5090 printk(cs46xx_banner);
5091 printk(KERN_INFO "cs46xx: Card found at 0x%08lx and 0x%08lx, IRQ %d\n",
5092 card->ba0_addr, card->ba1_addr, card->irq);
5093
5094 card->alloc_pcm_channel = cs_alloc_pcm_channel;
5095 card->alloc_rec_pcm_channel = cs_alloc_rec_pcm_channel;
5096 card->free_pcm_channel = cs_free_pcm_channel;
5097 card->amplifier_ctrl = amp_none;
5098 card->active_ctrl = amp_none;
5099
5100 while (cp->name)
5101 {
5102 if (cp->vendor == ss_vendor && cp->id == ss_card) {
5103 card->amplifier_ctrl = cp->amp;
5104 if (cp->active)
5105 card->active_ctrl = cp->active;
5106 if (cp->amp_init)
5107 card->amp_init = cp->amp_init;
5108 break;
5109 }
5110 cp++;
5111 }
5112 if (cp->name == NULL) {
5113 printk(KERN_INFO "cs46xx: Unknown card (%04X:%04X) at 0x%08lx/0x%08lx, IRQ %d\n",
5114 ss_vendor, ss_card, card->ba0_addr, card->ba1_addr, card->irq);
5115 } else {
5116 printk(KERN_INFO "cs46xx: %s (%04X:%04X) at 0x%08lx/0x%08lx, IRQ %d\n",
5117 cp->name, ss_vendor, ss_card, card->ba0_addr, card->ba1_addr, card->irq);
5118 }
5119
5120 if (card->amplifier_ctrl == NULL) {
5121 card->amplifier_ctrl = amp_none;
5122 card->active_ctrl = clkrun_hack;
5123 }
5124
5125 if (external_amp == 1) {
5126 printk(KERN_INFO "cs46xx: Crystal EAPD support forced on.\n");
5127 card->amplifier_ctrl = amp_voyetra;
5128 }
5129
5130 if (thinkpad == 1) {
5131 printk(KERN_INFO "cs46xx: Activating CLKRUN hack for Thinkpad.\n");
5132 card->active_ctrl = clkrun_hack;
5133 }
5134/*
5135* The thinkpads don't work well without runtime updating on their kernel
5136* delay values (or any laptop with variable CPU speeds really).
5137* so, just to be safe set the init delay to 2100. Eliminates
5138* failures on T21 Thinkpads. remove this code when the udelay
5139* and mdelay kernel code is replaced by a pm timer, or the delays
5140* work well for battery and/or AC power both.
5141*/
5142 if (card->active_ctrl == clkrun_hack) {
5143 initdelay = 2100;
5144 cs_laptop_wait = 5;
5145 }
5146 if ((card->active_ctrl == clkrun_hack) && !(powerdown == 1)) {
5147/*
5148* for some currently unknown reason, powering down the DAC and ADC component
5149* blocks on thinkpads causes some funky behavior... distoorrrtion and ac97
5150* codec access problems. probably the serial clock becomes unsynced.
5151* added code to sync the chips back up, but only helped about 70% the time.
5152*/
5153 cs_powerdown = 0;
5154 }
5155 if (powerdown == 0)
5156 cs_powerdown = 0;
5157 card->active_ctrl(card, 1);
5158
5159 /* claim our iospace and irq */
5160
5161 card->ba0 = ioremap_nocache(card->ba0_addr, CS461X_BA0_SIZE);
5162 card->ba1.name.data0 = ioremap_nocache(card->ba1_addr + BA1_SP_DMEM0, CS461X_BA1_DATA0_SIZE);
5163 card->ba1.name.data1 = ioremap_nocache(card->ba1_addr + BA1_SP_DMEM1, CS461X_BA1_DATA1_SIZE);
5164 card->ba1.name.pmem = ioremap_nocache(card->ba1_addr + BA1_SP_PMEM, CS461X_BA1_PRG_SIZE);
5165 card->ba1.name.reg = ioremap_nocache(card->ba1_addr + BA1_SP_REG, CS461X_BA1_REG_SIZE);
5166
5167 CS_DBGOUT(CS_INIT, 4, printk(KERN_INFO
5168 "cs46xx: card=%p card->ba0=%p\n",card,card->ba0) );
5169 CS_DBGOUT(CS_INIT, 4, printk(KERN_INFO
5170 "cs46xx: card->ba1=%p %p %p %p\n",
5171 card->ba1.name.data0,
5172 card->ba1.name.data1,
5173 card->ba1.name.pmem,
5174 card->ba1.name.reg) );
5175
5176 if (card->ba0 == 0 || card->ba1.name.data0 == 0 ||
5177 card->ba1.name.data1 == 0 || card->ba1.name.pmem == 0 ||
5178 card->ba1.name.reg == 0)
5179 goto fail2;
5180
5181 if (request_irq(card->irq, &cs_interrupt, IRQF_SHARED, "cs46xx", card)) {
5182 printk(KERN_ERR "cs46xx: unable to allocate irq %d\n", card->irq);
5183 goto fail2;
5184 }
5185 /* register /dev/dsp */
5186 if ((card->dev_audio = register_sound_dsp(&cs461x_fops, -1)) < 0) {
5187 printk(KERN_ERR "cs46xx: unable to register dsp\n");
5188 goto fail;
5189 }
5190
5191 /* register /dev/midi */
5192 if ((card->dev_midi = register_sound_midi(&cs_midi_fops, -1)) < 0)
5193 printk(KERN_ERR "cs46xx: unable to register midi\n");
5194
5195 card->pm.flags |= CS46XX_PM_IDLE;
5196 for (i = 0; i < 5; i++) {
5197 if (cs_hardware_init(card) != 0) {
5198 CS_DBGOUT(CS_ERROR, 4, printk(
5199 "cs46xx: ERROR in cs_hardware_init()... retrying\n"));
5200 for (j = 0; j < NR_AC97; j++)
5201 if (card->ac97_codec[j] != NULL) {
5202 unregister_sound_mixer(card->ac97_codec[j]->dev_mixer);
5203 ac97_release_codec(card->ac97_codec[j]);
5204 }
5205 mdelay(10 * cs_laptop_wait);
5206 continue;
5207 }
5208 break;
5209 }
5210 if(i >= 4) {
5211 CS_DBGOUT(CS_PM | CS_ERROR, 1, printk(
5212 "cs46xx: cs46xx_probe()- cs_hardware_init() failed, retried %d times.\n",i));
5213 unregister_sound_dsp(card->dev_audio);
5214 if (card->dev_midi)
5215 unregister_sound_midi(card->dev_midi);
5216 goto fail;
5217 }
5218
5219 init_waitqueue_head(&card->midi.open_wait);
5220 mutex_init(&card->midi.open_mutex);
5221 init_waitqueue_head(&card->midi.iwait);
5222 init_waitqueue_head(&card->midi.owait);
5223 cs461x_pokeBA0(card, BA0_MIDCR, MIDCR_MRST);
5224 cs461x_pokeBA0(card, BA0_MIDCR, 0);
5225
5226 /*
5227 * Check if we have to init the amplifier, but probably already done
5228 * since the CD logic in the ac97 init code will turn on the ext amp.
5229 */
5230 if (cp->amp_init)
5231 cp->amp_init(card);
5232 card->active_ctrl(card, -1);
5233
5234 PCI_SET_DRIVER_DATA(pci_dev, card);
5235 PCI_SET_DMA_MASK(pci_dev, dma_mask);
5236 list_add(&card->list, &cs46xx_devs);
5237
5238 CS_DBGOUT(CS_PM, 9, printk(KERN_INFO "cs46xx: pm.flags=0x%x card=%p\n",
5239 (unsigned)card->pm.flags,card));
5240
5241 CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, printk(KERN_INFO
5242 "cs46xx: probe()- device allocated successfully\n"));
5243 return 0;
5244
5245fail:
5246 free_irq(card->irq, card);
5247fail2:
5248 if (card->ba0)
5249 iounmap(card->ba0);
5250 if (card->ba1.name.data0)
5251 iounmap(card->ba1.name.data0);
5252 if (card->ba1.name.data1)
5253 iounmap(card->ba1.name.data1);
5254 if (card->ba1.name.pmem)
5255 iounmap(card->ba1.name.pmem);
5256 if (card->ba1.name.reg)
5257 iounmap(card->ba1.name.reg);
5258 kfree(card);
5259 CS_DBGOUT(CS_INIT | CS_ERROR, 1, printk(KERN_INFO
5260 "cs46xx: probe()- no device allocated\n"));
5261 return -ENODEV;
5262} // probe_cs46xx
5263
5264// ---------------------------------------------------------------------
5265
5266static void __devexit cs46xx_remove(struct pci_dev *pci_dev)
5267{
5268 struct cs_card *card = PCI_GET_DRIVER_DATA(pci_dev);
5269 int i;
5270 unsigned int tmp;
5271
5272 CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, printk(KERN_INFO
5273 "cs46xx: cs46xx_remove()+\n"));
5274
5275 card->active_ctrl(card,1);
5276
5277 tmp = cs461x_peek(card, BA1_PFIE);
5278 tmp &= ~0x0000f03f;
5279 tmp |= 0x00000010;
5280 cs461x_poke(card, BA1_PFIE, tmp); /* playback interrupt disable */
5281
5282 tmp = cs461x_peek(card, BA1_CIE);
5283 tmp &= ~0x0000003f;
5284 tmp |= 0x00000011;
5285 cs461x_poke(card, BA1_CIE, tmp); /* capture interrupt disable */
5286
5287 /*
5288 * Stop playback DMA.
5289 */
5290 tmp = cs461x_peek(card, BA1_PCTL);
5291 cs461x_poke(card, BA1_PCTL, tmp & 0x0000ffff);
5292
5293 /*
5294 * Stop capture DMA.
5295 */
5296 tmp = cs461x_peek(card, BA1_CCTL);
5297 cs461x_poke(card, BA1_CCTL, tmp & 0xffff0000);
5298
5299 /*
5300 * Reset the processor.
5301 */
5302 cs461x_reset(card);
5303
5304 cs461x_proc_stop(card);
5305
5306 /*
5307 * Power down the DAC and ADC. We will power them up (if) when we need
5308 * them.
5309 */
5310 if ((tmp = cs461x_powerdown(card, CS_POWER_DAC | CS_POWER_ADC |
5311 CS_POWER_MIXVON, CS_TRUE))) {
5312 CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(KERN_INFO
5313 "cs46xx: cs461x_powerdown() failure (0x%x)\n",tmp) );
5314 }
5315
5316 /*
5317 * Power down the PLL.
5318 */
5319 cs461x_pokeBA0(card, BA0_CLKCR1, 0);
5320
5321 /*
5322 * Turn off the Processor by turning off the software clock enable flag in
5323 * the clock control register.
5324 */
5325 tmp = cs461x_peekBA0(card, BA0_CLKCR1) & ~CLKCR1_SWCE;
5326 cs461x_pokeBA0(card, BA0_CLKCR1, tmp);
5327
5328 card->active_ctrl(card,-1);
5329
5330 /* free hardware resources */
5331 free_irq(card->irq, card);
5332 iounmap(card->ba0);
5333 iounmap(card->ba1.name.data0);
5334 iounmap(card->ba1.name.data1);
5335 iounmap(card->ba1.name.pmem);
5336 iounmap(card->ba1.name.reg);
5337
5338 /* unregister audio devices */
5339 for (i = 0; i < NR_AC97; i++)
5340 if (card->ac97_codec[i] != NULL) {
5341 unregister_sound_mixer(card->ac97_codec[i]->dev_mixer);
5342 ac97_release_codec(card->ac97_codec[i]);
5343 }
5344 unregister_sound_dsp(card->dev_audio);
5345 if (card->dev_midi)
5346 unregister_sound_midi(card->dev_midi);
5347 list_del(&card->list);
5348 kfree(card);
5349 PCI_SET_DRIVER_DATA(pci_dev,NULL);
5350
5351 CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, printk(KERN_INFO
5352 "cs46xx: cs46xx_remove()-: remove successful\n"));
5353}
5354
5355enum {
5356 CS46XX_4610 = 0,
5357 CS46XX_4612, /* same as 4630 */
5358 CS46XX_4615, /* same as 4624 */
5359};
5360
5361static struct pci_device_id cs46xx_pci_tbl[] = {
5362 {
5363 .vendor = PCI_VENDOR_ID_CIRRUS,
5364 .device = PCI_DEVICE_ID_CIRRUS_4610,
5365 .subvendor = PCI_ANY_ID,
5366 .subdevice = PCI_ANY_ID,
5367 .driver_data = CS46XX_4610,
5368 },
5369 {
5370 .vendor = PCI_VENDOR_ID_CIRRUS,
5371 .device = PCI_DEVICE_ID_CIRRUS_4612,
5372 .subvendor = PCI_ANY_ID,
5373 .subdevice = PCI_ANY_ID,
5374 .driver_data = CS46XX_4612,
5375 },
5376 {
5377 .vendor = PCI_VENDOR_ID_CIRRUS,
5378 .device = PCI_DEVICE_ID_CIRRUS_4615,
5379 .subvendor = PCI_ANY_ID,
5380 .subdevice = PCI_ANY_ID,
5381 .driver_data = CS46XX_4615,
5382 },
5383 { 0, },
5384};
5385
5386MODULE_DEVICE_TABLE(pci, cs46xx_pci_tbl);
5387
5388static struct pci_driver cs46xx_pci_driver = {
5389 .name = "cs46xx",
5390 .id_table = cs46xx_pci_tbl,
5391 .probe = cs46xx_probe,
5392 .remove = __devexit_p(cs46xx_remove),
5393#ifdef CONFIG_PM
5394 .suspend = cs46xx_suspend_tbl,
5395 .resume = cs46xx_resume_tbl,
5396#endif
5397};
5398
5399static int __init cs46xx_init_module(void)
5400{
5401 int rtn = 0;
5402 CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, printk(KERN_INFO
5403 "cs46xx: cs46xx_init_module()+ \n"));
5404 rtn = pci_register_driver(&cs46xx_pci_driver);
5405
5406 if (rtn == -ENODEV) {
5407 CS_DBGOUT(CS_ERROR | CS_INIT, 1, printk(
5408 "cs46xx: Unable to detect valid cs46xx device\n"));
5409 }
5410
5411 CS_DBGOUT(CS_INIT | CS_FUNCTION, 2,
5412 printk(KERN_INFO "cs46xx: cs46xx_init_module()- (%d)\n",rtn));
5413 return rtn;
5414}
5415
5416static void __exit cs46xx_cleanup_module(void)
5417{
5418 pci_unregister_driver(&cs46xx_pci_driver);
5419 CS_DBGOUT(CS_INIT | CS_FUNCTION, 2,
5420 printk(KERN_INFO "cs46xx: cleanup_cs46xx() finished\n"));
5421}
5422
5423module_init(cs46xx_init_module);
5424module_exit(cs46xx_cleanup_module);
5425
5426#ifdef CONFIG_PM
5427static int cs46xx_suspend_tbl(struct pci_dev *pcidev, pm_message_t state)
5428{
5429 struct cs_card *s = PCI_GET_DRIVER_DATA(pcidev);
5430 CS_DBGOUT(CS_PM | CS_FUNCTION, 2,
5431 printk(KERN_INFO "cs46xx: cs46xx_suspend_tbl request\n"));
5432 cs46xx_suspend(s, state);
5433 return 0;
5434}
5435
5436static int cs46xx_resume_tbl(struct pci_dev *pcidev)
5437{
5438 struct cs_card *s = PCI_GET_DRIVER_DATA(pcidev);
5439 CS_DBGOUT(CS_PM | CS_FUNCTION, 2,
5440 printk(KERN_INFO "cs46xx: cs46xx_resume_tbl request\n"));
5441 cs46xx_resume(s);
5442 return 0;
5443}
5444#endif
diff --git a/sound/oss/cs46xx_wrapper-24.h b/sound/oss/cs46xx_wrapper-24.h
deleted file mode 100644
index f68e01181a7c..000000000000
--- a/sound/oss/cs46xx_wrapper-24.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*******************************************************************************
2*
3* "cs46xx_wrapper.c" -- Cirrus Logic-Crystal CS46XX linux audio driver.
4*
5* Copyright (C) 2000,2001 Cirrus Logic Corp.
6* -- tom woller (twoller@crystal.cirrus.com) or
7* (pcaudio@crystal.cirrus.com).
8*
9* This program is free software; you can redistribute it and/or modify
10* it under the terms of the GNU General Public License as published by
11* the Free Software Foundation; either version 2 of the License, or
12* (at your option) any later version.
13*
14* This program is distributed in the hope that it will be useful,
15* but WITHOUT ANY WARRANTY; without even the implied warranty of
16* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17* GNU General Public License for more details.
18*
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
21* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22*
23* 01/11/2001 trw - new file from cs4281 wrapper code.
24*
25*******************************************************************************/
26#ifndef __CS46XX_WRAPPER24_H
27#define __CS46XX_WRAPPER24_H
28
29#include <linux/spinlock.h>
30
31#define CS_OWNER .owner =
32#define CS_THIS_MODULE THIS_MODULE,
33static inline void cs46xx_null(struct pci_dev *pcidev) { return; }
34#define cs4x_mem_map_reserve(page) SetPageReserved(page)
35#define cs4x_mem_map_unreserve(page) ClearPageReserved(page)
36
37#define free_dmabuf(card, dmabuf) \
38 pci_free_consistent((card)->pci_dev, \
39 PAGE_SIZE << (dmabuf)->buforder, \
40 (dmabuf)->rawbuf, (dmabuf)->dmaaddr);
41#define free_dmabuf2(card, dmabuf) \
42 pci_free_consistent((card)->pci_dev, \
43 PAGE_SIZE << (dmabuf)->buforder_tmpbuff, \
44 (dmabuf)->tmpbuff, (dmabuf)->dmaaddr_tmpbuff);
45#define cs4x_pgoff(vma) ((vma)->vm_pgoff)
46
47#define RSRCISIOREGION(dev,num) ((dev)->resource[(num)].start != 0 && \
48 ((dev)->resource[(num)].flags & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO)
49#define RSRCISMEMORYREGION(dev,num) ((dev)->resource[(num)].start != 0 && \
50 ((dev)->resource[(num)].flags & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_MEMORY)
51#define RSRCADDRESS(dev,num) ((dev)->resource[(num)].start)
52#define PCI_GET_DRIVER_DATA pci_get_drvdata
53#define PCI_SET_DRIVER_DATA pci_set_drvdata
54#define PCI_SET_DMA_MASK(pcidev,mask) pcidev->dma_mask = mask
55
56#endif
diff --git a/sound/oss/cs46xxpm.h b/sound/oss/cs46xxpm.h
deleted file mode 100644
index 2932b6e0e0bb..000000000000
--- a/sound/oss/cs46xxpm.h
+++ /dev/null
@@ -1,70 +0,0 @@
1/*******************************************************************************
2*
3* "cs46xxpm.h" -- Cirrus Logic-Crystal CS46XX linux audio driver.
4*
5* Copyright (C) 2000,2001 Cirrus Logic Corp.
6* -- tom woller (twoller@crystal.cirrus.com) or
7* (pcaudio@crystal.cirrus.com).
8*
9* This program is free software; you can redistribute it and/or modify
10* it under the terms of the GNU General Public License as published by
11* the Free Software Foundation; either version 2 of the License, or
12* (at your option) any later version.
13*
14* This program is distributed in the hope that it will be useful,
15* but WITHOUT ANY WARRANTY; without even the implied warranty of
16* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17* GNU General Public License for more details.
18*
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
21* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22*
23* 12/22/00 trw - new file.
24*
25*******************************************************************************/
26#ifndef __CS46XXPM_H
27#define __CS46XXPM_H
28
29#define CS46XX_AC97_HIGHESTREGTORESTORE 0x26
30#define CS46XX_AC97_NUMBER_RESTORE_REGS (CS46XX_AC97_HIGHESTREGTORESTORE/2-1)
31
32/* PM state defintions */
33#define CS46XX_PM_NOT_REGISTERED 0x1000
34#define CS46XX_PM_IDLE 0x0001
35#define CS46XX_PM_SUSPENDING 0x0002
36#define CS46XX_PM_SUSPENDED 0x0004
37#define CS46XX_PM_RESUMING 0x0008
38#define CS46XX_PM_RESUMED 0x0010
39
40#define CS_POWER_DAC 0x0001
41#define CS_POWER_ADC 0x0002
42#define CS_POWER_MIXVON 0x0004
43#define CS_POWER_MIXVOFF 0x0008
44#define CS_AC97_POWER_CONTROL_ON 0xf000 /* always on bits (inverted) */
45#define CS_AC97_POWER_CONTROL_ADC 0x0100
46#define CS_AC97_POWER_CONTROL_DAC 0x0200
47#define CS_AC97_POWER_CONTROL_MIXVON 0x0400
48#define CS_AC97_POWER_CONTROL_MIXVOFF 0x0800
49#define CS_AC97_POWER_CONTROL_ADC_ON 0x0001
50#define CS_AC97_POWER_CONTROL_DAC_ON 0x0002
51#define CS_AC97_POWER_CONTROL_MIXVON_ON 0x0004
52#define CS_AC97_POWER_CONTROL_MIXVOFF_ON 0x0008
53
54struct cs46xx_pm {
55 unsigned long flags;
56 u32 u32CLKCR1_SAVE,u32SSPMValue,u32PPLVCvalue,u32PPRVCvalue;
57 u32 u32FMLVCvalue,u32FMRVCvalue,u32GPIORvalue,u32JSCTLvalue,u32SSCR;
58 u32 u32SRCSA,u32DacASR,u32AdcASR,u32DacSR,u32AdcSR,u32MIDCR_Save;
59 u32 u32SSPM_BITS;
60 u32 ac97[CS46XX_AC97_NUMBER_RESTORE_REGS];
61 u32 u32AC97_master_volume, u32AC97_headphone_volume, u32AC97_master_volume_mono;
62 u32 u32AC97_pcm_out_volume, u32AC97_powerdown, u32AC97_general_purpose;
63 u32 u32hwptr_playback,u32hwptr_capture;
64 unsigned dmabuf_swptr_play;
65 int dmabuf_count_play;
66 unsigned dmabuf_swptr_capture;
67 int dmabuf_count_capture;
68};
69
70#endif
diff --git a/sound/oss/emu10k1/8010.h b/sound/oss/emu10k1/8010.h
deleted file mode 100644
index 61c6c42bbc36..000000000000
--- a/sound/oss/emu10k1/8010.h
+++ /dev/null
@@ -1,737 +0,0 @@
1/*
2 **********************************************************************
3 * 8010.h
4 * Copyright 1999-2001 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 * November 2, 1999 Alan Cox Cleaned of 8bit chars, DOS
12 * line endings
13 * December 8, 1999 Jon Taylor Added lots of new register info
14 * May 16, 2001 Daniel Bertrand Added unofficial DBG register info
15 * Oct-Nov 2001 D.B. Added unofficial Audigy registers
16 *
17 **********************************************************************
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License as
21 * published by the Free Software Foundation; either version 2 of
22 * the License, or (at your option) any later version.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
28 *
29 * You should have received a copy of the GNU General Public
30 * License along with this program; if not, write to the Free
31 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
32 * USA.
33 *
34 *
35 **********************************************************************
36 */
37
38
39#ifndef _8010_H
40#define _8010_H
41
42#include <linux/types.h>
43
44// Driver version:
45#define MAJOR_VER 0
46#define MINOR_VER 20
47#define DRIVER_VERSION "0.20a"
48
49
50// Audigy specify registers are prefixed with 'A_'
51
52/************************************************************************************************/
53/* PCI function 0 registers, address = <val> + PCIBASE0 */
54/************************************************************************************************/
55
56#define PTR 0x00 /* Indexed register set pointer register */
57 /* NOTE: The CHANNELNUM and ADDRESS words can */
58 /* be modified independently of each other. */
59#define PTR_CHANNELNUM_MASK 0x0000003f /* For each per-channel register, indicates the */
60 /* channel number of the register to be */
61 /* accessed. For non per-channel registers the */
62 /* value should be set to zero. */
63#define PTR_ADDRESS_MASK 0x07ff0000 /* Register index */
64
65#define DATA 0x04 /* Indexed register set data register */
66
67#define IPR 0x08 /* Global interrupt pending register */
68 /* Clear pending interrupts by writing a 1 to */
69 /* the relevant bits and zero to the other bits */
70
71/* The next two interrupts are for the midi port on the Audigy Drive (A_MPU1) */
72#define A_IPR_MIDITRANSBUFEMPTY2 0x10000000 /* MIDI UART transmit buffer empty */
73#define A_IPR_MIDIRECVBUFEMPTY2 0x08000000 /* MIDI UART receive buffer empty */
74
75#define IPR_SAMPLERATETRACKER 0x01000000 /* Sample rate tracker lock status change */
76#define IPR_FXDSP 0x00800000 /* Enable FX DSP interrupts */
77#define IPR_FORCEINT 0x00400000 /* Force Sound Blaster interrupt */
78#define IPR_PCIERROR 0x00200000 /* PCI bus error */
79#define IPR_VOLINCR 0x00100000 /* Volume increment button pressed */
80#define IPR_VOLDECR 0x00080000 /* Volume decrement button pressed */
81#define IPR_MUTE 0x00040000 /* Mute button pressed */
82#define IPR_MICBUFFULL 0x00020000 /* Microphone buffer full */
83#define IPR_MICBUFHALFFULL 0x00010000 /* Microphone buffer half full */
84#define IPR_ADCBUFFULL 0x00008000 /* ADC buffer full */
85#define IPR_ADCBUFHALFFULL 0x00004000 /* ADC buffer half full */
86#define IPR_EFXBUFFULL 0x00002000 /* Effects buffer full */
87#define IPR_EFXBUFHALFFULL 0x00001000 /* Effects buffer half full */
88#define IPR_GPSPDIFSTATUSCHANGE 0x00000800 /* GPSPDIF channel status change */
89#define IPR_CDROMSTATUSCHANGE 0x00000400 /* CD-ROM channel status change */
90#define IPR_INTERVALTIMER 0x00000200 /* Interval timer terminal count */
91#define IPR_MIDITRANSBUFEMPTY 0x00000100 /* MIDI UART transmit buffer empty */
92#define IPR_MIDIRECVBUFEMPTY 0x00000080 /* MIDI UART receive buffer empty */
93#define IPR_CHANNELLOOP 0x00000040 /* One or more channel loop interrupts pending */
94#define IPR_CHANNELNUMBERMASK 0x0000003f /* When IPR_CHANNELLOOP is set, indicates the */
95 /* Highest set channel in CLIPL or CLIPH. When */
96 /* IP is written with CL set, the bit in CLIPL */
97 /* or CLIPH corresponding to the CIN value */
98 /* written will be cleared. */
99#define A_IPR_MIDITRANSBUFEMPTY1 IPR_MIDITRANSBUFEMPTY /* MIDI UART transmit buffer empty */
100#define A_IPR_MIDIRECVBUFEMPTY1 IPR_MIDIRECVBUFEMPTY /* MIDI UART receive buffer empty */
101
102
103
104#define INTE 0x0c /* Interrupt enable register */
105#define INTE_VIRTUALSB_MASK 0xc0000000 /* Virtual Soundblaster I/O port capture */
106#define INTE_VIRTUALSB_220 0x00000000 /* Capture at I/O base address 0x220-0x22f */
107#define INTE_VIRTUALSB_240 0x40000000 /* Capture at I/O base address 0x240 */
108#define INTE_VIRTUALSB_260 0x80000000 /* Capture at I/O base address 0x260 */
109#define INTE_VIRTUALSB_280 0xc0000000 /* Capture at I/O base address 0x280 */
110#define INTE_VIRTUALMPU_MASK 0x30000000 /* Virtual MPU I/O port capture */
111#define INTE_VIRTUALMPU_300 0x00000000 /* Capture at I/O base address 0x300-0x301 */
112#define INTE_VIRTUALMPU_310 0x10000000 /* Capture at I/O base address 0x310 */
113#define INTE_VIRTUALMPU_320 0x20000000 /* Capture at I/O base address 0x320 */
114#define INTE_VIRTUALMPU_330 0x30000000 /* Capture at I/O base address 0x330 */
115#define INTE_MASTERDMAENABLE 0x08000000 /* Master DMA emulation at 0x000-0x00f */
116#define INTE_SLAVEDMAENABLE 0x04000000 /* Slave DMA emulation at 0x0c0-0x0df */
117#define INTE_MASTERPICENABLE 0x02000000 /* Master PIC emulation at 0x020-0x021 */
118#define INTE_SLAVEPICENABLE 0x01000000 /* Slave PIC emulation at 0x0a0-0x0a1 */
119#define INTE_VSBENABLE 0x00800000 /* Enable virtual Soundblaster */
120#define INTE_ADLIBENABLE 0x00400000 /* Enable AdLib emulation at 0x388-0x38b */
121#define INTE_MPUENABLE 0x00200000 /* Enable virtual MPU */
122#define INTE_FORCEINT 0x00100000 /* Continuously assert INTAN */
123
124#define INTE_MRHANDENABLE 0x00080000 /* Enable the "Mr. Hand" logic */
125 /* NOTE: There is no reason to use this under */
126 /* Linux, and it will cause odd hardware */
127 /* behavior and possibly random segfaults and */
128 /* lockups if enabled. */
129
130/* The next two interrupts are for the midi port on the Audigy Drive (A_MPU1) */
131#define A_INTE_MIDITXENABLE2 0x00020000 /* Enable MIDI transmit-buffer-empty interrupts */
132#define A_INTE_MIDIRXENABLE2 0x00010000 /* Enable MIDI receive-buffer-empty interrupts */
133
134
135#define INTE_SAMPLERATETRACKER 0x00002000 /* Enable sample rate tracker interrupts */
136 /* NOTE: This bit must always be enabled */
137#define INTE_FXDSPENABLE 0x00001000 /* Enable FX DSP interrupts */
138#define INTE_PCIERRORENABLE 0x00000800 /* Enable PCI bus error interrupts */
139#define INTE_VOLINCRENABLE 0x00000400 /* Enable volume increment button interrupts */
140#define INTE_VOLDECRENABLE 0x00000200 /* Enable volume decrement button interrupts */
141#define INTE_MUTEENABLE 0x00000100 /* Enable mute button interrupts */
142#define INTE_MICBUFENABLE 0x00000080 /* Enable microphone buffer interrupts */
143#define INTE_ADCBUFENABLE 0x00000040 /* Enable ADC buffer interrupts */
144#define INTE_EFXBUFENABLE 0x00000020 /* Enable Effects buffer interrupts */
145#define INTE_GPSPDIFENABLE 0x00000010 /* Enable GPSPDIF status interrupts */
146#define INTE_CDSPDIFENABLE 0x00000008 /* Enable CDSPDIF status interrupts */
147#define INTE_INTERVALTIMERENB 0x00000004 /* Enable interval timer interrupts */
148#define INTE_MIDITXENABLE 0x00000002 /* Enable MIDI transmit-buffer-empty interrupts */
149#define INTE_MIDIRXENABLE 0x00000001 /* Enable MIDI receive-buffer-empty interrupts */
150
151/* The next two interrupts are for the midi port on the Audigy (A_MPU2) */
152#define A_INTE_MIDITXENABLE1 INTE_MIDITXENABLE
153#define A_INTE_MIDIRXENABLE1 INTE_MIDIRXENABLE
154
155#define WC 0x10 /* Wall Clock register */
156#define WC_SAMPLECOUNTER_MASK 0x03FFFFC0 /* Sample periods elapsed since reset */
157#define WC_SAMPLECOUNTER 0x14060010
158#define WC_CURRENTCHANNEL 0x0000003F /* Channel [0..63] currently being serviced */
159 /* NOTE: Each channel takes 1/64th of a sample */
160 /* period to be serviced. */
161
162#define HCFG 0x14 /* Hardware config register */
163 /* NOTE: There is no reason to use the legacy */
164 /* SoundBlaster emulation stuff described below */
165 /* under Linux, and all kinds of weird hardware */
166 /* behavior can result if you try. Don't. */
167#define HCFG_LEGACYFUNC_MASK 0xe0000000 /* Legacy function number */
168#define HCFG_LEGACYFUNC_MPU 0x00000000 /* Legacy MPU */
169#define HCFG_LEGACYFUNC_SB 0x40000000 /* Legacy SB */
170#define HCFG_LEGACYFUNC_AD 0x60000000 /* Legacy AD */
171#define HCFG_LEGACYFUNC_MPIC 0x80000000 /* Legacy MPIC */
172#define HCFG_LEGACYFUNC_MDMA 0xa0000000 /* Legacy MDMA */
173#define HCFG_LEGACYFUNC_SPCI 0xc0000000 /* Legacy SPCI */
174#define HCFG_LEGACYFUNC_SDMA 0xe0000000 /* Legacy SDMA */
175#define HCFG_IOCAPTUREADDR 0x1f000000 /* The 4 LSBs of the captured I/O address. */
176#define HCFG_LEGACYWRITE 0x00800000 /* 1 = write, 0 = read */
177#define HCFG_LEGACYWORD 0x00400000 /* 1 = word, 0 = byte */
178#define HCFG_LEGACYINT 0x00200000 /* 1 = legacy event captured. Write 1 to clear. */
179 /* NOTE: The rest of the bits in this register */
180 /* _are_ relevant under Linux. */
181#define HCFG_CODECFORMAT_MASK 0x00070000 /* CODEC format */
182#define HCFG_CODECFORMAT_AC97 0x00000000 /* AC97 CODEC format -- Primary Output */
183#define HCFG_CODECFORMAT_I2S 0x00010000 /* I2S CODEC format -- Secondary (Rear) Output */
184#define HCFG_GPINPUT0 0x00004000 /* External pin112 */
185#define HCFG_GPINPUT1 0x00002000 /* External pin110 */
186
187#define HCFG_GPOUTPUT_MASK 0x00001c00 /* External pins which may be controlled */
188#define HCFG_GPOUT0 0x00001000 /* set to enable digital out on 5.1 cards */
189
190#define HCFG_JOYENABLE 0x00000200 /* Internal joystick enable */
191#define HCFG_PHASETRACKENABLE 0x00000100 /* Phase tracking enable */
192 /* 1 = Force all 3 async digital inputs to use */
193 /* the same async sample rate tracker (ZVIDEO) */
194#define HCFG_AC3ENABLE_MASK 0x0x0000e0 /* AC3 async input control - Not implemented */
195#define HCFG_AC3ENABLE_ZVIDEO 0x00000080 /* Channels 0 and 1 replace ZVIDEO */
196#define HCFG_AC3ENABLE_CDSPDIF 0x00000040 /* Channels 0 and 1 replace CDSPDIF */
197#define HCFG_AC3ENABLE_GPSPDIF 0x00000020 /* Channels 0 and 1 replace GPSPDIF */
198#define HCFG_AUTOMUTE 0x00000010 /* When set, the async sample rate convertors */
199 /* will automatically mute their output when */
200 /* they are not rate-locked to the external */
201 /* async audio source */
202#define HCFG_LOCKSOUNDCACHE 0x00000008 /* 1 = Cancel bustmaster accesses to soundcache */
203 /* NOTE: This should generally never be used. */
204#define HCFG_LOCKTANKCACHE_MASK 0x00000004 /* 1 = Cancel bustmaster accesses to tankcache */
205 /* NOTE: This should generally never be used. */
206#define HCFG_LOCKTANKCACHE 0x01020014
207#define HCFG_MUTEBUTTONENABLE 0x00000002 /* 1 = Master mute button sets AUDIOENABLE = 0. */
208 /* NOTE: This is a 'cheap' way to implement a */
209 /* master mute function on the mute button, and */
210 /* in general should not be used unless a more */
211 /* sophisticated master mute function has not */
212 /* been written. */
213#define HCFG_AUDIOENABLE 0x00000001 /* 0 = CODECs transmit zero-valued samples */
214 /* Should be set to 1 when the EMU10K1 is */
215 /* completely initialized. */
216
217//For Audigy, MPU port move to 0x70-0x74 ptr register
218
219#define MUDATA 0x18 /* MPU401 data register (8 bits) */
220
221#define MUCMD 0x19 /* MPU401 command register (8 bits) */
222#define MUCMD_RESET 0xff /* RESET command */
223#define MUCMD_ENTERUARTMODE 0x3f /* Enter_UART_mode command */
224 /* NOTE: All other commands are ignored */
225
226#define MUSTAT MUCMD /* MPU401 status register (8 bits) */
227#define MUSTAT_IRDYN 0x80 /* 0 = MIDI data or command ACK */
228#define MUSTAT_ORDYN 0x40 /* 0 = MUDATA can accept a command or data */
229
230#define A_IOCFG 0x18 /* GPIO on Audigy card (16bits) */
231#define A_GPINPUT_MASK 0xff00
232#define A_GPOUTPUT_MASK 0x00ff
233
234#define TIMER 0x1a /* Timer terminal count register (16-bit) */
235 /* NOTE: After the rate is changed, a maximum */
236 /* of 1024 sample periods should be allowed */
237 /* before the new rate is guaranteed accurate. */
238#define TIMER_RATE_MASK 0x03ff /* Timer interrupt rate in sample periods */
239 /* 0 == 1024 periods, [1..4] are not useful */
240
241#define AC97DATA 0x1c /* AC97 register set data register (16 bit) */
242
243#define AC97ADDRESS 0x1e /* AC97 register set address register (8 bit) */
244#define AC97ADDRESS_READY 0x80 /* Read-only bit, reflects CODEC READY signal */
245#define AC97ADDRESS_ADDRESS 0x7f /* Address of indexed AC97 register */
246
247/********************************************************************************************************/
248/* Emu10k1 pointer-offset register set, accessed through the PTR and DATA registers */
249/********************************************************************************************************/
250
251#define CPF 0x00 /* Current pitch and fraction register */
252#define CPF_CURRENTPITCH_MASK 0xffff0000 /* Current pitch (linear, 0x4000 == unity pitch shift) */
253#define CPF_CURRENTPITCH 0x10100000
254#define CPF_STEREO_MASK 0x00008000 /* 1 = Even channel interleave, odd channel locked */
255#define CPF_STOP_MASK 0x00004000 /* 1 = Current pitch forced to 0 */
256#define CPF_FRACADDRESS_MASK 0x00003fff /* Linear fractional address of the current channel */
257
258#define PTRX 0x01 /* Pitch target and send A/B amounts register */
259#define PTRX_PITCHTARGET_MASK 0xffff0000 /* Pitch target of specified channel */
260#define PTRX_PITCHTARGET 0x10100001
261#define PTRX_FXSENDAMOUNT_A_MASK 0x0000ff00 /* Linear level of channel output sent to FX send bus A */
262#define PTRX_FXSENDAMOUNT_A 0x08080001
263#define PTRX_FXSENDAMOUNT_B_MASK 0x000000ff /* Linear level of channel output sent to FX send bus B */
264#define PTRX_FXSENDAMOUNT_B 0x08000001
265
266#define CVCF 0x02 /* Current volume and filter cutoff register */
267#define CVCF_CURRENTVOL_MASK 0xffff0000 /* Current linear volume of specified channel */
268#define CVCF_CURRENTVOL 0x10100002
269#define CVCF_CURRENTFILTER_MASK 0x0000ffff /* Current filter cutoff frequency of specified channel */
270#define CVCF_CURRENTFILTER 0x10000002
271
272#define VTFT 0x03 /* Volume target and filter cutoff target register */
273#define VTFT_VOLUMETARGET_MASK 0xffff0000 /* Volume target of specified channel */
274#define VTFT_FILTERTARGET_MASK 0x0000ffff /* Filter cutoff target of specified channel */
275
276#define Z1 0x05 /* Filter delay memory 1 register */
277
278#define Z2 0x04 /* Filter delay memory 2 register */
279
280#define PSST 0x06 /* Send C amount and loop start address register */
281#define PSST_FXSENDAMOUNT_C_MASK 0xff000000 /* Linear level of channel output sent to FX send bus C */
282
283#define PSST_FXSENDAMOUNT_C 0x08180006
284
285#define PSST_LOOPSTARTADDR_MASK 0x00ffffff /* Loop start address of the specified channel */
286#define PSST_LOOPSTARTADDR 0x18000006
287
288#define DSL 0x07 /* Send D amount and loop start address register */
289#define DSL_FXSENDAMOUNT_D_MASK 0xff000000 /* Linear level of channel output sent to FX send bus D */
290
291#define DSL_FXSENDAMOUNT_D 0x08180007
292
293#define DSL_LOOPENDADDR_MASK 0x00ffffff /* Loop end address of the specified channel */
294#define DSL_LOOPENDADDR 0x18000007
295
296#define CCCA 0x08 /* Filter Q, interp. ROM, byte size, cur. addr register */
297#define CCCA_RESONANCE 0xf0000000 /* Lowpass filter resonance (Q) height */
298#define CCCA_INTERPROMMASK 0x0e000000 /* Selects passband of interpolation ROM */
299 /* 1 == full band, 7 == lowpass */
300 /* ROM 0 is used when pitch shifting downward or less */
301 /* then 3 semitones upward. Increasingly higher ROM */
302 /* numbers are used, typically in steps of 3 semitones, */
303 /* as upward pitch shifting is performed. */
304#define CCCA_INTERPROM_0 0x00000000 /* Select interpolation ROM 0 */
305#define CCCA_INTERPROM_1 0x02000000 /* Select interpolation ROM 1 */
306#define CCCA_INTERPROM_2 0x04000000 /* Select interpolation ROM 2 */
307#define CCCA_INTERPROM_3 0x06000000 /* Select interpolation ROM 3 */
308#define CCCA_INTERPROM_4 0x08000000 /* Select interpolation ROM 4 */
309#define CCCA_INTERPROM_5 0x0a000000 /* Select interpolation ROM 5 */
310#define CCCA_INTERPROM_6 0x0c000000 /* Select interpolation ROM 6 */
311#define CCCA_INTERPROM_7 0x0e000000 /* Select interpolation ROM 7 */
312#define CCCA_8BITSELECT 0x01000000 /* 1 = Sound memory for this channel uses 8-bit samples */
313#define CCCA_CURRADDR_MASK 0x00ffffff /* Current address of the selected channel */
314#define CCCA_CURRADDR 0x18000008
315
316#define CCR 0x09 /* Cache control register */
317#define CCR_CACHEINVALIDSIZE 0x07190009
318#define CCR_CACHEINVALIDSIZE_MASK 0xfe000000 /* Number of invalid samples cache for this channel */
319#define CCR_CACHELOOPFLAG 0x01000000 /* 1 = Cache has a loop service pending */
320#define CCR_INTERLEAVEDSAMPLES 0x00800000 /* 1 = A cache service will fetch interleaved samples */
321#define CCR_WORDSIZEDSAMPLES 0x00400000 /* 1 = A cache service will fetch word sized samples */
322#define CCR_READADDRESS 0x06100009
323#define CCR_READADDRESS_MASK 0x003f0000 /* Location of cache just beyond current cache service */
324#define CCR_LOOPINVALSIZE 0x0000fe00 /* Number of invalid samples in cache prior to loop */
325 /* NOTE: This is valid only if CACHELOOPFLAG is set */
326#define CCR_LOOPFLAG 0x00000100 /* Set for a single sample period when a loop occurs */
327#define CCR_CACHELOOPADDRHI 0x000000ff /* DSL_LOOPSTARTADDR's hi byte if CACHELOOPFLAG is set */
328
329#define CLP 0x0a /* Cache loop register (valid if CCR_CACHELOOPFLAG = 1) */
330 /* NOTE: This register is normally not used */
331#define CLP_CACHELOOPADDR 0x0000ffff /* Cache loop address (DSL_LOOPSTARTADDR [0..15]) */
332
333#define FXRT 0x0b /* Effects send routing register */
334 /* NOTE: It is illegal to assign the same routing to */
335 /* two effects sends. */
336#define FXRT_CHANNELA 0x000f0000 /* Effects send bus number for channel's effects send A */
337#define FXRT_CHANNELB 0x00f00000 /* Effects send bus number for channel's effects send B */
338#define FXRT_CHANNELC 0x0f000000 /* Effects send bus number for channel's effects send C */
339#define FXRT_CHANNELD 0xf0000000 /* Effects send bus number for channel's effects send D */
340
341#define MAPA 0x0c /* Cache map A */
342
343#define MAPB 0x0d /* Cache map B */
344
345#define MAP_PTE_MASK 0xffffe000 /* The 19 MSBs of the PTE indexed by the PTI */
346#define MAP_PTI_MASK 0x00001fff /* The 13 bit index to one of the 8192 PTE dwords */
347
348#define ENVVOL 0x10 /* Volume envelope register */
349#define ENVVOL_MASK 0x0000ffff /* Current value of volume envelope state variable */
350 /* 0x8000-n == 666*n usec delay */
351
352#define ATKHLDV 0x11 /* Volume envelope hold and attack register */
353#define ATKHLDV_PHASE0 0x00008000 /* 0 = Begin attack phase */
354#define ATKHLDV_HOLDTIME_MASK 0x00007f00 /* Envelope hold time (127-n == n*88.2msec) */
355#define ATKHLDV_ATTACKTIME_MASK 0x0000007f /* Envelope attack time, log encoded */
356 /* 0 = infinite, 1 = 10.9msec, ... 0x7f = 5.5msec */
357
358#define DCYSUSV 0x12 /* Volume envelope sustain and decay register */
359#define DCYSUSV_PHASE1_MASK 0x00008000 /* 0 = Begin attack phase, 1 = begin release phase */
360#define DCYSUSV_SUSTAINLEVEL_MASK 0x00007f00 /* 127 = full, 0 = off, 0.75dB increments */
361#define DCYSUSV_CHANNELENABLE_MASK 0x00000080 /* 1 = Inhibit envelope engine from writing values in */
362 /* this channel and from writing to pitch, filter and */
363 /* volume targets. */
364#define DCYSUSV_DECAYTIME_MASK 0x0000007f /* Volume envelope decay time, log encoded */
365 /* 0 = 43.7msec, 1 = 21.8msec, 0x7f = 22msec */
366
367#define LFOVAL1 0x13 /* Modulation LFO value */
368#define LFOVAL_MASK 0x0000ffff /* Current value of modulation LFO state variable */
369 /* 0x8000-n == 666*n usec delay */
370
371#define ENVVAL 0x14 /* Modulation envelope register */
372#define ENVVAL_MASK 0x0000ffff /* Current value of modulation envelope state variable */
373 /* 0x8000-n == 666*n usec delay */
374
375#define ATKHLDM 0x15 /* Modulation envelope hold and attack register */
376#define ATKHLDM_PHASE0 0x00008000 /* 0 = Begin attack phase */
377#define ATKHLDM_HOLDTIME 0x00007f00 /* Envelope hold time (127-n == n*42msec) */
378#define ATKHLDM_ATTACKTIME 0x0000007f /* Envelope attack time, log encoded */
379 /* 0 = infinite, 1 = 11msec, ... 0x7f = 5.5msec */
380
381#define DCYSUSM 0x16 /* Modulation envelope decay and sustain register */
382#define DCYSUSM_PHASE1_MASK 0x00008000 /* 0 = Begin attack phase, 1 = begin release phase */
383#define DCYSUSM_SUSTAINLEVEL_MASK 0x00007f00 /* 127 = full, 0 = off, 0.75dB increments */
384#define DCYSUSM_DECAYTIME_MASK 0x0000007f /* Envelope decay time, log encoded */
385 /* 0 = 43.7msec, 1 = 21.8msec, 0x7f = 22msec */
386
387#define LFOVAL2 0x17 /* Vibrato LFO register */
388#define LFOVAL2_MASK 0x0000ffff /* Current value of vibrato LFO state variable */
389 /* 0x8000-n == 666*n usec delay */
390
391#define IP 0x18 /* Initial pitch register */
392#define IP_MASK 0x0000ffff /* Exponential initial pitch shift */
393 /* 4 bits of octave, 12 bits of fractional octave */
394#define IP_UNITY 0x0000e000 /* Unity pitch shift */
395
396#define IFATN 0x19 /* Initial filter cutoff and attenuation register */
397#define IFATN_FILTERCUTOFF_MASK 0x0000ff00 /* Initial filter cutoff frequency in exponential units */
398 /* 6 most significant bits are semitones */
399 /* 2 least significant bits are fractions */
400#define IFATN_FILTERCUTOFF 0x08080019
401#define IFATN_ATTENUATION_MASK 0x000000ff /* Initial attenuation in 0.375dB steps */
402#define IFATN_ATTENUATION 0x08000019
403
404
405#define PEFE 0x1a /* Pitch envelope and filter envelope amount register */
406#define PEFE_PITCHAMOUNT_MASK 0x0000ff00 /* Pitch envlope amount */
407 /* Signed 2's complement, +/- one octave peak extremes */
408#define PEFE_PITCHAMOUNT 0x0808001a
409#define PEFE_FILTERAMOUNT_MASK 0x000000ff /* Filter envlope amount */
410 /* Signed 2's complement, +/- six octaves peak extremes */
411#define PEFE_FILTERAMOUNT 0x0800001a
412#define FMMOD 0x1b /* Vibrato/filter modulation from LFO register */
413#define FMMOD_MODVIBRATO 0x0000ff00 /* Vibrato LFO modulation depth */
414 /* Signed 2's complement, +/- one octave extremes */
415#define FMMOD_MOFILTER 0x000000ff /* Filter LFO modulation depth */
416 /* Signed 2's complement, +/- three octave extremes */
417
418
419#define TREMFRQ 0x1c /* Tremolo amount and modulation LFO frequency register */
420#define TREMFRQ_DEPTH 0x0000ff00 /* Tremolo depth */
421 /* Signed 2's complement, with +/- 12dB extremes */
422#define TREMFRQ_FREQUENCY 0x000000ff /* Tremolo LFO frequency */
423 /* ??Hz steps, maximum of ?? Hz. */
424
425#define FM2FRQ2 0x1d /* Vibrato amount and vibrato LFO frequency register */
426#define FM2FRQ2_DEPTH 0x0000ff00 /* Vibrato LFO vibrato depth */
427 /* Signed 2's complement, +/- one octave extremes */
428#define FM2FRQ2_FREQUENCY 0x000000ff /* Vibrato LFO frequency */
429 /* 0.039Hz steps, maximum of 9.85 Hz. */
430
431#define TEMPENV 0x1e /* Tempory envelope register */
432#define TEMPENV_MASK 0x0000ffff /* 16-bit value */
433 /* NOTE: All channels contain internal variables; do */
434 /* not write to these locations. */
435
436#define CD0 0x20 /* Cache data 0 register */
437#define CD1 0x21 /* Cache data 1 register */
438#define CD2 0x22 /* Cache data 2 register */
439#define CD3 0x23 /* Cache data 3 register */
440#define CD4 0x24 /* Cache data 4 register */
441#define CD5 0x25 /* Cache data 5 register */
442#define CD6 0x26 /* Cache data 6 register */
443#define CD7 0x27 /* Cache data 7 register */
444#define CD8 0x28 /* Cache data 8 register */
445#define CD9 0x29 /* Cache data 9 register */
446#define CDA 0x2a /* Cache data A register */
447#define CDB 0x2b /* Cache data B register */
448#define CDC 0x2c /* Cache data C register */
449#define CDD 0x2d /* Cache data D register */
450#define CDE 0x2e /* Cache data E register */
451#define CDF 0x2f /* Cache data F register */
452
453#define PTB 0x40 /* Page table base register */
454#define PTB_MASK 0xfffff000 /* Physical address of the page table in host memory */
455
456#define TCB 0x41 /* Tank cache base register */
457#define TCB_MASK 0xfffff000 /* Physical address of the bottom of host based TRAM */
458
459#define ADCCR 0x42 /* ADC sample rate/stereo control register */
460#define ADCCR_RCHANENABLE 0x00000010 /* Enables right channel for writing to the host */
461#define ADCCR_LCHANENABLE 0x00000008 /* Enables left channel for writing to the host */
462 /* NOTE: To guarantee phase coherency, both channels */
463 /* must be disabled prior to enabling both channels. */
464#define A_ADCCR_RCHANENABLE 0x00000020
465#define A_ADCCR_LCHANENABLE 0x00000010
466
467#define A_ADCCR_SAMPLERATE_MASK 0x0000000F /* Audigy sample rate convertor output rate */
468#define ADCCR_SAMPLERATE_MASK 0x00000007 /* Sample rate convertor output rate */
469
470#define ADCCR_SAMPLERATE_48 0x00000000 /* 48kHz sample rate */
471#define ADCCR_SAMPLERATE_44 0x00000001 /* 44.1kHz sample rate */
472#define ADCCR_SAMPLERATE_32 0x00000002 /* 32kHz sample rate */
473#define ADCCR_SAMPLERATE_24 0x00000003 /* 24kHz sample rate */
474#define ADCCR_SAMPLERATE_22 0x00000004 /* 22.05kHz sample rate */
475#define ADCCR_SAMPLERATE_16 0x00000005 /* 16kHz sample rate */
476#define ADCCR_SAMPLERATE_11 0x00000006 /* 11.025kHz sample rate */
477#define ADCCR_SAMPLERATE_8 0x00000007 /* 8kHz sample rate */
478
479#define A_ADCCR_SAMPLERATE_12 0x00000006 /* 12kHz sample rate */
480#define A_ADCCR_SAMPLERATE_11 0x00000007 /* 11.025kHz sample rate */
481#define A_ADCCR_SAMPLERATE_8 0x00000008 /* 8kHz sample rate */
482
483#define FXWC 0x43 /* FX output write channels register */
484 /* When set, each bit enables the writing of the */
485 /* corresponding FX output channel (internal registers */
486 /* 0x20-0x3f) into host memory. This mode of recording */
487 /* is 16bit, 48KHz only. All 32 channels can be enabled */
488 /* simultaneously. */
489#define TCBS 0x44 /* Tank cache buffer size register */
490#define TCBS_MASK 0x00000007 /* Tank cache buffer size field */
491#define TCBS_BUFFSIZE_16K 0x00000000
492#define TCBS_BUFFSIZE_32K 0x00000001
493#define TCBS_BUFFSIZE_64K 0x00000002
494#define TCBS_BUFFSIZE_128K 0x00000003
495#define TCBS_BUFFSIZE_256K 0x00000004
496#define TCBS_BUFFSIZE_512K 0x00000005
497#define TCBS_BUFFSIZE_1024K 0x00000006
498#define TCBS_BUFFSIZE_2048K 0x00000007
499
500#define MICBA 0x45 /* AC97 microphone buffer address register */
501#define MICBA_MASK 0xfffff000 /* 20 bit base address */
502
503#define ADCBA 0x46 /* ADC buffer address register */
504#define ADCBA_MASK 0xfffff000 /* 20 bit base address */
505
506#define FXBA 0x47 /* FX Buffer Address */
507#define FXBA_MASK 0xfffff000 /* 20 bit base address */
508
509#define MICBS 0x49 /* Microphone buffer size register */
510
511#define ADCBS 0x4a /* ADC buffer size register */
512
513#define FXBS 0x4b /* FX buffer size register */
514
515/* The following mask values define the size of the ADC, MIX and FX buffers in bytes */
516#define ADCBS_BUFSIZE_NONE 0x00000000
517#define ADCBS_BUFSIZE_384 0x00000001
518#define ADCBS_BUFSIZE_448 0x00000002
519#define ADCBS_BUFSIZE_512 0x00000003
520#define ADCBS_BUFSIZE_640 0x00000004
521#define ADCBS_BUFSIZE_768 0x00000005
522#define ADCBS_BUFSIZE_896 0x00000006
523#define ADCBS_BUFSIZE_1024 0x00000007
524#define ADCBS_BUFSIZE_1280 0x00000008
525#define ADCBS_BUFSIZE_1536 0x00000009
526#define ADCBS_BUFSIZE_1792 0x0000000a
527#define ADCBS_BUFSIZE_2048 0x0000000b
528#define ADCBS_BUFSIZE_2560 0x0000000c
529#define ADCBS_BUFSIZE_3072 0x0000000d
530#define ADCBS_BUFSIZE_3584 0x0000000e
531#define ADCBS_BUFSIZE_4096 0x0000000f
532#define ADCBS_BUFSIZE_5120 0x00000010
533#define ADCBS_BUFSIZE_6144 0x00000011
534#define ADCBS_BUFSIZE_7168 0x00000012
535#define ADCBS_BUFSIZE_8192 0x00000013
536#define ADCBS_BUFSIZE_10240 0x00000014
537#define ADCBS_BUFSIZE_12288 0x00000015
538#define ADCBS_BUFSIZE_14366 0x00000016
539#define ADCBS_BUFSIZE_16384 0x00000017
540#define ADCBS_BUFSIZE_20480 0x00000018
541#define ADCBS_BUFSIZE_24576 0x00000019
542#define ADCBS_BUFSIZE_28672 0x0000001a
543#define ADCBS_BUFSIZE_32768 0x0000001b
544#define ADCBS_BUFSIZE_40960 0x0000001c
545#define ADCBS_BUFSIZE_49152 0x0000001d
546#define ADCBS_BUFSIZE_57344 0x0000001e
547#define ADCBS_BUFSIZE_65536 0x0000001f
548
549
550#define CDCS 0x50 /* CD-ROM digital channel status register */
551
552#define GPSCS 0x51 /* General Purpose SPDIF channel status register*/
553
554#define DBG 0x52 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */
555
556/* definitions for debug register - taken from the alsa drivers */
557#define DBG_ZC 0x80000000 /* zero tram counter */
558#define DBG_SATURATION_OCCURED 0x02000000 /* saturation control */
559#define DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */
560#define DBG_SINGLE_STEP 0x00008000 /* single step mode */
561#define DBG_STEP 0x00004000 /* start single step */
562#define DBG_CONDITION_CODE 0x00003e00 /* condition code */
563#define DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */
564
565
566#define REG53 0x53 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */
567
568#define A_DBG 0x53
569#define A_DBG_SINGLE_STEP 0x00020000 /* Set to zero to start dsp */
570#define A_DBG_ZC 0x40000000 /* zero tram counter */
571#define A_DBG_STEP_ADDR 0x000003ff
572#define A_DBG_SATURATION_OCCURED 0x20000000
573#define A_DBG_SATURATION_ADDR 0x0ffc0000
574
575#define SPCS0 0x54 /* SPDIF output Channel Status 0 register */
576
577#define SPCS1 0x55 /* SPDIF output Channel Status 1 register */
578
579#define SPCS2 0x56 /* SPDIF output Channel Status 2 register */
580
581#define SPCS_CLKACCYMASK 0x30000000 /* Clock accuracy */
582#define SPCS_CLKACCY_1000PPM 0x00000000 /* 1000 parts per million */
583#define SPCS_CLKACCY_50PPM 0x10000000 /* 50 parts per million */
584#define SPCS_CLKACCY_VARIABLE 0x20000000 /* Variable accuracy */
585#define SPCS_SAMPLERATEMASK 0x0f000000 /* Sample rate */
586#define SPCS_SAMPLERATE_44 0x00000000 /* 44.1kHz sample rate */
587#define SPCS_SAMPLERATE_48 0x02000000 /* 48kHz sample rate */
588#define SPCS_SAMPLERATE_32 0x03000000 /* 32kHz sample rate */
589#define SPCS_CHANNELNUMMASK 0x00f00000 /* Channel number */
590#define SPCS_CHANNELNUM_UNSPEC 0x00000000 /* Unspecified channel number */
591#define SPCS_CHANNELNUM_LEFT 0x00100000 /* Left channel */
592#define SPCS_CHANNELNUM_RIGHT 0x00200000 /* Right channel */
593#define SPCS_SOURCENUMMASK 0x000f0000 /* Source number */
594#define SPCS_SOURCENUM_UNSPEC 0x00000000 /* Unspecified source number */
595#define SPCS_GENERATIONSTATUS 0x00008000 /* Originality flag (see IEC-958 spec) */
596#define SPCS_CATEGORYCODEMASK 0x00007f00 /* Category code (see IEC-958 spec) */
597#define SPCS_MODEMASK 0x000000c0 /* Mode (see IEC-958 spec) */
598#define SPCS_EMPHASISMASK 0x00000038 /* Emphasis */
599#define SPCS_EMPHASIS_NONE 0x00000000 /* No emphasis */
600#define SPCS_EMPHASIS_50_15 0x00000008 /* 50/15 usec 2 channel */
601#define SPCS_COPYRIGHT 0x00000004 /* Copyright asserted flag -- do not modify */
602#define SPCS_NOTAUDIODATA 0x00000002 /* 0 = Digital audio, 1 = not audio */
603#define SPCS_PROFESSIONAL 0x00000001 /* 0 = Consumer (IEC-958), 1 = pro (AES3-1992) */
604
605/* The 32-bit CLIx and SOLx registers all have one bit per channel control/status */
606#define CLIEL 0x58 /* Channel loop interrupt enable low register */
607
608#define CLIEH 0x59 /* Channel loop interrupt enable high register */
609
610#define CLIPL 0x5a /* Channel loop interrupt pending low register */
611
612#define CLIPH 0x5b /* Channel loop interrupt pending high register */
613
614#define SOLEL 0x5c /* Stop on loop enable low register */
615
616#define SOLEH 0x5d /* Stop on loop enable high register */
617
618#define SPBYPASS 0x5e /* SPDIF BYPASS mode register */
619#define SPBYPASS_ENABLE 0x00000001 /* Enable SPDIF bypass mode */
620
621#define AC97SLOT 0x5f /* additional AC97 slots enable bits */
622#define AC97SLOT_CNTR 0x10 /* Center enable */
623#define AC97SLOT_LFE 0x20 /* LFE enable */
624
625#define CDSRCS 0x60 /* CD-ROM Sample Rate Converter status register */
626
627#define GPSRCS 0x61 /* General Purpose SPDIF sample rate cvt status */
628
629#define ZVSRCS 0x62 /* ZVideo sample rate converter status */
630 /* NOTE: This one has no SPDIFLOCKED field */
631 /* Assumes sample lock */
632
633/* These three bitfields apply to CDSRCS, GPSRCS, and (except as noted) ZVSRCS. */
634#define SRCS_SPDIFLOCKED 0x02000000 /* SPDIF stream locked */
635#define SRCS_RATELOCKED 0x01000000 /* Sample rate locked */
636#define SRCS_ESTSAMPLERATE 0x0007ffff /* Do not modify this field. */
637
638
639/* Note that these values can vary +/- by a small amount */
640#define SRCS_SPDIFRATE_44 0x0003acd9
641#define SRCS_SPDIFRATE_48 0x00040000
642#define SRCS_SPDIFRATE_96 0x00080000
643
644#define MICIDX 0x63 /* Microphone recording buffer index register */
645#define MICIDX_MASK 0x0000ffff /* 16-bit value */
646#define MICIDX_IDX 0x10000063
647
648#define A_ADCIDX 0x63
649#define A_ADCIDX_IDX 0x10000063
650
651#define ADCIDX 0x64 /* ADC recording buffer index register */
652#define ADCIDX_MASK 0x0000ffff /* 16 bit index field */
653#define ADCIDX_IDX 0x10000064
654
655#define FXIDX 0x65 /* FX recording buffer index register */
656#define FXIDX_MASK 0x0000ffff /* 16-bit value */
657#define FXIDX_IDX 0x10000065
658
659/* This is the MPU port on the card (via the game port) */
660#define A_MUDATA1 0x70
661#define A_MUCMD1 0x71
662#define A_MUSTAT1 A_MUCMD1
663
664/* This is the MPU port on the Audigy Drive */
665#define A_MUDATA2 0x72
666#define A_MUCMD2 0x73
667#define A_MUSTAT2 A_MUCMD2
668
669/* The next two are the Audigy equivalent of FXWC */
670/* the Audigy can record any output (16bit, 48kHz, up to 64 channel simultaneously) */
671/* Each bit selects a channel for recording */
672#define A_FXWC1 0x74 /* Selects 0x7f-0x60 for FX recording */
673#define A_FXWC2 0x75 /* Selects 0x9f-0x80 for FX recording */
674
675#define A_SPDIF_SAMPLERATE 0x76 /* Set the sample rate of SPDIF output */
676#define A_SPDIF_48000 0x00000080
677#define A_SPDIF_44100 0x00000000
678#define A_SPDIF_96000 0x00000040
679
680#define A_FXRT2 0x7c
681#define A_FXRT_CHANNELE 0x0000003f /* Effects send bus number for channel's effects send E */
682#define A_FXRT_CHANNELF 0x00003f00 /* Effects send bus number for channel's effects send F */
683#define A_FXRT_CHANNELG 0x003f0000 /* Effects send bus number for channel's effects send G */
684#define A_FXRT_CHANNELH 0x3f000000 /* Effects send bus number for channel's effects send H */
685
686#define A_SENDAMOUNTS 0x7d
687#define A_FXSENDAMOUNT_E_MASK 0xff000000
688#define A_FXSENDAMOUNT_F_MASK 0x00ff0000
689#define A_FXSENDAMOUNT_G_MASK 0x0000ff00
690#define A_FXSENDAMOUNT_H_MASK 0x000000ff
691
692/* The send amounts for this one are the same as used with the emu10k1 */
693#define A_FXRT1 0x7e
694#define A_FXRT_CHANNELA 0x0000003f
695#define A_FXRT_CHANNELB 0x00003f00
696#define A_FXRT_CHANNELC 0x003f0000
697#define A_FXRT_CHANNELD 0x3f000000
698
699
700/* Each FX general purpose register is 32 bits in length, all bits are used */
701#define FXGPREGBASE 0x100 /* FX general purpose registers base */
702#define A_FXGPREGBASE 0x400 /* Audigy GPRs, 0x400 to 0x5ff */
703/* Tank audio data is logarithmically compressed down to 16 bits before writing to TRAM and is */
704/* decompressed back to 20 bits on a read. There are a total of 160 locations, the last 32 */
705/* locations are for external TRAM. */
706#define TANKMEMDATAREGBASE 0x200 /* Tank memory data registers base */
707#define TANKMEMDATAREG_MASK 0x000fffff /* 20 bit tank audio data field */
708
709/* Combined address field and memory opcode or flag field. 160 locations, last 32 are external */
710#define TANKMEMADDRREGBASE 0x300 /* Tank memory address registers base */
711#define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */
712#define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */
713#define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */
714#define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */
715#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */
716
717#define MICROCODEBASE 0x400 /* Microcode data base address */
718
719/* Each DSP microcode instruction is mapped into 2 doublewords */
720/* NOTE: When writing, always write the LO doubleword first. Reads can be in either order. */
721#define LOWORD_OPX_MASK 0x000ffc00 /* Instruction operand X */
722#define LOWORD_OPY_MASK 0x000003ff /* Instruction operand Y */
723#define HIWORD_OPCODE_MASK 0x00f00000 /* Instruction opcode */
724#define HIWORD_RESULT_MASK 0x000ffc00 /* Instruction result */
725#define HIWORD_OPA_MASK 0x000003ff /* Instruction operand A */
726
727
728/* Audigy Soundcard have a different instruction format */
729#define AUDIGY_CODEBASE 0x600
730#define A_LOWORD_OPY_MASK 0x000007ff
731#define A_LOWORD_OPX_MASK 0x007ff000
732#define A_HIWORD_OPCODE_MASK 0x0f000000
733#define A_HIWORD_RESULT_MASK 0x007ff000
734#define A_HIWORD_OPA_MASK 0x000007ff
735
736
737#endif /* _8010_H */
diff --git a/sound/oss/emu10k1/Makefile b/sound/oss/emu10k1/Makefile
deleted file mode 100644
index b3af9ccb0579..000000000000
--- a/sound/oss/emu10k1/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
1# Makefile for Creative Labs EMU10K1
2#
3# 12 Apr 2000 Rui Sousa
4
5obj-$(CONFIG_SOUND_EMU10K1) += emu10k1.o
6
7emu10k1-objs := audio.o cardmi.o cardmo.o cardwi.o cardwo.o ecard.o \
8 efxmgr.o emuadxmg.o hwaccess.o irqmgr.o main.o midi.o \
9 mixer.o passthrough.o recmgr.o timer.o voicemgr.o
10
11ifdef DEBUG
12 EXTRA_CFLAGS += -DEMU10K1_DEBUG
13endif
14
15ifdef CONFIG_MIDI_EMU10K1
16 EXTRA_CFLAGS += -DEMU10K1_SEQUENCER
17endif
diff --git a/sound/oss/emu10k1/audio.c b/sound/oss/emu10k1/audio.c
deleted file mode 100644
index e75ea21eb811..000000000000
--- a/sound/oss/emu10k1/audio.c
+++ /dev/null
@@ -1,1595 +0,0 @@
1/*
2 **********************************************************************
3 * audio.c -- /dev/dsp interface for emu10k1 driver
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 * November 2, 1999 Alan Cox cleaned up types/leaks
12 *
13 **********************************************************************
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this program; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
28 * USA.
29 *
30 **********************************************************************
31 */
32
33#include <linux/module.h>
34#include <linux/poll.h>
35#include <linux/slab.h>
36#include <linux/bitops.h>
37#include <asm/io.h>
38#include <linux/sched.h>
39#include <linux/mm.h>
40#include <linux/smp_lock.h>
41
42#include "hwaccess.h"
43#include "cardwo.h"
44#include "cardwi.h"
45#include "recmgr.h"
46#include "irqmgr.h"
47#include "audio.h"
48#include "8010.h"
49
50static void calculate_ofrag(struct woinst *);
51static void calculate_ifrag(struct wiinst *);
52
53static void emu10k1_waveout_bh(unsigned long refdata);
54static void emu10k1_wavein_bh(unsigned long refdata);
55
56/* Audio file operations */
57static ssize_t emu10k1_audio_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos)
58{
59 struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data;
60 struct wiinst *wiinst = wave_dev->wiinst;
61 ssize_t ret = 0;
62 unsigned long flags;
63
64 DPD(3, "emu10k1_audio_read(), buffer=%p, count=%d\n", buffer, (u32) count);
65
66 if (!access_ok(VERIFY_WRITE, buffer, count))
67 return -EFAULT;
68
69 spin_lock_irqsave(&wiinst->lock, flags);
70
71 if (wiinst->mmapped) {
72 spin_unlock_irqrestore(&wiinst->lock, flags);
73 return -ENXIO;
74 }
75
76 if (wiinst->state == WAVE_STATE_CLOSED) {
77 calculate_ifrag(wiinst);
78
79 while (emu10k1_wavein_open(wave_dev) < 0) {
80 spin_unlock_irqrestore(&wiinst->lock, flags);
81
82 if (file->f_flags & O_NONBLOCK)
83 return -EAGAIN;
84
85 interruptible_sleep_on(&wave_dev->card->open_wait);
86
87 if (signal_pending(current))
88 return -ERESTARTSYS;
89
90 spin_lock_irqsave(&wiinst->lock, flags);
91 }
92 }
93
94 spin_unlock_irqrestore(&wiinst->lock, flags);
95
96 while (count > 0) {
97 u32 bytestocopy;
98
99 spin_lock_irqsave(&wiinst->lock, flags);
100
101 if (!(wiinst->state & WAVE_STATE_STARTED)
102 && (wave_dev->enablebits & PCM_ENABLE_INPUT))
103 emu10k1_wavein_start(wave_dev);
104
105 emu10k1_wavein_update(wave_dev->card, wiinst);
106 emu10k1_wavein_getxfersize(wiinst, &bytestocopy);
107
108 spin_unlock_irqrestore(&wiinst->lock, flags);
109
110 DPD(3, "bytestocopy --> %d\n", bytestocopy);
111
112 if ((bytestocopy >= wiinst->buffer.fragment_size)
113 || (bytestocopy >= count)) {
114 int rc;
115
116 bytestocopy = min_t(u32, bytestocopy, count);
117
118 rc = emu10k1_wavein_xferdata(wiinst,
119 (u8 __user *)buffer,
120 &bytestocopy);
121 if (rc)
122 return rc;
123
124 count -= bytestocopy;
125 buffer += bytestocopy;
126 ret += bytestocopy;
127 }
128
129 if (count > 0) {
130 if ((file->f_flags & O_NONBLOCK)
131 || (!(wave_dev->enablebits & PCM_ENABLE_INPUT)))
132 return (ret ? ret : -EAGAIN);
133
134 interruptible_sleep_on(&wiinst->wait_queue);
135
136 if (signal_pending(current))
137 return (ret ? ret : -ERESTARTSYS);
138
139 }
140 }
141
142 DPD(3, "bytes copied -> %d\n", (u32) ret);
143
144 return ret;
145}
146
147static ssize_t emu10k1_audio_write(struct file *file, const char __user *buffer, size_t count, loff_t * ppos)
148{
149 struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data;
150 struct woinst *woinst = wave_dev->woinst;
151 ssize_t ret;
152 unsigned long flags;
153
154 DPD(3, "emu10k1_audio_write(), buffer=%p, count=%d\n", buffer, (u32) count);
155
156 if (!access_ok(VERIFY_READ, buffer, count))
157 return -EFAULT;
158
159 spin_lock_irqsave(&woinst->lock, flags);
160
161 if (woinst->mmapped) {
162 spin_unlock_irqrestore(&woinst->lock, flags);
163 return -ENXIO;
164 }
165 // This is for emu10k1 revs less than 7, we need to go through tram
166 if (woinst->format.passthrough == 1) {
167 int r;
168
169 woinst->buffer.ossfragshift = PT_BLOCKSIZE_LOG2;
170 woinst->buffer.numfrags = PT_BLOCKCOUNT;
171 calculate_ofrag(woinst);
172
173 r = emu10k1_pt_write(file, buffer, count);
174 spin_unlock_irqrestore(&woinst->lock, flags);
175 return r;
176 }
177
178 if (woinst->state == WAVE_STATE_CLOSED) {
179 calculate_ofrag(woinst);
180
181 while (emu10k1_waveout_open(wave_dev) < 0) {
182 spin_unlock_irqrestore(&woinst->lock, flags);
183
184 if (file->f_flags & O_NONBLOCK)
185 return -EAGAIN;
186
187 interruptible_sleep_on(&wave_dev->card->open_wait);
188
189 if (signal_pending(current))
190 return -ERESTARTSYS;
191
192 spin_lock_irqsave(&woinst->lock, flags);
193 }
194 }
195
196 spin_unlock_irqrestore(&woinst->lock, flags);
197
198 ret = 0;
199 if (count % woinst->format.bytespersample)
200 return -EINVAL;
201
202 count /= woinst->num_voices;
203
204 while (count > 0) {
205 u32 bytestocopy;
206
207 spin_lock_irqsave(&woinst->lock, flags);
208 emu10k1_waveout_update(woinst);
209 emu10k1_waveout_getxfersize(woinst, &bytestocopy);
210 spin_unlock_irqrestore(&woinst->lock, flags);
211
212 DPD(3, "bytestocopy --> %d\n", bytestocopy);
213
214 if ((bytestocopy >= woinst->buffer.fragment_size)
215 || (bytestocopy >= count)) {
216
217 bytestocopy = min_t(u32, bytestocopy, count);
218
219 emu10k1_waveout_xferdata(woinst, (u8 __user *) buffer, &bytestocopy);
220
221 count -= bytestocopy;
222 buffer += bytestocopy * woinst->num_voices;
223 ret += bytestocopy * woinst->num_voices;
224
225 spin_lock_irqsave(&woinst->lock, flags);
226 woinst->total_copied += bytestocopy;
227
228 if (!(woinst->state & WAVE_STATE_STARTED)
229 && (wave_dev->enablebits & PCM_ENABLE_OUTPUT)
230 && (woinst->total_copied >= woinst->buffer.fragment_size))
231 emu10k1_waveout_start(wave_dev);
232
233 spin_unlock_irqrestore(&woinst->lock, flags);
234 }
235
236 if (count > 0) {
237 if ((file->f_flags & O_NONBLOCK)
238 || (!(wave_dev->enablebits & PCM_ENABLE_OUTPUT)))
239 return (ret ? ret : -EAGAIN);
240
241 interruptible_sleep_on(&woinst->wait_queue);
242
243 if (signal_pending(current))
244 return (ret ? ret : -ERESTARTSYS);
245 }
246 }
247
248 DPD(3, "bytes copied -> %d\n", (u32) ret);
249
250 return ret;
251}
252
253static int emu10k1_audio_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
254{
255 struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data;
256 struct woinst *woinst = NULL;
257 struct wiinst *wiinst = NULL;
258 int val = 0;
259 u32 bytestocopy;
260 unsigned long flags;
261 int __user *p = (int __user *)arg;
262
263 DPF(4, "emu10k1_audio_ioctl()\n");
264
265 if (file->f_mode & FMODE_WRITE)
266 woinst = wave_dev->woinst;
267
268 if (file->f_mode & FMODE_READ)
269 wiinst = wave_dev->wiinst;
270
271 switch (cmd) {
272 case OSS_GETVERSION:
273 DPF(2, "OSS_GETVERSION:\n");
274 return put_user(SOUND_VERSION, p);
275
276 case SNDCTL_DSP_RESET:
277 DPF(2, "SNDCTL_DSP_RESET:\n");
278 wave_dev->enablebits = PCM_ENABLE_OUTPUT | PCM_ENABLE_INPUT;
279
280 if (file->f_mode & FMODE_WRITE) {
281 spin_lock_irqsave(&woinst->lock, flags);
282
283 if (woinst->state & WAVE_STATE_OPEN) {
284 emu10k1_waveout_close(wave_dev);
285 }
286
287 woinst->mmapped = 0;
288 woinst->total_copied = 0;
289 woinst->total_played = 0;
290 woinst->blocks = 0;
291
292 spin_unlock_irqrestore(&woinst->lock, flags);
293 }
294
295 if (file->f_mode & FMODE_READ) {
296 spin_lock_irqsave(&wiinst->lock, flags);
297
298 if (wiinst->state & WAVE_STATE_OPEN) {
299 emu10k1_wavein_close(wave_dev);
300 }
301
302 wiinst->mmapped = 0;
303 wiinst->total_recorded = 0;
304 wiinst->blocks = 0;
305 spin_unlock_irqrestore(&wiinst->lock, flags);
306 }
307
308 break;
309
310 case SNDCTL_DSP_SYNC:
311 DPF(2, "SNDCTL_DSP_SYNC:\n");
312
313 if (file->f_mode & FMODE_WRITE) {
314
315 spin_lock_irqsave(&woinst->lock, flags);
316
317 if (woinst->state & WAVE_STATE_OPEN) {
318
319 if (woinst->state & WAVE_STATE_STARTED)
320 while ((woinst->total_played < woinst->total_copied)
321 && !signal_pending(current)) {
322 spin_unlock_irqrestore(&woinst->lock, flags);
323 interruptible_sleep_on(&woinst->wait_queue);
324 spin_lock_irqsave(&woinst->lock, flags);
325 }
326 emu10k1_waveout_close(wave_dev);
327 }
328
329 woinst->mmapped = 0;
330 woinst->total_copied = 0;
331 woinst->total_played = 0;
332 woinst->blocks = 0;
333
334 spin_unlock_irqrestore(&woinst->lock, flags);
335 }
336
337 if (file->f_mode & FMODE_READ) {
338 spin_lock_irqsave(&wiinst->lock, flags);
339
340 if (wiinst->state & WAVE_STATE_OPEN) {
341 emu10k1_wavein_close(wave_dev);
342 }
343
344 wiinst->mmapped = 0;
345 wiinst->total_recorded = 0;
346 wiinst->blocks = 0;
347 spin_unlock_irqrestore(&wiinst->lock, flags);
348 }
349
350 break;
351
352 case SNDCTL_DSP_SETDUPLEX:
353 DPF(2, "SNDCTL_DSP_SETDUPLEX:\n");
354 break;
355
356 case SNDCTL_DSP_GETCAPS:
357 DPF(2, "SNDCTL_DSP_GETCAPS:\n");
358 return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME |
359 DSP_CAP_TRIGGER | DSP_CAP_MMAP |
360 DSP_CAP_COPROC| DSP_CAP_MULTI, p);
361 case SNDCTL_DSP_SPEED:
362 DPF(2, "SNDCTL_DSP_SPEED:\n");
363
364 if (get_user(val, p))
365 return -EFAULT;
366
367 DPD(2, "val is %d\n", val);
368
369 if (val > 0) {
370 if (file->f_mode & FMODE_READ) {
371 struct wave_format format;
372
373 spin_lock_irqsave(&wiinst->lock, flags);
374
375 format = wiinst->format;
376 format.samplingrate = val;
377
378 if (emu10k1_wavein_setformat(wave_dev, &format) < 0) {
379 spin_unlock_irqrestore(&wiinst->lock, flags);
380 return -EINVAL;
381 }
382
383 val = wiinst->format.samplingrate;
384
385 spin_unlock_irqrestore(&wiinst->lock, flags);
386
387 DPD(2, "set recording sampling rate -> %d\n", val);
388 }
389
390 if (file->f_mode & FMODE_WRITE) {
391 struct wave_format format;
392
393 spin_lock_irqsave(&woinst->lock, flags);
394
395 format = woinst->format;
396 format.samplingrate = val;
397
398 if (emu10k1_waveout_setformat(wave_dev, &format) < 0) {
399 spin_unlock_irqrestore(&woinst->lock, flags);
400 return -EINVAL;
401 }
402
403 val = woinst->format.samplingrate;
404
405 spin_unlock_irqrestore(&woinst->lock, flags);
406
407 DPD(2, "set playback sampling rate -> %d\n", val);
408 }
409
410 return put_user(val, p);
411 } else {
412 if (file->f_mode & FMODE_READ)
413 val = wiinst->format.samplingrate;
414 else if (file->f_mode & FMODE_WRITE)
415 val = woinst->format.samplingrate;
416
417 return put_user(val, p);
418 }
419 break;
420
421 case SNDCTL_DSP_STEREO:
422 DPF(2, "SNDCTL_DSP_STEREO:\n");
423
424 if (get_user(val, p))
425 return -EFAULT;
426
427 DPD(2, " val is %d\n", val);
428
429 if (file->f_mode & FMODE_READ) {
430 struct wave_format format;
431
432 spin_lock_irqsave(&wiinst->lock, flags);
433
434 format = wiinst->format;
435 format.channels = val ? 2 : 1;
436
437 if (emu10k1_wavein_setformat(wave_dev, &format) < 0) {
438 spin_unlock_irqrestore(&wiinst->lock, flags);
439 return -EINVAL;
440 }
441
442 val = wiinst->format.channels - 1;
443
444 spin_unlock_irqrestore(&wiinst->lock, flags);
445 DPD(2, "set recording stereo -> %d\n", val);
446 }
447
448 if (file->f_mode & FMODE_WRITE) {
449 struct wave_format format;
450
451 spin_lock_irqsave(&woinst->lock, flags);
452
453 format = woinst->format;
454 format.channels = val ? 2 : 1;
455
456 if (emu10k1_waveout_setformat(wave_dev, &format) < 0) {
457 spin_unlock_irqrestore(&woinst->lock, flags);
458 return -EINVAL;
459 }
460
461 val = woinst->format.channels - 1;
462
463 spin_unlock_irqrestore(&woinst->lock, flags);
464
465 DPD(2, "set playback stereo -> %d\n", val);
466 }
467
468 return put_user(val, p);
469
470 break;
471
472 case SNDCTL_DSP_CHANNELS:
473 DPF(2, "SNDCTL_DSP_CHANNELS:\n");
474
475 if (get_user(val, p))
476 return -EFAULT;
477
478 DPD(2, " val is %d\n", val);
479
480 if (val > 0) {
481 if (file->f_mode & FMODE_READ) {
482 struct wave_format format;
483
484 spin_lock_irqsave(&wiinst->lock, flags);
485
486 format = wiinst->format;
487 format.channels = val;
488
489 if (emu10k1_wavein_setformat(wave_dev, &format) < 0) {
490 spin_unlock_irqrestore(&wiinst->lock, flags);
491 return -EINVAL;
492 }
493 val = wiinst->format.channels;
494
495 spin_unlock_irqrestore(&wiinst->lock, flags);
496 DPD(2, "set recording number of channels -> %d\n", val);
497 }
498
499 if (file->f_mode & FMODE_WRITE) {
500 struct wave_format format;
501
502 spin_lock_irqsave(&woinst->lock, flags);
503
504 format = woinst->format;
505 format.channels = val;
506
507 if (emu10k1_waveout_setformat(wave_dev, &format) < 0) {
508 spin_unlock_irqrestore(&woinst->lock, flags);
509 return -EINVAL;
510 }
511
512 val = woinst->format.channels;
513
514 spin_unlock_irqrestore(&woinst->lock, flags);
515 DPD(2, "set playback number of channels -> %d\n", val);
516 }
517
518 return put_user(val, p);
519 } else {
520 if (file->f_mode & FMODE_READ)
521 val = wiinst->format.channels;
522 else if (file->f_mode & FMODE_WRITE)
523 val = woinst->format.channels;
524
525 return put_user(val, p);
526 }
527 break;
528
529 case SNDCTL_DSP_GETFMTS:
530 DPF(2, "SNDCTL_DSP_GETFMTS:\n");
531
532 if (file->f_mode & FMODE_READ)
533 val = AFMT_S16_LE;
534 else if (file->f_mode & FMODE_WRITE) {
535 val = AFMT_S16_LE | AFMT_U8;
536 if (emu10k1_find_control_gpr(&wave_dev->card->mgr,
537 wave_dev->card->pt.patch_name,
538 wave_dev->card->pt.enable_gpr_name) >= 0)
539 val |= AFMT_AC3;
540 }
541 return put_user(val, p);
542
543 case SNDCTL_DSP_SETFMT: /* Same as SNDCTL_DSP_SAMPLESIZE */
544 DPF(2, "SNDCTL_DSP_SETFMT:\n");
545
546 if (get_user(val, p))
547 return -EFAULT;
548
549 DPD(2, " val is %d\n", val);
550
551 if (val != AFMT_QUERY) {
552 if (file->f_mode & FMODE_READ) {
553 struct wave_format format;
554
555 spin_lock_irqsave(&wiinst->lock, flags);
556
557 format = wiinst->format;
558 format.id = val;
559
560 if (emu10k1_wavein_setformat(wave_dev, &format) < 0) {
561 spin_unlock_irqrestore(&wiinst->lock, flags);
562 return -EINVAL;
563 }
564
565 val = wiinst->format.id;
566
567 spin_unlock_irqrestore(&wiinst->lock, flags);
568 DPD(2, "set recording format -> %d\n", val);
569 }
570
571 if (file->f_mode & FMODE_WRITE) {
572 struct wave_format format;
573
574 spin_lock_irqsave(&woinst->lock, flags);
575
576 format = woinst->format;
577 format.id = val;
578
579 if (emu10k1_waveout_setformat(wave_dev, &format) < 0) {
580 spin_unlock_irqrestore(&woinst->lock, flags);
581 return -EINVAL;
582 }
583
584 val = woinst->format.id;
585
586 spin_unlock_irqrestore(&woinst->lock, flags);
587 DPD(2, "set playback format -> %d\n", val);
588 }
589
590 return put_user(val, p);
591 } else {
592 if (file->f_mode & FMODE_READ)
593 val = wiinst->format.id;
594 else if (file->f_mode & FMODE_WRITE)
595 val = woinst->format.id;
596
597 return put_user(val, p);
598 }
599 break;
600
601 case SOUND_PCM_READ_BITS:
602
603 if (file->f_mode & FMODE_READ)
604 val = wiinst->format.bitsperchannel;
605 else if (file->f_mode & FMODE_WRITE)
606 val = woinst->format.bitsperchannel;
607
608 return put_user(val, p);
609
610 case SOUND_PCM_READ_RATE:
611
612 if (file->f_mode & FMODE_READ)
613 val = wiinst->format.samplingrate;
614 else if (file->f_mode & FMODE_WRITE)
615 val = woinst->format.samplingrate;
616
617 return put_user(val, p);
618
619 case SOUND_PCM_READ_CHANNELS:
620
621 if (file->f_mode & FMODE_READ)
622 val = wiinst->format.channels;
623 else if (file->f_mode & FMODE_WRITE)
624 val = woinst->format.channels;
625
626 return put_user(val, p);
627
628 case SOUND_PCM_WRITE_FILTER:
629 DPF(2, "SOUND_PCM_WRITE_FILTER: not implemented\n");
630 break;
631
632 case SOUND_PCM_READ_FILTER:
633 DPF(2, "SOUND_PCM_READ_FILTER: not implemented\n");
634 break;
635
636 case SNDCTL_DSP_SETSYNCRO:
637 DPF(2, "SNDCTL_DSP_SETSYNCRO: not implemented\n");
638 break;
639
640 case SNDCTL_DSP_GETTRIGGER:
641 DPF(2, "SNDCTL_DSP_GETTRIGGER:\n");
642
643 if (file->f_mode & FMODE_WRITE && (wave_dev->enablebits & PCM_ENABLE_OUTPUT))
644 val |= PCM_ENABLE_OUTPUT;
645
646 if (file->f_mode & FMODE_READ && (wave_dev->enablebits & PCM_ENABLE_INPUT))
647 val |= PCM_ENABLE_INPUT;
648
649 return put_user(val, p);
650
651 case SNDCTL_DSP_SETTRIGGER:
652 DPF(2, "SNDCTL_DSP_SETTRIGGER:\n");
653
654 if (get_user(val, p))
655 return -EFAULT;
656
657 if (file->f_mode & FMODE_WRITE) {
658 spin_lock_irqsave(&woinst->lock, flags);
659
660 if (val & PCM_ENABLE_OUTPUT) {
661 wave_dev->enablebits |= PCM_ENABLE_OUTPUT;
662 if (woinst->state & WAVE_STATE_OPEN)
663 emu10k1_waveout_start(wave_dev);
664 } else {
665 wave_dev->enablebits &= ~PCM_ENABLE_OUTPUT;
666 if (woinst->state & WAVE_STATE_STARTED)
667 emu10k1_waveout_stop(wave_dev);
668 }
669
670 spin_unlock_irqrestore(&woinst->lock, flags);
671 }
672
673 if (file->f_mode & FMODE_READ) {
674 spin_lock_irqsave(&wiinst->lock, flags);
675
676 if (val & PCM_ENABLE_INPUT) {
677 wave_dev->enablebits |= PCM_ENABLE_INPUT;
678 if (wiinst->state & WAVE_STATE_OPEN)
679 emu10k1_wavein_start(wave_dev);
680 } else {
681 wave_dev->enablebits &= ~PCM_ENABLE_INPUT;
682 if (wiinst->state & WAVE_STATE_STARTED)
683 emu10k1_wavein_stop(wave_dev);
684 }
685
686 spin_unlock_irqrestore(&wiinst->lock, flags);
687 }
688 break;
689
690 case SNDCTL_DSP_GETOSPACE:
691 {
692 audio_buf_info info;
693
694 DPF(4, "SNDCTL_DSP_GETOSPACE:\n");
695
696 if (!(file->f_mode & FMODE_WRITE))
697 return -EINVAL;
698
699 spin_lock_irqsave(&woinst->lock, flags);
700
701 if (woinst->state & WAVE_STATE_OPEN) {
702 emu10k1_waveout_update(woinst);
703 emu10k1_waveout_getxfersize(woinst, &bytestocopy);
704 info.bytes = bytestocopy;
705 } else {
706 calculate_ofrag(woinst);
707 info.bytes = woinst->buffer.size;
708 }
709 spin_unlock_irqrestore(&woinst->lock, flags);
710
711 info.bytes *= woinst->num_voices;
712 info.fragsize = woinst->buffer.fragment_size * woinst->num_voices;
713 info.fragstotal = woinst->buffer.numfrags * woinst->num_voices;
714 info.fragments = info.bytes / info.fragsize;
715
716 if (copy_to_user(p, &info, sizeof(info)))
717 return -EFAULT;
718 }
719 break;
720
721 case SNDCTL_DSP_GETISPACE:
722 {
723 audio_buf_info info;
724
725 DPF(4, "SNDCTL_DSP_GETISPACE:\n");
726
727 if (!(file->f_mode & FMODE_READ))
728 return -EINVAL;
729
730 spin_lock_irqsave(&wiinst->lock, flags);
731 if (wiinst->state & WAVE_STATE_OPEN) {
732 emu10k1_wavein_update(wave_dev->card, wiinst);
733 emu10k1_wavein_getxfersize(wiinst, &bytestocopy);
734 info.bytes = bytestocopy;
735 } else {
736 calculate_ifrag(wiinst);
737 info.bytes = 0;
738 }
739 spin_unlock_irqrestore(&wiinst->lock, flags);
740
741 info.fragstotal = wiinst->buffer.numfrags;
742 info.fragments = info.bytes / wiinst->buffer.fragment_size;
743 info.fragsize = wiinst->buffer.fragment_size;
744
745 if (copy_to_user(p, &info, sizeof(info)))
746 return -EFAULT;
747 }
748 break;
749
750 case SNDCTL_DSP_NONBLOCK:
751 DPF(2, "SNDCTL_DSP_NONBLOCK:\n");
752
753 file->f_flags |= O_NONBLOCK;
754 break;
755
756 case SNDCTL_DSP_GETODELAY:
757 DPF(4, "SNDCTL_DSP_GETODELAY:\n");
758
759 if (!(file->f_mode & FMODE_WRITE))
760 return -EINVAL;
761
762 spin_lock_irqsave(&woinst->lock, flags);
763 if (woinst->state & WAVE_STATE_OPEN) {
764 emu10k1_waveout_update(woinst);
765 emu10k1_waveout_getxfersize(woinst, &bytestocopy);
766 val = woinst->buffer.size - bytestocopy;
767 } else
768 val = 0;
769
770 val *= woinst->num_voices;
771 spin_unlock_irqrestore(&woinst->lock, flags);
772
773 return put_user(val, p);
774
775 case SNDCTL_DSP_GETIPTR:
776 {
777 count_info cinfo;
778
779 DPF(4, "SNDCTL_DSP_GETIPTR: \n");
780
781 if (!(file->f_mode & FMODE_READ))
782 return -EINVAL;
783
784 spin_lock_irqsave(&wiinst->lock, flags);
785
786 if (wiinst->state & WAVE_STATE_OPEN) {
787 emu10k1_wavein_update(wave_dev->card, wiinst);
788 cinfo.ptr = wiinst->buffer.hw_pos;
789 cinfo.bytes = cinfo.ptr + wiinst->total_recorded - wiinst->total_recorded % wiinst->buffer.size;
790 cinfo.blocks = cinfo.bytes / wiinst->buffer.fragment_size - wiinst->blocks;
791 wiinst->blocks = cinfo.bytes / wiinst->buffer.fragment_size;
792 } else {
793 cinfo.ptr = 0;
794 cinfo.bytes = 0;
795 cinfo.blocks = 0;
796 }
797
798 if (wiinst->mmapped)
799 wiinst->buffer.bytestocopy %= wiinst->buffer.fragment_size;
800
801 spin_unlock_irqrestore(&wiinst->lock, flags);
802
803 if (copy_to_user(p, &cinfo, sizeof(cinfo)))
804 return -EFAULT;
805 }
806 break;
807
808 case SNDCTL_DSP_GETOPTR:
809 {
810 count_info cinfo;
811
812 DPF(4, "SNDCTL_DSP_GETOPTR:\n");
813
814 if (!(file->f_mode & FMODE_WRITE))
815 return -EINVAL;
816
817 spin_lock_irqsave(&woinst->lock, flags);
818
819 if (woinst->state & WAVE_STATE_OPEN ||
820 ((woinst->format.passthrough == 1) && wave_dev->card->pt.state)) {
821 int num_fragments;
822
823 if (woinst->format.passthrough == 1) {
824 emu10k1_pt_waveout_update(wave_dev);
825 cinfo.bytes = woinst->total_played;
826 } else {
827 emu10k1_waveout_update(woinst);
828 cinfo.bytes = woinst->total_played;
829 }
830
831 cinfo.ptr = woinst->buffer.hw_pos;
832 num_fragments = cinfo.bytes / woinst->buffer.fragment_size;
833 cinfo.blocks = num_fragments - woinst->blocks;
834 woinst->blocks = num_fragments;
835
836 cinfo.bytes *= woinst->num_voices;
837 cinfo.ptr *= woinst->num_voices;
838 } else {
839 cinfo.ptr = 0;
840 cinfo.bytes = 0;
841 cinfo.blocks = 0;
842 }
843
844 if (woinst->mmapped)
845 woinst->buffer.free_bytes %= woinst->buffer.fragment_size;
846
847 spin_unlock_irqrestore(&woinst->lock, flags);
848
849 if (copy_to_user(p, &cinfo, sizeof(cinfo)))
850 return -EFAULT;
851 }
852 break;
853
854 case SNDCTL_DSP_GETBLKSIZE:
855 DPF(2, "SNDCTL_DSP_GETBLKSIZE:\n");
856
857 if (file->f_mode & FMODE_WRITE) {
858 spin_lock_irqsave(&woinst->lock, flags);
859
860 calculate_ofrag(woinst);
861 val = woinst->buffer.fragment_size * woinst->num_voices;
862
863 spin_unlock_irqrestore(&woinst->lock, flags);
864 }
865
866 if (file->f_mode & FMODE_READ) {
867 spin_lock_irqsave(&wiinst->lock, flags);
868
869 calculate_ifrag(wiinst);
870 val = wiinst->buffer.fragment_size;
871
872 spin_unlock_irqrestore(&wiinst->lock, flags);
873 }
874
875 return put_user(val, p);
876
877 break;
878
879 case SNDCTL_DSP_POST:
880 if (file->f_mode & FMODE_WRITE) {
881 spin_lock_irqsave(&woinst->lock, flags);
882
883 if (!(woinst->state & WAVE_STATE_STARTED)
884 && (wave_dev->enablebits & PCM_ENABLE_OUTPUT)
885 && (woinst->total_copied > 0))
886 emu10k1_waveout_start(wave_dev);
887
888 spin_unlock_irqrestore(&woinst->lock, flags);
889 }
890
891 break;
892
893 case SNDCTL_DSP_SUBDIVIDE:
894 DPF(2, "SNDCTL_DSP_SUBDIVIDE: not implemented\n");
895 break;
896
897 case SNDCTL_DSP_SETFRAGMENT:
898 DPF(2, "SNDCTL_DSP_SETFRAGMENT:\n");
899
900 if (get_user(val, p))
901 return -EFAULT;
902
903 DPD(2, "val is %#x\n", val);
904
905 if (val == 0)
906 return -EIO;
907
908 if (file->f_mode & FMODE_WRITE) {
909 /* digital pass-through fragment count and size are fixed values */
910 if (woinst->state & WAVE_STATE_OPEN || (woinst->format.passthrough == 1))
911 return -EINVAL; /* too late to change */
912
913 woinst->buffer.ossfragshift = val & 0xffff;
914 woinst->buffer.numfrags = (val >> 16) & 0xffff;
915 }
916
917 if (file->f_mode & FMODE_READ) {
918 if (wiinst->state & WAVE_STATE_OPEN)
919 return -EINVAL; /* too late to change */
920
921 wiinst->buffer.ossfragshift = val & 0xffff;
922 wiinst->buffer.numfrags = (val >> 16) & 0xffff;
923 }
924
925 break;
926
927 case SNDCTL_COPR_LOAD:
928 {
929 copr_buffer *buf;
930 u32 i;
931
932 DPF(4, "SNDCTL_COPR_LOAD:\n");
933
934 buf = kmalloc(sizeof(copr_buffer), GFP_KERNEL);
935 if (!buf)
936 return -ENOMEM;
937
938 if (copy_from_user(buf, p, sizeof(copr_buffer))) {
939 kfree (buf);
940 return -EFAULT;
941 }
942
943 if ((buf->command != CMD_READ) && (buf->command != CMD_WRITE)) {
944 kfree (buf);
945 return -EINVAL;
946 }
947
948 if (buf->command == CMD_WRITE) {
949
950#ifdef DBGEMU
951 if ((buf->offs < 0) || (buf->offs + buf->len > 0xe00) || (buf->len > 1000)) {
952#else
953 if (((buf->offs < 0x100) || (buf->offs + buf->len > (wave_dev->card->is_audigy ? 0xe00 : 0x800)) || (buf->len > 1000)
954 ) && !(
955 //any register allowed raw access to users goes here:
956 (buf->offs == DBG ||
957 buf->offs == A_DBG)
958 && (buf->len == 1))) {
959#endif
960 kfree(buf);
961 return -EINVAL;
962 }
963 } else {
964 if ((buf->offs < 0) || (buf->offs + buf->len > 0xe00) || (buf->len > 1000)) {
965 kfree(buf);
966 return -EINVAL;
967 }
968 }
969
970 if (((unsigned)buf->flags) > 0x3f)
971 buf->flags = 0;
972
973 if (buf->command == CMD_READ) {
974 for (i = 0; i < buf->len; i++)
975 ((u32 *) buf->data)[i] = sblive_readptr(wave_dev->card, buf->offs + i, buf->flags);
976
977 if (copy_to_user(p, buf, sizeof(copr_buffer))) {
978 kfree(buf);
979 return -EFAULT;
980 }
981 } else {
982 for (i = 0; i < buf->len; i++)
983 sblive_writeptr(wave_dev->card, buf->offs + i, buf->flags, ((u32 *) buf->data)[i]);
984 }
985
986 kfree (buf);
987 break;
988 }
989
990 default: /* Default is unrecognized command */
991 DPD(2, "default: %#x\n", cmd);
992 return -EINVAL;
993 }
994 return 0;
995}
996
997static struct page *emu10k1_mm_nopage (struct vm_area_struct * vma, unsigned long address, int *type)
998{
999 struct emu10k1_wavedevice *wave_dev = vma->vm_private_data;
1000 struct woinst *woinst = wave_dev->woinst;
1001 struct wiinst *wiinst = wave_dev->wiinst;
1002 struct page *dmapage;
1003 unsigned long pgoff;
1004 int rd, wr;
1005
1006 DPF(3, "emu10k1_mm_nopage()\n");
1007 DPD(3, "addr: %#lx\n", address);
1008
1009 if (address > vma->vm_end) {
1010 DPF(1, "EXIT, returning NOPAGE_SIGBUS\n");
1011 return NOPAGE_SIGBUS; /* Disallow mremap */
1012 }
1013
1014 pgoff = vma->vm_pgoff + ((address - vma->vm_start) >> PAGE_SHIFT);
1015 if (woinst != NULL)
1016 wr = woinst->mmapped;
1017 else
1018 wr = 0;
1019
1020 if (wiinst != NULL)
1021 rd = wiinst->mmapped;
1022 else
1023 rd = 0;
1024
1025 /* if full-duplex (read+write) and we have two sets of bufs,
1026 * then the playback buffers come first, sez soundcard.c */
1027 if (wr) {
1028 if (pgoff >= woinst->buffer.pages) {
1029 pgoff -= woinst->buffer.pages;
1030 dmapage = virt_to_page ((u8 *) wiinst->buffer.addr + pgoff * PAGE_SIZE);
1031 } else
1032 dmapage = virt_to_page (woinst->voice[0].mem.addr[pgoff]);
1033 } else {
1034 dmapage = virt_to_page ((u8 *) wiinst->buffer.addr + pgoff * PAGE_SIZE);
1035 }
1036
1037 get_page (dmapage);
1038
1039 DPD(3, "page: %#lx\n", (unsigned long) dmapage);
1040 if (type)
1041 *type = VM_FAULT_MINOR;
1042 return dmapage;
1043}
1044
1045static struct vm_operations_struct emu10k1_mm_ops = {
1046 .nopage = emu10k1_mm_nopage,
1047};
1048
1049static int emu10k1_audio_mmap(struct file *file, struct vm_area_struct *vma)
1050{
1051 struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data;
1052 unsigned long max_pages, n_pages, pgoffset;
1053 struct woinst *woinst = NULL;
1054 struct wiinst *wiinst = NULL;
1055 unsigned long flags;
1056
1057 DPF(2, "emu10k1_audio_mmap()\n");
1058
1059 max_pages = 0;
1060 if (vma->vm_flags & VM_WRITE) {
1061 woinst = wave_dev->woinst;
1062
1063 spin_lock_irqsave(&woinst->lock, flags);
1064
1065 /* No m'mapping possible for multichannel */
1066 if (woinst->num_voices > 1) {
1067 spin_unlock_irqrestore(&woinst->lock, flags);
1068 return -EINVAL;
1069 }
1070
1071 if (woinst->state == WAVE_STATE_CLOSED) {
1072 calculate_ofrag(woinst);
1073
1074 if (emu10k1_waveout_open(wave_dev) < 0) {
1075 spin_unlock_irqrestore(&woinst->lock, flags);
1076 ERROR();
1077 return -EINVAL;
1078 }
1079 }
1080
1081 woinst->mmapped = 1;
1082 max_pages += woinst->buffer.pages;
1083 spin_unlock_irqrestore(&woinst->lock, flags);
1084 }
1085
1086 if (vma->vm_flags & VM_READ) {
1087 wiinst = wave_dev->wiinst;
1088
1089 spin_lock_irqsave(&wiinst->lock, flags);
1090 if (wiinst->state == WAVE_STATE_CLOSED) {
1091 calculate_ifrag(wiinst);
1092
1093 if (emu10k1_wavein_open(wave_dev) < 0) {
1094 spin_unlock_irqrestore(&wiinst->lock, flags);
1095 ERROR();
1096 return -EINVAL;
1097 }
1098 }
1099
1100 wiinst->mmapped = 1;
1101 max_pages += wiinst->buffer.pages;
1102 spin_unlock_irqrestore(&wiinst->lock, flags);
1103 }
1104
1105 n_pages = ((vma->vm_end - vma->vm_start) + PAGE_SIZE - 1) >> PAGE_SHIFT;
1106 pgoffset = vma->vm_pgoff;
1107
1108 DPD(2, "vma_start: %#lx, vma_end: %#lx, vma_offset: %ld\n", vma->vm_start, vma->vm_end, pgoffset);
1109 DPD(2, "n_pages: %ld, max_pages: %ld\n", n_pages, max_pages);
1110
1111 if (pgoffset + n_pages > max_pages)
1112 return -EINVAL;
1113
1114 vma->vm_flags |= VM_RESERVED;
1115 vma->vm_ops = &emu10k1_mm_ops;
1116 vma->vm_private_data = wave_dev;
1117 return 0;
1118}
1119
1120static int emu10k1_audio_open(struct inode *inode, struct file *file)
1121{
1122 int minor = iminor(inode);
1123 struct emu10k1_card *card = NULL;
1124 struct list_head *entry;
1125 struct emu10k1_wavedevice *wave_dev;
1126
1127 DPF(2, "emu10k1_audio_open()\n");
1128
1129 /* Check for correct device to open */
1130
1131 list_for_each(entry, &emu10k1_devs) {
1132 card = list_entry(entry, struct emu10k1_card, list);
1133
1134 if (!((card->audio_dev ^ minor) & ~0xf) || !((card->audio_dev1 ^ minor) & ~0xf))
1135 goto match;
1136 }
1137
1138 return -ENODEV;
1139
1140match:
1141
1142 wave_dev = kmalloc(sizeof(struct emu10k1_wavedevice), GFP_KERNEL);
1143
1144 if (wave_dev == NULL) {
1145 ERROR();
1146 return -ENOMEM;
1147 }
1148
1149 wave_dev->card = card;
1150 wave_dev->wiinst = NULL;
1151 wave_dev->woinst = NULL;
1152 wave_dev->enablebits = PCM_ENABLE_OUTPUT | PCM_ENABLE_INPUT; /* Default */
1153
1154 if (file->f_mode & FMODE_READ) {
1155 /* Recording */
1156 struct wiinst *wiinst;
1157
1158 if ((wiinst = kmalloc(sizeof(struct wiinst), GFP_KERNEL)) == NULL) {
1159 ERROR();
1160 kfree(wave_dev);
1161 return -ENOMEM;
1162 }
1163
1164 wiinst->recsrc = card->wavein.recsrc;
1165 wiinst->fxwc = card->wavein.fxwc;
1166
1167 switch (wiinst->recsrc) {
1168 case WAVERECORD_AC97:
1169 wiinst->format.id = AFMT_S16_LE;
1170 wiinst->format.samplingrate = 8000;
1171 wiinst->format.bitsperchannel = 16;
1172 wiinst->format.channels = 1;
1173 break;
1174 case WAVERECORD_MIC:
1175 wiinst->format.id = AFMT_S16_LE;
1176 wiinst->format.samplingrate = 8000;
1177 wiinst->format.bitsperchannel = 16;
1178 wiinst->format.channels = 1;
1179 break;
1180 case WAVERECORD_FX:
1181 wiinst->format.id = AFMT_S16_LE;
1182 wiinst->format.samplingrate = 48000;
1183 wiinst->format.bitsperchannel = 16;
1184 wiinst->format.channels = hweight32(wiinst->fxwc);
1185 break;
1186 default:
1187 kfree(wave_dev);
1188 kfree(wiinst);
1189 BUG();
1190 break;
1191 }
1192
1193 wiinst->state = WAVE_STATE_CLOSED;
1194
1195 wiinst->buffer.ossfragshift = 0;
1196 wiinst->buffer.fragment_size = 0;
1197 wiinst->buffer.numfrags = 0;
1198
1199 init_waitqueue_head(&wiinst->wait_queue);
1200
1201 wiinst->mmapped = 0;
1202 wiinst->total_recorded = 0;
1203 wiinst->blocks = 0;
1204 spin_lock_init(&wiinst->lock);
1205 tasklet_init(&wiinst->timer.tasklet, emu10k1_wavein_bh, (unsigned long) wave_dev);
1206 wave_dev->wiinst = wiinst;
1207 emu10k1_wavein_setformat(wave_dev, &wiinst->format);
1208 }
1209
1210 if (file->f_mode & FMODE_WRITE) {
1211 struct woinst *woinst;
1212 int i;
1213
1214 if ((woinst = kmalloc(sizeof(struct woinst), GFP_KERNEL)) == NULL) {
1215 ERROR();
1216 kfree(wave_dev);
1217 return -ENOMEM;
1218 }
1219
1220 if (wave_dev->wiinst != NULL) {
1221 woinst->format = wave_dev->wiinst->format;
1222 } else {
1223 woinst->format.id = AFMT_U8;
1224 woinst->format.samplingrate = 8000;
1225 woinst->format.bitsperchannel = 8;
1226 woinst->format.channels = 1;
1227 }
1228
1229 woinst->state = WAVE_STATE_CLOSED;
1230
1231 woinst->buffer.fragment_size = 0;
1232 woinst->buffer.ossfragshift = 0;
1233 woinst->buffer.numfrags = 0;
1234 woinst->device = (card->audio_dev1 == minor);
1235 woinst->timer.state = TIMER_STATE_UNINSTALLED;
1236 woinst->num_voices = 1;
1237 for (i = 0; i < WAVEOUT_MAXVOICES; i++) {
1238 woinst->voice[i].usage = VOICE_USAGE_FREE;
1239 woinst->voice[i].mem.emupageindex = -1;
1240 }
1241
1242 init_waitqueue_head(&woinst->wait_queue);
1243
1244 woinst->mmapped = 0;
1245 woinst->total_copied = 0;
1246 woinst->total_played = 0;
1247 woinst->blocks = 0;
1248 spin_lock_init(&woinst->lock);
1249 tasklet_init(&woinst->timer.tasklet, emu10k1_waveout_bh, (unsigned long) wave_dev);
1250 wave_dev->woinst = woinst;
1251 emu10k1_waveout_setformat(wave_dev, &woinst->format);
1252 }
1253
1254 file->private_data = (void *) wave_dev;
1255
1256 return nonseekable_open(inode, file);
1257}
1258
1259static int emu10k1_audio_release(struct inode *inode, struct file *file)
1260{
1261 struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data;
1262 struct emu10k1_card *card;
1263 unsigned long flags;
1264
1265 card = wave_dev->card;
1266
1267 DPF(2, "emu10k1_audio_release()\n");
1268
1269 if (file->f_mode & FMODE_WRITE) {
1270 struct woinst *woinst = wave_dev->woinst;
1271
1272 spin_lock_irqsave(&woinst->lock, flags);
1273 if(woinst->format.passthrough==2)
1274 card->pt.state=PT_STATE_PLAYING;
1275 if (woinst->format.passthrough && card->pt.state != PT_STATE_INACTIVE){
1276 spin_lock(&card->pt.lock);
1277 emu10k1_pt_stop(card);
1278 spin_unlock(&card->pt.lock);
1279 }
1280 if (woinst->state & WAVE_STATE_OPEN) {
1281 if (woinst->state & WAVE_STATE_STARTED) {
1282 if (!(file->f_flags & O_NONBLOCK)) {
1283 while (!signal_pending(current)
1284 && (woinst->total_played < woinst->total_copied)) {
1285 DPF(4, "Buffer hasn't been totally played, sleep....\n");
1286 spin_unlock_irqrestore(&woinst->lock, flags);
1287 interruptible_sleep_on(&woinst->wait_queue);
1288 spin_lock_irqsave(&woinst->lock, flags);
1289 }
1290 }
1291 }
1292 emu10k1_waveout_close(wave_dev);
1293 }
1294
1295 spin_unlock_irqrestore(&woinst->lock, flags);
1296 /* remove the tasklet */
1297 tasklet_kill(&woinst->timer.tasklet);
1298 kfree(wave_dev->woinst);
1299 }
1300
1301 if (file->f_mode & FMODE_READ) {
1302 struct wiinst *wiinst = wave_dev->wiinst;
1303
1304 spin_lock_irqsave(&wiinst->lock, flags);
1305
1306 if (wiinst->state & WAVE_STATE_OPEN) {
1307 emu10k1_wavein_close(wave_dev);
1308 }
1309
1310 spin_unlock_irqrestore(&wiinst->lock, flags);
1311 tasklet_kill(&wiinst->timer.tasklet);
1312 kfree(wave_dev->wiinst);
1313 }
1314
1315 kfree(wave_dev);
1316
1317 if (waitqueue_active(&card->open_wait))
1318 wake_up_interruptible(&card->open_wait);
1319
1320 return 0;
1321}
1322
1323/* FIXME sort out poll() + mmap() */
1324static unsigned int emu10k1_audio_poll(struct file *file, struct poll_table_struct *wait)
1325{
1326 struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data;
1327 struct woinst *woinst = wave_dev->woinst;
1328 struct wiinst *wiinst = wave_dev->wiinst;
1329 unsigned int mask = 0;
1330 u32 bytestocopy;
1331 unsigned long flags;
1332
1333 DPF(4, "emu10k1_audio_poll()\n");
1334
1335 if (file->f_mode & FMODE_WRITE)
1336 poll_wait(file, &woinst->wait_queue, wait);
1337
1338 if (file->f_mode & FMODE_READ)
1339 poll_wait(file, &wiinst->wait_queue, wait);
1340
1341 if (file->f_mode & FMODE_WRITE) {
1342 spin_lock_irqsave(&woinst->lock, flags);
1343
1344 if (woinst->state & WAVE_STATE_OPEN) {
1345 emu10k1_waveout_update(woinst);
1346 emu10k1_waveout_getxfersize(woinst, &bytestocopy);
1347
1348 if (bytestocopy >= woinst->buffer.fragment_size)
1349 mask |= POLLOUT | POLLWRNORM;
1350 } else
1351 mask |= POLLOUT | POLLWRNORM;
1352
1353 spin_unlock_irqrestore(&woinst->lock, flags);
1354 }
1355
1356 if (file->f_mode & FMODE_READ) {
1357 spin_lock_irqsave(&wiinst->lock, flags);
1358
1359 if (wiinst->state & WAVE_STATE_OPEN) {
1360 emu10k1_wavein_update(wave_dev->card, wiinst);
1361 emu10k1_wavein_getxfersize(wiinst, &bytestocopy);
1362
1363 if (bytestocopy >= wiinst->buffer.fragment_size)
1364 mask |= POLLIN | POLLRDNORM;
1365 }
1366
1367 spin_unlock_irqrestore(&wiinst->lock, flags);
1368 }
1369
1370 return mask;
1371}
1372
1373static void calculate_ofrag(struct woinst *woinst)
1374{
1375 struct waveout_buffer *buffer = &woinst->buffer;
1376 u32 fragsize;
1377
1378 if (buffer->fragment_size)
1379 return;
1380
1381 if (!buffer->ossfragshift) {
1382 fragsize = (woinst->format.bytespervoicesample * woinst->format.samplingrate * WAVEOUT_DEFAULTFRAGLEN) / 1000 - 1;
1383
1384 while (fragsize) {
1385 fragsize >>= 1;
1386 buffer->ossfragshift++;
1387 }
1388 }
1389
1390 if (buffer->ossfragshift < WAVEOUT_MINFRAGSHIFT)
1391 buffer->ossfragshift = WAVEOUT_MINFRAGSHIFT;
1392
1393 buffer->fragment_size = 1 << buffer->ossfragshift;
1394
1395 while (buffer->fragment_size * WAVEOUT_MINFRAGS > WAVEOUT_MAXBUFSIZE)
1396 buffer->fragment_size >>= 1;
1397
1398 /* now we are sure that:
1399 (2^WAVEOUT_MINFRAGSHIFT) <= (fragment_size = 2^n) <= (WAVEOUT_MAXBUFSIZE / WAVEOUT_MINFRAGS)
1400 */
1401
1402 if (!buffer->numfrags) {
1403 u32 numfrags;
1404
1405 numfrags = (woinst->format.bytespervoicesample * woinst->format.samplingrate * WAVEOUT_DEFAULTBUFLEN) /
1406 (buffer->fragment_size * 1000) - 1;
1407
1408 buffer->numfrags = 1;
1409
1410 while (numfrags) {
1411 numfrags >>= 1;
1412 buffer->numfrags <<= 1;
1413 }
1414 }
1415
1416 if (buffer->numfrags < WAVEOUT_MINFRAGS)
1417 buffer->numfrags = WAVEOUT_MINFRAGS;
1418
1419 if (buffer->numfrags * buffer->fragment_size > WAVEOUT_MAXBUFSIZE)
1420 buffer->numfrags = WAVEOUT_MAXBUFSIZE / buffer->fragment_size;
1421
1422 if (buffer->numfrags < WAVEOUT_MINFRAGS)
1423 BUG();
1424
1425 buffer->size = buffer->fragment_size * buffer->numfrags;
1426 buffer->pages = buffer->size / PAGE_SIZE + ((buffer->size % PAGE_SIZE) ? 1 : 0);
1427
1428 DPD(2, " calculated playback fragment_size -> %d\n", buffer->fragment_size);
1429 DPD(2, " calculated playback numfrags -> %d\n", buffer->numfrags);
1430
1431 return;
1432}
1433
1434static void calculate_ifrag(struct wiinst *wiinst)
1435{
1436 struct wavein_buffer *buffer = &wiinst->buffer;
1437 u32 fragsize, bufsize, size[4];
1438 int i, j;
1439
1440 if (buffer->fragment_size)
1441 return;
1442
1443 if (!buffer->ossfragshift) {
1444 fragsize = (wiinst->format.bytespersec * WAVEIN_DEFAULTFRAGLEN) / 1000 - 1;
1445
1446 while (fragsize) {
1447 fragsize >>= 1;
1448 buffer->ossfragshift++;
1449 }
1450 }
1451
1452 if (buffer->ossfragshift < WAVEIN_MINFRAGSHIFT)
1453 buffer->ossfragshift = WAVEIN_MINFRAGSHIFT;
1454
1455 buffer->fragment_size = 1 << buffer->ossfragshift;
1456
1457 while (buffer->fragment_size * WAVEIN_MINFRAGS > WAVEIN_MAXBUFSIZE)
1458 buffer->fragment_size >>= 1;
1459
1460 /* now we are sure that:
1461 (2^WAVEIN_MINFRAGSHIFT) <= (fragment_size = 2^n) <= (WAVEIN_MAXBUFSIZE / WAVEIN_MINFRAGS)
1462 */
1463
1464
1465 if (!buffer->numfrags)
1466 buffer->numfrags = (wiinst->format.bytespersec * WAVEIN_DEFAULTBUFLEN) / (buffer->fragment_size * 1000) - 1;
1467
1468 if (buffer->numfrags < WAVEIN_MINFRAGS)
1469 buffer->numfrags = WAVEIN_MINFRAGS;
1470
1471 if (buffer->numfrags * buffer->fragment_size > WAVEIN_MAXBUFSIZE)
1472 buffer->numfrags = WAVEIN_MAXBUFSIZE / buffer->fragment_size;
1473
1474 if (buffer->numfrags < WAVEIN_MINFRAGS)
1475 BUG();
1476
1477 bufsize = buffer->fragment_size * buffer->numfrags;
1478
1479 /* the buffer size for recording is restricted to certain values, adjust it now */
1480 if (bufsize >= 0x10000) {
1481 buffer->size = 0x10000;
1482 buffer->sizeregval = 0x1f;
1483 } else {
1484 buffer->size = 0;
1485 size[0] = 384;
1486 size[1] = 448;
1487 size[2] = 512;
1488 size[3] = 640;
1489
1490 for (i = 0; i < 8; i++)
1491 for (j = 0; j < 4; j++)
1492 if (bufsize >= size[j]) {
1493 buffer->size = size[j];
1494 size[j] *= 2;
1495 buffer->sizeregval = i * 4 + j + 1;
1496 } else
1497 goto exitloop;
1498 exitloop:
1499 if (buffer->size == 0) {
1500 buffer->size = 384;
1501 buffer->sizeregval = 0x01;
1502 }
1503 }
1504
1505 /* adjust the fragment size so that buffer size is an integer multiple */
1506 while (buffer->size % buffer->fragment_size)
1507 buffer->fragment_size >>= 1;
1508
1509 buffer->numfrags = buffer->size / buffer->fragment_size;
1510 buffer->pages = buffer->size / PAGE_SIZE + ((buffer->size % PAGE_SIZE) ? 1 : 0);
1511
1512 DPD(2, " calculated recording fragment_size -> %d\n", buffer->fragment_size);
1513 DPD(2, " calculated recording numfrags -> %d\n", buffer->numfrags);
1514 DPD(2, " buffer size register -> %#04x\n", buffer->sizeregval);
1515
1516 return;
1517}
1518
1519static void emu10k1_wavein_bh(unsigned long refdata)
1520{
1521 struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) refdata;
1522 struct wiinst *wiinst = wave_dev->wiinst;
1523 u32 bytestocopy;
1524 unsigned long flags;
1525
1526 if (!wiinst)
1527 return;
1528
1529 spin_lock_irqsave(&wiinst->lock, flags);
1530
1531 if (!(wiinst->state & WAVE_STATE_STARTED)) {
1532 spin_unlock_irqrestore(&wiinst->lock, flags);
1533 return;
1534 }
1535
1536 emu10k1_wavein_update(wave_dev->card, wiinst);
1537 emu10k1_wavein_getxfersize(wiinst, &bytestocopy);
1538
1539 spin_unlock_irqrestore(&wiinst->lock, flags);
1540
1541 if (bytestocopy >= wiinst->buffer.fragment_size) {
1542 if (waitqueue_active(&wiinst->wait_queue))
1543 wake_up_interruptible(&wiinst->wait_queue);
1544 } else
1545 DPD(3, "Not enough transfer size, %d\n", bytestocopy);
1546
1547 return;
1548}
1549
1550static void emu10k1_waveout_bh(unsigned long refdata)
1551{
1552 struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) refdata;
1553 struct woinst *woinst = wave_dev->woinst;
1554 u32 bytestocopy;
1555 unsigned long flags;
1556
1557 if (!woinst)
1558 return;
1559
1560 spin_lock_irqsave(&woinst->lock, flags);
1561
1562 if (!(woinst->state & WAVE_STATE_STARTED)) {
1563 spin_unlock_irqrestore(&woinst->lock, flags);
1564 return;
1565 }
1566
1567 emu10k1_waveout_update(woinst);
1568 emu10k1_waveout_getxfersize(woinst, &bytestocopy);
1569
1570 if (woinst->buffer.fill_silence) {
1571 spin_unlock_irqrestore(&woinst->lock, flags);
1572 emu10k1_waveout_fillsilence(woinst);
1573 } else
1574 spin_unlock_irqrestore(&woinst->lock, flags);
1575
1576 if (bytestocopy >= woinst->buffer.fragment_size) {
1577 if (waitqueue_active(&woinst->wait_queue))
1578 wake_up_interruptible(&woinst->wait_queue);
1579 } else
1580 DPD(3, "Not enough transfer size -> %d\n", bytestocopy);
1581
1582 return;
1583}
1584
1585const struct file_operations emu10k1_audio_fops = {
1586 .owner = THIS_MODULE,
1587 .llseek = no_llseek,
1588 .read = emu10k1_audio_read,
1589 .write = emu10k1_audio_write,
1590 .poll = emu10k1_audio_poll,
1591 .ioctl = emu10k1_audio_ioctl,
1592 .mmap = emu10k1_audio_mmap,
1593 .open = emu10k1_audio_open,
1594 .release = emu10k1_audio_release,
1595};
diff --git a/sound/oss/emu10k1/audio.h b/sound/oss/emu10k1/audio.h
deleted file mode 100644
index 26ee81bbd6c6..000000000000
--- a/sound/oss/emu10k1/audio.h
+++ /dev/null
@@ -1,44 +0,0 @@
1/*
2 **********************************************************************
3 * audio.c -- /dev/dsp interface for emu10k1 driver
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 * November 2, 1999 Alan Cox cleaned up types/leaks
12 *
13 **********************************************************************
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this program; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
28 * USA.
29 *
30 **********************************************************************
31 */
32
33#ifndef _AUDIO_H
34#define _AUDIO_H
35
36struct emu10k1_wavedevice
37{
38 struct emu10k1_card *card;
39 struct wiinst *wiinst;
40 struct woinst *woinst;
41 u16 enablebits;
42};
43
44#endif /* _AUDIO_H */
diff --git a/sound/oss/emu10k1/cardmi.c b/sound/oss/emu10k1/cardmi.c
deleted file mode 100644
index 57674f8c8a2e..000000000000
--- a/sound/oss/emu10k1/cardmi.c
+++ /dev/null
@@ -1,832 +0,0 @@
1/*
2 **********************************************************************
3 * sblive_mi.c - MIDI UART input HAL for emu10k1 driver
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 * November 2, 1999 Alan Cox clean up
12 *
13 **********************************************************************
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this program; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
28 * USA.
29 *
30 **********************************************************************
31 */
32
33#include <linux/slab.h>
34#include <linux/jiffies.h>
35
36#include "hwaccess.h"
37#include "8010.h"
38#include "cardmi.h"
39#include "irqmgr.h"
40
41
42static int emu10k1_mpuin_callback(struct emu10k1_mpuin *card_mpuin, u32 msg, unsigned long data, u32 bytesvalid);
43
44static int sblive_miStateInit(struct emu10k1_mpuin *);
45static int sblive_miStateEntry(struct emu10k1_mpuin *, u8);
46static int sblive_miStateParse(struct emu10k1_mpuin *, u8);
47static int sblive_miState3Byte(struct emu10k1_mpuin *, u8);
48static int sblive_miState3ByteKey(struct emu10k1_mpuin *, u8);
49static int sblive_miState3ByteVel(struct emu10k1_mpuin *, u8);
50static int sblive_miState2Byte(struct emu10k1_mpuin *, u8);
51static int sblive_miState2ByteKey(struct emu10k1_mpuin *, u8);
52static int sblive_miStateSysCommon2(struct emu10k1_mpuin *, u8);
53static int sblive_miStateSysCommon2Key(struct emu10k1_mpuin *, u8);
54static int sblive_miStateSysCommon3(struct emu10k1_mpuin *, u8);
55static int sblive_miStateSysCommon3Key(struct emu10k1_mpuin *, u8);
56static int sblive_miStateSysCommon3Vel(struct emu10k1_mpuin *, u8);
57static int sblive_miStateSysExNorm(struct emu10k1_mpuin *, u8);
58static int sblive_miStateSysReal(struct emu10k1_mpuin *, u8);
59
60
61static struct {
62 int (*Fn) (struct emu10k1_mpuin *, u8);
63} midistatefn[] = {
64
65 {
66 sblive_miStateParse}, {
67 sblive_miState3Byte}, /* 0x8n, 0x9n, 0xAn, 0xBn, 0xEn */
68 {
69 sblive_miState3ByteKey}, /* Byte 1 */
70 {
71 sblive_miState3ByteVel}, /* Byte 2 */
72 {
73 sblive_miState2Byte}, /* 0xCn, 0xDn */
74 {
75 sblive_miState2ByteKey}, /* Byte 1 */
76 {
77 sblive_miStateSysCommon2}, /* 0xF1 , 0xF3 */
78 {
79 sblive_miStateSysCommon2Key}, /* 0xF1 , 0xF3, Byte 1 */
80 {
81 sblive_miStateSysCommon3}, /* 0xF2 */
82 {
83 sblive_miStateSysCommon3Key}, /* 0xF2 , Byte 1 */
84 {
85 sblive_miStateSysCommon3Vel}, /* 0xF2 , Byte 2 */
86 {
87 sblive_miStateSysExNorm}, /* 0xF0, 0xF7, Normal mode */
88 {
89 sblive_miStateSysReal} /* 0xF4 - 0xF6 ,0xF8 - 0xFF */
90};
91
92
93/* Installs the IRQ handler for the MPU in port */
94
95/* and initialize parameters */
96
97int emu10k1_mpuin_open(struct emu10k1_card *card, struct midi_openinfo *openinfo)
98{
99 struct emu10k1_mpuin *card_mpuin = card->mpuin;
100
101 DPF(2, "emu10k1_mpuin_open\n");
102
103 if (!(card_mpuin->status & FLAGS_AVAILABLE))
104 return -1;
105
106 /* Copy open info and mark channel as in use */
107 card_mpuin->openinfo = *openinfo;
108 card_mpuin->status &= ~FLAGS_AVAILABLE; /* clear */
109 card_mpuin->status |= FLAGS_READY; /* set */
110 card_mpuin->status &= ~FLAGS_MIDM_STARTED; /* clear */
111 card_mpuin->firstmidiq = NULL;
112 card_mpuin->lastmidiq = NULL;
113 card_mpuin->qhead = 0;
114 card_mpuin->qtail = 0;
115
116 sblive_miStateInit(card_mpuin);
117
118 emu10k1_mpu_reset(card);
119 emu10k1_mpu_acquire(card);
120
121 return 0;
122}
123
124int emu10k1_mpuin_close(struct emu10k1_card *card)
125{
126 struct emu10k1_mpuin *card_mpuin = card->mpuin;
127
128 DPF(2, "emu10k1_mpuin_close()\n");
129
130 /* Check if there are pending input SysEx buffers */
131 if (card_mpuin->firstmidiq != NULL) {
132 ERROR();
133 return -1;
134 }
135
136 /* Disable RX interrupt */
137 emu10k1_irq_disable(card, card->is_audigy ? A_INTE_MIDIRXENABLE : INTE_MIDIRXENABLE);
138
139 emu10k1_mpu_release(card);
140
141 card_mpuin->status |= FLAGS_AVAILABLE; /* set */
142 card_mpuin->status &= ~FLAGS_MIDM_STARTED; /* clear */
143
144 return 0;
145}
146
147/* Adds MIDI buffer to local queue list */
148
149int emu10k1_mpuin_add_buffer(struct emu10k1_mpuin *card_mpuin, struct midi_hdr *midihdr)
150{
151 struct midi_queue *midiq;
152 unsigned long flags;
153
154 DPF(2, "emu10k1_mpuin_add_buffer()\n");
155
156 /* Update MIDI buffer flags */
157 midihdr->flags |= MIDIBUF_INQUEUE; /* set */
158 midihdr->flags &= ~MIDIBUF_DONE; /* clear */
159
160 if ((midiq = kmalloc(sizeof(struct midi_queue), GFP_ATOMIC)) == NULL) {
161 /* Message lost */
162 return -1;
163 }
164
165 midiq->next = NULL;
166 midiq->qtype = 1;
167 midiq->length = midihdr->bufferlength;
168 midiq->sizeLeft = midihdr->bufferlength;
169 midiq->midibyte = midihdr->data;
170 midiq->refdata = (unsigned long) midihdr;
171
172 spin_lock_irqsave(&card_mpuin->lock, flags);
173
174 if (card_mpuin->firstmidiq == NULL) {
175 card_mpuin->firstmidiq = midiq;
176 card_mpuin->lastmidiq = midiq;
177 } else {
178 (card_mpuin->lastmidiq)->next = midiq;
179 card_mpuin->lastmidiq = midiq;
180 }
181
182 spin_unlock_irqrestore(&card_mpuin->lock, flags);
183
184 return 0;
185}
186
187/* First set the Time Stamp if MIDI IN has not started. */
188
189/* Then enable RX Irq. */
190
191int emu10k1_mpuin_start(struct emu10k1_card *card)
192{
193 struct emu10k1_mpuin *card_mpuin = card->mpuin;
194 u8 dummy;
195
196 DPF(2, "emu10k1_mpuin_start()\n");
197
198 /* Set timestamp if not set */
199 if (card_mpuin->status & FLAGS_MIDM_STARTED) {
200 DPF(2, "Time Stamp not changed\n");
201 } else {
202 while (!emu10k1_mpu_read_data(card, &dummy));
203
204 card_mpuin->status |= FLAGS_MIDM_STARTED; /* set */
205
206 /* Set new time stamp */
207 card_mpuin->timestart = (jiffies * 1000) / HZ;
208 DPD(2, "New Time Stamp = %d\n", card_mpuin->timestart);
209
210 card_mpuin->qhead = 0;
211 card_mpuin->qtail = 0;
212
213 emu10k1_irq_enable(card, card->is_audigy ? A_INTE_MIDIRXENABLE : INTE_MIDIRXENABLE);
214 }
215
216 return 0;
217}
218
219/* Disable the RX Irq. If a partial recorded buffer */
220
221/* exist, send it up to IMIDI level. */
222
223int emu10k1_mpuin_stop(struct emu10k1_card *card)
224{
225 struct emu10k1_mpuin *card_mpuin = card->mpuin;
226 struct midi_queue *midiq;
227 unsigned long flags;
228
229 DPF(2, "emu10k1_mpuin_stop()\n");
230
231 emu10k1_irq_disable(card, card->is_audigy ? A_INTE_MIDIRXENABLE : INTE_MIDIRXENABLE);
232
233 card_mpuin->status &= ~FLAGS_MIDM_STARTED; /* clear */
234
235 if (card_mpuin->firstmidiq) {
236 spin_lock_irqsave(&card_mpuin->lock, flags);
237
238 midiq = card_mpuin->firstmidiq;
239 if (midiq != NULL) {
240 if (midiq->sizeLeft == midiq->length)
241 midiq = NULL;
242 else {
243 card_mpuin->firstmidiq = midiq->next;
244 if (card_mpuin->firstmidiq == NULL)
245 card_mpuin->lastmidiq = NULL;
246 }
247 }
248
249 spin_unlock_irqrestore(&card_mpuin->lock, flags);
250
251 if (midiq) {
252 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INLONGERROR, (unsigned long) midiq, 0);
253 kfree(midiq);
254 }
255 }
256
257 return 0;
258}
259
260/* Disable the RX Irq. If any buffer */
261
262/* exist, send it up to IMIDI level. */
263int emu10k1_mpuin_reset(struct emu10k1_card *card)
264{
265 struct emu10k1_mpuin *card_mpuin = card->mpuin;
266 struct midi_queue *midiq;
267
268 DPF(2, "emu10k1_mpuin_reset()\n");
269
270 emu10k1_irq_disable(card, card->is_audigy ? A_INTE_MIDIRXENABLE : INTE_MIDIRXENABLE);
271
272 while (card_mpuin->firstmidiq) {
273 midiq = card_mpuin->firstmidiq;
274 card_mpuin->firstmidiq = midiq->next;
275
276 if (midiq->sizeLeft == midiq->length)
277 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INLONGDATA, (unsigned long) midiq, 0);
278 else
279 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INLONGERROR, (unsigned long) midiq, 0);
280
281 kfree(midiq);
282 }
283
284 card_mpuin->lastmidiq = NULL;
285 card_mpuin->status &= ~FLAGS_MIDM_STARTED;
286
287 return 0;
288}
289
290/* Passes the message with the data back to the client */
291
292/* via IRQ & DPC callbacks to Ring 3 */
293static int emu10k1_mpuin_callback(struct emu10k1_mpuin *card_mpuin, u32 msg, unsigned long data, u32 bytesvalid)
294{
295 unsigned long timein;
296 struct midi_queue *midiq;
297 unsigned long callback_msg[3];
298 struct midi_hdr *midihdr;
299
300 /* Called during ISR. The data & code touched are:
301 * 1. card_mpuin
302 * 2. The function to be called
303 */
304
305 timein = card_mpuin->timein;
306 if (card_mpuin->timestart <= timein)
307 callback_msg[0] = timein - card_mpuin->timestart;
308 else
309 callback_msg[0] = (~0x0L - card_mpuin->timestart) + timein;
310
311 if (msg == ICARDMIDI_INDATA || msg == ICARDMIDI_INDATAERROR) {
312 callback_msg[1] = data;
313 callback_msg[2] = bytesvalid;
314 DPD(2, "emu10k1_mpuin_callback: midimsg = %#lx\n", data);
315 } else {
316 midiq = (struct midi_queue *) data;
317 midihdr = (struct midi_hdr *) midiq->refdata;
318
319 callback_msg[1] = midiq->length - midiq->sizeLeft;
320 callback_msg[2] = midiq->refdata;
321 midihdr->flags &= ~MIDIBUF_INQUEUE;
322 midihdr->flags |= MIDIBUF_DONE;
323
324 midihdr->bytesrecorded = midiq->length - midiq->sizeLeft;
325 }
326
327 /* Notify client that Sysex buffer has been sent */
328 emu10k1_midi_callback(msg, card_mpuin->openinfo.refdata, callback_msg);
329
330 return 0;
331}
332
333void emu10k1_mpuin_bh(unsigned long refdata)
334{
335 u8 data;
336 unsigned idx;
337 struct emu10k1_mpuin *card_mpuin = (struct emu10k1_mpuin *) refdata;
338 unsigned long flags;
339
340 while (card_mpuin->qhead != card_mpuin->qtail) {
341 spin_lock_irqsave(&card_mpuin->lock, flags);
342 idx = card_mpuin->qhead;
343 data = card_mpuin->midiq[idx].data;
344 card_mpuin->timein = card_mpuin->midiq[idx].timein;
345 idx = (idx + 1) % MIDIIN_MAX_BUFFER_SIZE;
346 card_mpuin->qhead = idx;
347 spin_unlock_irqrestore(&card_mpuin->lock, flags);
348
349 sblive_miStateEntry(card_mpuin, data);
350 }
351
352 return;
353}
354
355/* IRQ callback handler routine for the MPU in port */
356
357int emu10k1_mpuin_irqhandler(struct emu10k1_card *card)
358{
359 unsigned idx;
360 unsigned count;
361 u8 MPUIvalue;
362 struct emu10k1_mpuin *card_mpuin = card->mpuin;
363
364 /* IRQ service routine. The data and code touched are:
365 * 1. card_mpuin
366 */
367
368 count = 0;
369 idx = card_mpuin->qtail;
370
371 while (1) {
372 if (emu10k1_mpu_read_data(card, &MPUIvalue) < 0) {
373 break;
374 } else {
375 ++count;
376 card_mpuin->midiq[idx].data = MPUIvalue;
377 card_mpuin->midiq[idx].timein = (jiffies * 1000) / HZ;
378 idx = (idx + 1) % MIDIIN_MAX_BUFFER_SIZE;
379 }
380 }
381
382 if (count) {
383 card_mpuin->qtail = idx;
384
385 tasklet_hi_schedule(&card_mpuin->tasklet);
386 }
387
388 return 0;
389}
390
391/*****************************************************************************/
392
393/* Supporting functions for Midi-In Interpretation State Machine */
394
395/*****************************************************************************/
396
397/* FIXME: This should be a macro */
398static int sblive_miStateInit(struct emu10k1_mpuin *card_mpuin)
399{
400 card_mpuin->status = 0; /* For MIDI running status */
401 card_mpuin->fstatus = 0; /* For 0xFn status only */
402 card_mpuin->curstate = STIN_PARSE;
403 card_mpuin->laststate = STIN_PARSE;
404 card_mpuin->data = 0;
405 card_mpuin->timestart = 0;
406 card_mpuin->timein = 0;
407
408 return 0;
409}
410
411/* FIXME: This should be a macro */
412static int sblive_miStateEntry(struct emu10k1_mpuin *card_mpuin, u8 data)
413{
414 return midistatefn[card_mpuin->curstate].Fn(card_mpuin, data);
415}
416
417static int sblive_miStateParse(struct emu10k1_mpuin *card_mpuin, u8 data)
418{
419 switch (data & 0xf0) {
420 case 0x80:
421 case 0x90:
422 case 0xA0:
423 case 0xB0:
424 case 0xE0:
425 card_mpuin->curstate = STIN_3BYTE;
426 break;
427
428 case 0xC0:
429 case 0xD0:
430 card_mpuin->curstate = STIN_2BYTE;
431 break;
432
433 case 0xF0:
434 /* System messages do not affect the previous running status! */
435 switch (data & 0x0f) {
436 case 0x0:
437 card_mpuin->laststate = card_mpuin->curstate;
438 card_mpuin->curstate = STIN_SYS_EX_NORM;
439
440 if (card_mpuin->firstmidiq) {
441 struct midi_queue *midiq;
442
443 midiq = card_mpuin->firstmidiq;
444 *midiq->midibyte = data;
445 --midiq->sizeLeft;
446 ++midiq->midibyte;
447 }
448
449 return CTSTATUS_NEXT_BYTE;
450
451 case 0x7:
452 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATAERROR, 0xf7, 0);
453 return -1;
454
455 case 0x2:
456 card_mpuin->laststate = card_mpuin->curstate;
457 card_mpuin->curstate = STIN_SYS_COMMON_3;
458 break;
459
460 case 0x1:
461 case 0x3:
462 card_mpuin->laststate = card_mpuin->curstate;
463 card_mpuin->curstate = STIN_SYS_COMMON_2;
464 break;
465
466 default:
467 /* includes 0xF4 - 0xF6, 0xF8 - 0xFF */
468 return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data);
469 }
470
471 break;
472
473 default:
474 DPF(2, "BUG: default case hit\n");
475 return -1;
476 }
477
478 return midistatefn[card_mpuin->curstate].Fn(card_mpuin, data);
479}
480
481static int sblive_miState3Byte(struct emu10k1_mpuin *card_mpuin, u8 data)
482{
483 u8 temp = data & 0xf0;
484
485 if (temp < 0x80) {
486 return midistatefn[STIN_3BYTE_KEY].Fn(card_mpuin, data);
487 } else if (temp <= 0xe0 && temp != 0xc0 && temp != 0xd0) {
488 card_mpuin->status = data;
489 card_mpuin->curstate = STIN_3BYTE_KEY;
490
491 return CTSTATUS_NEXT_BYTE;
492 }
493
494 return midistatefn[STIN_PARSE].Fn(card_mpuin, data);
495}
496
497static int sblive_miState3ByteKey(struct emu10k1_mpuin *card_mpuin, u8 data)
498/* byte 1 */
499{
500 unsigned long tmp;
501
502 if (data > 0x7f) {
503 /* Real-time messages check */
504 if (data > 0xf7)
505 return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data);
506
507 /* Invalid data! */
508 DPF(2, "Invalid data!\n");
509
510 card_mpuin->curstate = STIN_PARSE;
511 tmp = ((unsigned long) data) << 8;
512 tmp |= (unsigned long) card_mpuin->status;
513
514 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATAERROR, tmp, 0);
515
516 return -1;
517 }
518
519 card_mpuin->data = data;
520 card_mpuin->curstate = STIN_3BYTE_VEL;
521
522 return CTSTATUS_NEXT_BYTE;
523}
524
525static int sblive_miState3ByteVel(struct emu10k1_mpuin *card_mpuin, u8 data)
526/* byte 2 */
527{
528 unsigned long tmp;
529
530 if (data > 0x7f) {
531 /* Real-time messages check */
532 if (data > 0xf7)
533 return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data);
534
535 /* Invalid data! */
536 DPF(2, "Invalid data!\n");
537
538 card_mpuin->curstate = STIN_PARSE;
539 tmp = ((unsigned long) data) << 8;
540 tmp |= card_mpuin->data;
541 tmp = tmp << 8;
542 tmp |= (unsigned long) card_mpuin->status;
543
544 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATAERROR, tmp, 0);
545
546 return -1;
547 }
548
549 card_mpuin->curstate = STIN_3BYTE;
550 tmp = (unsigned long) data;
551 tmp = tmp << 8;
552 tmp |= (unsigned long) card_mpuin->data;
553 tmp = tmp << 8;
554 tmp |= (unsigned long) card_mpuin->status;
555
556 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATA, tmp, 3);
557
558 return 0;
559}
560
561static int sblive_miState2Byte(struct emu10k1_mpuin *card_mpuin, u8 data)
562{
563 u8 temp = data & 0xf0;
564
565 if ((temp == 0xc0) || (temp == 0xd0)) {
566 card_mpuin->status = data;
567 card_mpuin->curstate = STIN_2BYTE_KEY;
568
569 return CTSTATUS_NEXT_BYTE;
570 }
571
572 if (temp < 0x80)
573 return midistatefn[STIN_2BYTE_KEY].Fn(card_mpuin, data);
574
575 return midistatefn[STIN_PARSE].Fn(card_mpuin, data);
576}
577
578static int sblive_miState2ByteKey(struct emu10k1_mpuin *card_mpuin, u8 data)
579/* byte 1 */
580{
581 unsigned long tmp;
582
583 if (data > 0x7f) {
584 /* Real-time messages check */
585 if (data > 0xf7)
586 return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data);
587
588 /* Invalid data! */
589 DPF(2, "Invalid data!\n");
590
591 card_mpuin->curstate = STIN_PARSE;
592 tmp = (unsigned long) data;
593 tmp = tmp << 8;
594 tmp |= (unsigned long) card_mpuin->status;
595
596 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATAERROR, tmp, 0);
597
598 return -1;
599 }
600
601 card_mpuin->curstate = STIN_2BYTE;
602 tmp = (unsigned long) data;
603 tmp = tmp << 8;
604 tmp |= (unsigned long) card_mpuin->status;
605
606 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATA, tmp, 2);
607
608 return 0;
609}
610
611static int sblive_miStateSysCommon2(struct emu10k1_mpuin *card_mpuin, u8 data)
612{
613 card_mpuin->fstatus = data;
614 card_mpuin->curstate = STIN_SYS_COMMON_2_KEY;
615
616 return CTSTATUS_NEXT_BYTE;
617}
618
619static int sblive_miStateSysCommon2Key(struct emu10k1_mpuin *card_mpuin, u8 data)
620/* byte 1 */
621{
622 unsigned long tmp;
623
624 if (data > 0x7f) {
625 /* Real-time messages check */
626 if (data > 0xf7)
627 return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data);
628
629 /* Invalid data! */
630 DPF(2, "Invalid data!\n");
631
632 card_mpuin->curstate = card_mpuin->laststate;
633 tmp = (unsigned long) data;
634 tmp = tmp << 8;
635 tmp |= (unsigned long) card_mpuin->fstatus;
636
637 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATAERROR, tmp, 0);
638
639 return -1;
640 }
641
642 card_mpuin->curstate = card_mpuin->laststate;
643 tmp = (unsigned long) data;
644 tmp = tmp << 8;
645 tmp |= (unsigned long) card_mpuin->fstatus;
646
647 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATA, tmp, 2);
648
649 return 0;
650}
651
652static int sblive_miStateSysCommon3(struct emu10k1_mpuin *card_mpuin, u8 data)
653{
654 card_mpuin->fstatus = data;
655 card_mpuin->curstate = STIN_SYS_COMMON_3_KEY;
656
657 return CTSTATUS_NEXT_BYTE;
658}
659
660static int sblive_miStateSysCommon3Key(struct emu10k1_mpuin *card_mpuin, u8 data)
661/* byte 1 */
662{
663 unsigned long tmp;
664
665 if (data > 0x7f) {
666 /* Real-time messages check */
667 if (data > 0xf7)
668 return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data);
669
670 /* Invalid data! */
671 DPF(2, "Invalid data!\n");
672
673 card_mpuin->curstate = card_mpuin->laststate;
674 tmp = (unsigned long) data;
675 tmp = tmp << 8;
676 tmp |= (unsigned long) card_mpuin->fstatus;
677
678 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATAERROR, tmp, 0);
679
680 return -1;
681 }
682
683 card_mpuin->data = data;
684 card_mpuin->curstate = STIN_SYS_COMMON_3_VEL;
685
686 return CTSTATUS_NEXT_BYTE;
687}
688
689static int sblive_miStateSysCommon3Vel(struct emu10k1_mpuin *card_mpuin, u8 data)
690/* byte 2 */
691{
692 unsigned long tmp;
693
694 if (data > 0x7f) {
695 /* Real-time messages check */
696 if (data > 0xf7)
697 return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data);
698
699 /* Invalid data! */
700 DPF(2, "Invalid data!\n");
701
702 card_mpuin->curstate = card_mpuin->laststate;
703 tmp = (unsigned long) data;
704 tmp = tmp << 8;
705 tmp |= (unsigned long) card_mpuin->data;
706 tmp = tmp << 8;
707 tmp |= (unsigned long) card_mpuin->fstatus;
708
709 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATAERROR, tmp, 0);
710
711 return -1;
712 }
713
714 card_mpuin->curstate = card_mpuin->laststate;
715 tmp = (unsigned long) data;
716 tmp = tmp << 8;
717 tmp |= (unsigned long) card_mpuin->data;
718 tmp = tmp << 8;
719 tmp |= (unsigned long) card_mpuin->fstatus;
720
721 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATA, tmp, 3);
722
723 return 0;
724}
725
726static int sblive_miStateSysExNorm(struct emu10k1_mpuin *card_mpuin, u8 data)
727{
728 unsigned long flags;
729
730 if ((data > 0x7f) && (data != 0xf7)) {
731 /* Real-time messages check */
732 if (data > 0xf7)
733 return midistatefn[STIN_SYS_REAL].Fn(card_mpuin, data);
734
735 /* Invalid Data! */
736 DPF(2, "Invalid data!\n");
737
738 card_mpuin->curstate = card_mpuin->laststate;
739
740 if (card_mpuin->firstmidiq) {
741 struct midi_queue *midiq;
742
743 midiq = card_mpuin->firstmidiq;
744 *midiq->midibyte = data;
745 --midiq->sizeLeft;
746 ++midiq->midibyte;
747
748 spin_lock_irqsave(&card_mpuin->lock, flags);
749
750 card_mpuin->firstmidiq = midiq->next;
751 if (card_mpuin->firstmidiq == NULL)
752 card_mpuin->lastmidiq = NULL;
753
754 spin_unlock_irqrestore(&card_mpuin->lock, flags);
755
756 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INLONGERROR, (unsigned long) midiq, 0);
757
758 kfree(midiq);
759 }
760
761 return -1;
762 }
763
764 if (card_mpuin->firstmidiq) {
765 struct midi_queue *midiq;
766
767 midiq = card_mpuin->firstmidiq;
768 *midiq->midibyte = data;
769 --midiq->sizeLeft;
770 ++midiq->midibyte;
771 }
772
773 if (data == 0xf7) {
774 /* End of Sysex buffer */
775 /* Send down the buffer */
776
777 card_mpuin->curstate = card_mpuin->laststate;
778
779 if (card_mpuin->firstmidiq) {
780 struct midi_queue *midiq;
781
782 midiq = card_mpuin->firstmidiq;
783
784 spin_lock_irqsave(&card_mpuin->lock, flags);
785
786 card_mpuin->firstmidiq = midiq->next;
787 if (card_mpuin->firstmidiq == NULL)
788 card_mpuin->lastmidiq = NULL;
789
790 spin_unlock_irqrestore(&card_mpuin->lock, flags);
791
792 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INLONGDATA, (unsigned long) midiq, 0);
793
794 kfree(midiq);
795 }
796
797 return 0;
798 }
799
800 if (card_mpuin->firstmidiq) {
801 struct midi_queue *midiq;
802
803 midiq = card_mpuin->firstmidiq;
804
805 if (midiq->sizeLeft == 0) {
806 /* Special case */
807
808 spin_lock_irqsave(&card_mpuin->lock, flags);
809
810 card_mpuin->firstmidiq = midiq->next;
811 if (card_mpuin->firstmidiq == NULL)
812 card_mpuin->lastmidiq = NULL;
813
814 spin_unlock_irqrestore(&card_mpuin->lock, flags);
815
816 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INLONGDATA, (unsigned long) midiq, 0);
817
818 kfree(midiq);
819
820 return CTSTATUS_NEXT_BYTE;
821 }
822 }
823
824 return CTSTATUS_NEXT_BYTE;
825}
826
827static int sblive_miStateSysReal(struct emu10k1_mpuin *card_mpuin, u8 data)
828{
829 emu10k1_mpuin_callback(card_mpuin, ICARDMIDI_INDATA, data, 1);
830
831 return CTSTATUS_NEXT_BYTE;
832}
diff --git a/sound/oss/emu10k1/cardmi.h b/sound/oss/emu10k1/cardmi.h
deleted file mode 100644
index d12c24116307..000000000000
--- a/sound/oss/emu10k1/cardmi.h
+++ /dev/null
@@ -1,97 +0,0 @@
1/*
2 **********************************************************************
3 * sblive_mi.h
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 * November 2, 1999 Alan Cox cleaned up
12 *
13 **********************************************************************
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this program; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
28 * USA.
29 *
30 **********************************************************************
31 */
32
33#ifndef _CARDMI_H
34#define _CARDMI_H
35
36#include "icardmid.h"
37#include <linux/interrupt.h>
38
39typedef enum
40{
41 STIN_PARSE = 0,
42 STIN_3BYTE, /* 0x80, 0x90, 0xA0, 0xB0, 0xE0 */
43 STIN_3BYTE_KEY, /* Byte 1 */
44 STIN_3BYTE_VEL, /* Byte 1 */
45 STIN_2BYTE, /* 0xC0, 0xD0 */
46 STIN_2BYTE_KEY, /* Byte 1 */
47 STIN_SYS_COMMON_2, /* 0xF1, 0xF3 */
48 STIN_SYS_COMMON_2_KEY,
49 STIN_SYS_COMMON_3, /* 0xF2 */
50 STIN_SYS_COMMON_3_KEY,
51 STIN_SYS_COMMON_3_VEL,
52 STIN_SYS_EX_NORM, /* 0xF0, Normal mode */
53 STIN_SYS_REAL
54} midi_in_state;
55
56
57/* flags for card MIDI in object */
58#define FLAGS_MIDM_STARTED 0x00001000 // Data has started to come in after Midm Start
59#define MIDIIN_MAX_BUFFER_SIZE 200 // Definition for struct emu10k1_mpuin
60
61struct midi_data
62{
63 u8 data;
64 u32 timein;
65};
66
67struct emu10k1_mpuin
68{
69 spinlock_t lock;
70 struct midi_queue *firstmidiq;
71 struct midi_queue *lastmidiq;
72 unsigned qhead, qtail;
73 struct midi_data midiq[MIDIIN_MAX_BUFFER_SIZE];
74 struct tasklet_struct tasklet;
75 struct midi_openinfo openinfo;
76
77 /* For MIDI state machine */
78 u8 status; /* For MIDI running status */
79 u8 fstatus; /* For 0xFn status only */
80 midi_in_state curstate;
81 midi_in_state laststate;
82 u32 timestart;
83 u32 timein;
84 u8 data;
85};
86
87int emu10k1_mpuin_open(struct emu10k1_card *, struct midi_openinfo *);
88int emu10k1_mpuin_close(struct emu10k1_card *);
89int emu10k1_mpuin_add_buffer(struct emu10k1_mpuin *, struct midi_hdr *);
90int emu10k1_mpuin_start(struct emu10k1_card *);
91int emu10k1_mpuin_stop(struct emu10k1_card *);
92int emu10k1_mpuin_reset(struct emu10k1_card *);
93
94int emu10k1_mpuin_irqhandler(struct emu10k1_card *);
95void emu10k1_mpuin_bh(unsigned long);
96
97#endif /* _CARDMI_H */
diff --git a/sound/oss/emu10k1/cardmo.c b/sound/oss/emu10k1/cardmo.c
deleted file mode 100644
index a8cc75db3e45..000000000000
--- a/sound/oss/emu10k1/cardmo.c
+++ /dev/null
@@ -1,229 +0,0 @@
1/*
2 **********************************************************************
3 * cardmo.c - MIDI UART output HAL for emu10k1 driver
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 * November 2, 1999 Alan Cox cleaned up
12 *
13 **********************************************************************
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this program; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
28 * USA.
29 *
30 **********************************************************************
31 */
32
33#include <linux/slab.h>
34
35#include "hwaccess.h"
36#include "8010.h"
37#include "cardmo.h"
38#include "irqmgr.h"
39
40/* Installs the IRQ handler for the MPU out port *
41 * and initialize parameters */
42
43int emu10k1_mpuout_open(struct emu10k1_card *card, struct midi_openinfo *openinfo)
44{
45 struct emu10k1_mpuout *card_mpuout = card->mpuout;
46
47 DPF(2, "emu10k1_mpuout_open()\n");
48
49 if (!(card_mpuout->status & FLAGS_AVAILABLE))
50 return -1;
51
52 /* Copy open info and mark channel as in use */
53 card_mpuout->intr = 0;
54 card_mpuout->openinfo = *openinfo;
55 card_mpuout->status &= ~FLAGS_AVAILABLE;
56 card_mpuout->laststatus = 0x80;
57 card_mpuout->firstmidiq = NULL;
58 card_mpuout->lastmidiq = NULL;
59
60 emu10k1_mpu_reset(card);
61 emu10k1_mpu_acquire(card);
62
63 return 0;
64}
65
66int emu10k1_mpuout_close(struct emu10k1_card *card)
67{
68 struct emu10k1_mpuout *card_mpuout = card->mpuout;
69 struct midi_queue *midiq;
70 struct midi_hdr *midihdr;
71 unsigned long flags;
72
73 DPF(2, "emu10k1_mpuout_close()\n");
74
75 emu10k1_irq_disable(card, card->is_audigy ? A_INTE_MIDITXENABLE : INTE_MIDITXENABLE);
76
77 spin_lock_irqsave(&card_mpuout->lock, flags);
78
79 while (card_mpuout->firstmidiq != NULL) {
80 midiq = card_mpuout->firstmidiq;
81 midihdr = (struct midi_hdr *) midiq->refdata;
82
83 card_mpuout->firstmidiq = midiq->next;
84
85 kfree(midihdr->data);
86 kfree(midihdr);
87 kfree(midiq);
88 }
89
90 card_mpuout->lastmidiq = NULL;
91
92 emu10k1_mpu_release(card);
93
94 card_mpuout->status |= FLAGS_AVAILABLE;
95
96 spin_unlock_irqrestore(&card_mpuout->lock, flags);
97
98 return 0;
99}
100
101/* If there isn't enough buffer space, reject Midi Buffer. *
102* Otherwise, disable TX, create object to hold Midi *
103* uffer, update buffer flags and other parameters *
104* before enabling TX again. */
105
106int emu10k1_mpuout_add_buffer(struct emu10k1_card *card, struct midi_hdr *midihdr)
107{
108 struct emu10k1_mpuout *card_mpuout = card->mpuout;
109 struct midi_queue *midiq;
110 unsigned long flags;
111
112 DPF(2, "emu10k1_mpuout_add_buffer()\n");
113
114 if (card_mpuout->state == CARDMIDIOUT_STATE_SUSPEND)
115 return 0;
116
117 midihdr->flags |= MIDIBUF_INQUEUE;
118 midihdr->flags &= ~MIDIBUF_DONE;
119
120 if ((midiq = kmalloc(sizeof(struct midi_queue), GFP_KERNEL)) == NULL) {
121 /* Message lost */
122 return -1;
123 }
124
125 midiq->next = NULL;
126 midiq->qtype = 1;
127 midiq->length = midihdr->bufferlength;
128 midiq->sizeLeft = midihdr->bufferlength;
129 midiq->midibyte = midihdr->data;
130
131 midiq->refdata = (unsigned long) midihdr;
132
133 spin_lock_irqsave(&card_mpuout->lock, flags);
134
135 if (card_mpuout->firstmidiq == NULL) {
136 card_mpuout->firstmidiq = midiq;
137 card_mpuout->lastmidiq = midiq;
138 } else {
139 (card_mpuout->lastmidiq)->next = midiq;
140 card_mpuout->lastmidiq = midiq;
141 }
142
143 card_mpuout->intr = 0;
144
145 emu10k1_irq_enable(card, card->is_audigy ? A_INTE_MIDITXENABLE : INTE_MIDITXENABLE);
146
147 spin_unlock_irqrestore(&card_mpuout->lock, flags);
148
149 return 0;
150}
151
152void emu10k1_mpuout_bh(unsigned long refdata)
153{
154 struct emu10k1_card *card = (struct emu10k1_card *) refdata;
155 struct emu10k1_mpuout *card_mpuout = card->mpuout;
156 int cByteSent = 0;
157 struct midi_queue *midiq;
158 struct midi_queue *doneq = NULL;
159 unsigned long flags;
160
161 spin_lock_irqsave(&card_mpuout->lock, flags);
162
163 while (card_mpuout->firstmidiq != NULL) {
164 midiq = card_mpuout->firstmidiq;
165
166 while (cByteSent < 4 && midiq->sizeLeft) {
167 if (emu10k1_mpu_write_data(card, *midiq->midibyte) < 0) {
168 DPF(2, "emu10k1_mpuoutDpcCallback error!!\n");
169 } else {
170 ++cByteSent;
171 --midiq->sizeLeft;
172 ++midiq->midibyte;
173 }
174 }
175
176 if (midiq->sizeLeft == 0) {
177 if (doneq == NULL)
178 doneq = midiq;
179 card_mpuout->firstmidiq = midiq->next;
180 } else
181 break;
182 }
183
184 if (card_mpuout->firstmidiq == NULL)
185 card_mpuout->lastmidiq = NULL;
186
187 if (doneq != NULL) {
188 while (doneq != card_mpuout->firstmidiq) {
189 unsigned long callback_msg[3];
190
191 midiq = doneq;
192 doneq = midiq->next;
193
194 if (midiq->qtype) {
195 callback_msg[0] = 0;
196 callback_msg[1] = midiq->length;
197 callback_msg[2] = midiq->refdata;
198
199 emu10k1_midi_callback(ICARDMIDI_OUTLONGDATA, card_mpuout->openinfo.refdata, callback_msg);
200 } else if (((u8) midiq->refdata) < 0xF0 && ((u8) midiq->refdata) > 0x7F)
201 card_mpuout->laststatus = (u8) midiq->refdata;
202
203 kfree(midiq);
204 }
205 }
206
207 if ((card_mpuout->firstmidiq != NULL) || cByteSent) {
208 card_mpuout->intr = 0;
209 emu10k1_irq_enable(card, card->is_audigy ? A_INTE_MIDITXENABLE : INTE_MIDITXENABLE);
210 }
211
212 spin_unlock_irqrestore(&card_mpuout->lock, flags);
213
214 return;
215}
216
217int emu10k1_mpuout_irqhandler(struct emu10k1_card *card)
218{
219 struct emu10k1_mpuout *card_mpuout = card->mpuout;
220
221 DPF(4, "emu10k1_mpuout_irqhandler\n");
222
223 card_mpuout->intr = 1;
224 emu10k1_irq_disable(card, card->is_audigy ? A_INTE_MIDITXENABLE : INTE_MIDITXENABLE);
225
226 tasklet_hi_schedule(&card_mpuout->tasklet);
227
228 return 0;
229}
diff --git a/sound/oss/emu10k1/cardmo.h b/sound/oss/emu10k1/cardmo.h
deleted file mode 100644
index 7026eb3a85af..000000000000
--- a/sound/oss/emu10k1/cardmo.h
+++ /dev/null
@@ -1,62 +0,0 @@
1/*
2 **********************************************************************
3 * cardmo.h
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 * November 2, 1999 Alan Cox cleaned up
12 *
13 **********************************************************************
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this program; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
28 * USA.
29 *
30 **********************************************************************
31 */
32
33#ifndef _CARDMO_H
34#define _CARDMO_H
35
36#include "icardmid.h"
37#include <linux/interrupt.h>
38
39#define CARDMIDIOUT_STATE_DEFAULT 0x00000000
40#define CARDMIDIOUT_STATE_SUSPEND 0x00000001
41
42struct emu10k1_mpuout
43{
44 u32 status;
45 u32 state;
46 volatile int intr;
47 struct midi_queue *firstmidiq;
48 struct midi_queue *lastmidiq;
49 u8 laststatus;
50 struct tasklet_struct tasklet;
51 spinlock_t lock;
52 struct midi_openinfo openinfo;
53};
54
55int emu10k1_mpuout_open(struct emu10k1_card *, struct midi_openinfo *);
56int emu10k1_mpuout_close(struct emu10k1_card *);
57int emu10k1_mpuout_add_buffer(struct emu10k1_card *, struct midi_hdr *);
58
59int emu10k1_mpuout_irqhandler(struct emu10k1_card *);
60void emu10k1_mpuout_bh(unsigned long);
61
62#endif /* _CARDMO_H */
diff --git a/sound/oss/emu10k1/cardwi.c b/sound/oss/emu10k1/cardwi.c
deleted file mode 100644
index 060d1be94d33..000000000000
--- a/sound/oss/emu10k1/cardwi.c
+++ /dev/null
@@ -1,384 +0,0 @@
1/*
2 **********************************************************************
3 * cardwi.c - PCM input HAL for emu10k1 driver
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#include <linux/poll.h>
33#include "hwaccess.h"
34#include "timer.h"
35#include "recmgr.h"
36#include "audio.h"
37#include "cardwi.h"
38
39/**
40 * query_format - returns a valid sound format
41 *
42 * This function will return a valid sound format as close
43 * to the requested one as possible.
44 */
45static void query_format(int recsrc, struct wave_format *wave_fmt)
46{
47
48 switch (recsrc) {
49 case WAVERECORD_AC97:
50
51 if ((wave_fmt->channels != 1) && (wave_fmt->channels != 2))
52 wave_fmt->channels = 2;
53
54 if (wave_fmt->samplingrate >= (0xBB80 + 0xAC44) / 2)
55 wave_fmt->samplingrate = 0xBB80;
56 else if (wave_fmt->samplingrate >= (0xAC44 + 0x7D00) / 2)
57 wave_fmt->samplingrate = 0xAC44;
58 else if (wave_fmt->samplingrate >= (0x7D00 + 0x5DC0) / 2)
59 wave_fmt->samplingrate = 0x7D00;
60 else if (wave_fmt->samplingrate >= (0x5DC0 + 0x5622) / 2)
61 wave_fmt->samplingrate = 0x5DC0;
62 else if (wave_fmt->samplingrate >= (0x5622 + 0x3E80) / 2)
63 wave_fmt->samplingrate = 0x5622;
64 else if (wave_fmt->samplingrate >= (0x3E80 + 0x2B11) / 2)
65 wave_fmt->samplingrate = 0x3E80;
66 else if (wave_fmt->samplingrate >= (0x2B11 + 0x1F40) / 2)
67 wave_fmt->samplingrate = 0x2B11;
68 else
69 wave_fmt->samplingrate = 0x1F40;
70
71 switch (wave_fmt->id) {
72 case AFMT_S16_LE:
73 wave_fmt->bitsperchannel = 16;
74 break;
75 case AFMT_U8:
76 wave_fmt->bitsperchannel = 8;
77 break;
78 default:
79 wave_fmt->id = AFMT_S16_LE;
80 wave_fmt->bitsperchannel = 16;
81 break;
82 }
83
84 break;
85
86 /* these can't be changed from the original values */
87 case WAVERECORD_MIC:
88 case WAVERECORD_FX:
89 break;
90
91 default:
92 BUG();
93 break;
94 }
95
96 wave_fmt->bytesperchannel = wave_fmt->bitsperchannel >> 3;
97 wave_fmt->bytespersample = wave_fmt->channels * wave_fmt->bytesperchannel;
98 wave_fmt->bytespersec = wave_fmt->bytespersample * wave_fmt->samplingrate;
99 wave_fmt->bytespervoicesample = wave_fmt->bytespersample;
100}
101
102static int alloc_buffer(struct emu10k1_card *card, struct wavein_buffer *buffer)
103{
104 buffer->addr = pci_alloc_consistent(card->pci_dev, buffer->size * buffer->cov,
105 &buffer->dma_handle);
106 if (buffer->addr == NULL)
107 return -1;
108
109 return 0;
110}
111
112static void free_buffer(struct emu10k1_card *card, struct wavein_buffer *buffer)
113{
114 if (buffer->addr != NULL)
115 pci_free_consistent(card->pci_dev, buffer->size * buffer->cov,
116 buffer->addr, buffer->dma_handle);
117}
118
119int emu10k1_wavein_open(struct emu10k1_wavedevice *wave_dev)
120{
121 struct emu10k1_card *card = wave_dev->card;
122 struct wiinst *wiinst = wave_dev->wiinst;
123 struct wiinst **wiinst_tmp = NULL;
124 u16 delay;
125 unsigned long flags;
126
127 DPF(2, "emu10k1_wavein_open()\n");
128
129 switch (wiinst->recsrc) {
130 case WAVERECORD_AC97:
131 wiinst_tmp = &card->wavein.ac97;
132 break;
133 case WAVERECORD_MIC:
134 wiinst_tmp = &card->wavein.mic;
135 break;
136 case WAVERECORD_FX:
137 wiinst_tmp = &card->wavein.fx;
138 break;
139 default:
140 BUG();
141 break;
142 }
143
144 spin_lock_irqsave(&card->lock, flags);
145 if (*wiinst_tmp != NULL) {
146 spin_unlock_irqrestore(&card->lock, flags);
147 return -1;
148 }
149
150 *wiinst_tmp = wiinst;
151 spin_unlock_irqrestore(&card->lock, flags);
152
153 /* handle 8 bit recording */
154 if (wiinst->format.bytesperchannel == 1) {
155 if (wiinst->buffer.size > 0x8000) {
156 wiinst->buffer.size = 0x8000;
157 wiinst->buffer.sizeregval = 0x1f;
158 } else
159 wiinst->buffer.sizeregval += 4;
160
161 wiinst->buffer.cov = 2;
162 } else
163 wiinst->buffer.cov = 1;
164
165 if (alloc_buffer(card, &wiinst->buffer) < 0) {
166 ERROR();
167 return -1;
168 }
169
170 emu10k1_set_record_src(card, wiinst);
171
172 emu10k1_reset_record(card, &wiinst->buffer);
173
174 wiinst->buffer.hw_pos = 0;
175 wiinst->buffer.pos = 0;
176 wiinst->buffer.bytestocopy = 0;
177
178 delay = (48000 * wiinst->buffer.fragment_size) / wiinst->format.bytespersec;
179
180 emu10k1_timer_install(card, &wiinst->timer, delay / 2);
181
182 wiinst->state = WAVE_STATE_OPEN;
183
184 return 0;
185}
186
187void emu10k1_wavein_close(struct emu10k1_wavedevice *wave_dev)
188{
189 struct emu10k1_card *card = wave_dev->card;
190 struct wiinst *wiinst = wave_dev->wiinst;
191 unsigned long flags;
192
193 DPF(2, "emu10k1_wavein_close()\n");
194
195 emu10k1_wavein_stop(wave_dev);
196
197 emu10k1_timer_uninstall(card, &wiinst->timer);
198
199 free_buffer(card, &wiinst->buffer);
200
201 spin_lock_irqsave(&card->lock, flags);
202 switch (wave_dev->wiinst->recsrc) {
203 case WAVERECORD_AC97:
204 card->wavein.ac97 = NULL;
205 break;
206 case WAVERECORD_MIC:
207 card->wavein.mic = NULL;
208 break;
209 case WAVERECORD_FX:
210 card->wavein.fx = NULL;
211 break;
212 default:
213 BUG();
214 break;
215 }
216 spin_unlock_irqrestore(&card->lock, flags);
217
218 wiinst->state = WAVE_STATE_CLOSED;
219}
220
221void emu10k1_wavein_start(struct emu10k1_wavedevice *wave_dev)
222{
223 struct emu10k1_card *card = wave_dev->card;
224 struct wiinst *wiinst = wave_dev->wiinst;
225
226 DPF(2, "emu10k1_wavein_start()\n");
227
228 emu10k1_start_record(card, &wiinst->buffer);
229 emu10k1_timer_enable(wave_dev->card, &wiinst->timer);
230
231 wiinst->state |= WAVE_STATE_STARTED;
232}
233
234void emu10k1_wavein_stop(struct emu10k1_wavedevice *wave_dev)
235{
236 struct emu10k1_card *card = wave_dev->card;
237 struct wiinst *wiinst = wave_dev->wiinst;
238
239 DPF(2, "emu10k1_wavein_stop()\n");
240
241 if (!(wiinst->state & WAVE_STATE_STARTED))
242 return;
243
244 emu10k1_timer_disable(card, &wiinst->timer);
245 emu10k1_stop_record(card, &wiinst->buffer);
246
247 wiinst->state &= ~WAVE_STATE_STARTED;
248}
249
250int emu10k1_wavein_setformat(struct emu10k1_wavedevice *wave_dev, struct wave_format *format)
251{
252 struct emu10k1_card *card = wave_dev->card;
253 struct wiinst *wiinst = wave_dev->wiinst;
254 u16 delay;
255
256 DPF(2, "emu10k1_wavein_setformat()\n");
257
258 if (wiinst->state & WAVE_STATE_STARTED)
259 return -1;
260
261 query_format(wiinst->recsrc, format);
262
263 if ((wiinst->format.samplingrate != format->samplingrate)
264 || (wiinst->format.bitsperchannel != format->bitsperchannel)
265 || (wiinst->format.channels != format->channels)) {
266
267 wiinst->format = *format;
268
269 if (wiinst->state == WAVE_STATE_CLOSED)
270 return 0;
271
272 wiinst->buffer.size *= wiinst->buffer.cov;
273
274 if (wiinst->format.bytesperchannel == 1) {
275 wiinst->buffer.cov = 2;
276 wiinst->buffer.size /= wiinst->buffer.cov;
277 } else
278 wiinst->buffer.cov = 1;
279
280 emu10k1_timer_uninstall(card, &wiinst->timer);
281
282 delay = (48000 * wiinst->buffer.fragment_size) / wiinst->format.bytespersec;
283
284 emu10k1_timer_install(card, &wiinst->timer, delay / 2);
285 }
286
287 return 0;
288}
289
290void emu10k1_wavein_getxfersize(struct wiinst *wiinst, u32 * size)
291{
292 struct wavein_buffer *buffer = &wiinst->buffer;
293
294 *size = buffer->bytestocopy;
295
296 if (wiinst->mmapped)
297 return;
298
299 if (*size > buffer->size) {
300 *size = buffer->size;
301 buffer->pos = buffer->hw_pos;
302 buffer->bytestocopy = buffer->size;
303 DPF(1, "buffer overrun\n");
304 }
305}
306
307static int copy_block(u8 __user *dst, u8 * src, u32 str, u32 len, u8 cov)
308{
309 if (cov == 1) {
310 if (__copy_to_user(dst, src + str, len))
311 return -EFAULT;
312 } else {
313 u8 byte;
314 u32 i;
315
316 src += 1 + 2 * str;
317
318 for (i = 0; i < len; i++) {
319 byte = src[2 * i] ^ 0x80;
320 if (__copy_to_user(dst + i, &byte, 1))
321 return -EFAULT;
322 }
323 }
324
325 return 0;
326}
327
328int emu10k1_wavein_xferdata(struct wiinst *wiinst, u8 __user *data, u32 * size)
329{
330 struct wavein_buffer *buffer = &wiinst->buffer;
331 u32 sizetocopy, sizetocopy_now, start;
332 unsigned long flags;
333 int ret;
334
335 sizetocopy = min_t(u32, buffer->size, *size);
336 *size = sizetocopy;
337
338 if (!sizetocopy)
339 return 0;
340
341 spin_lock_irqsave(&wiinst->lock, flags);
342 start = buffer->pos;
343 buffer->pos += sizetocopy;
344 buffer->pos %= buffer->size;
345 buffer->bytestocopy -= sizetocopy;
346 sizetocopy_now = buffer->size - start;
347
348 spin_unlock_irqrestore(&wiinst->lock, flags);
349
350 if (sizetocopy > sizetocopy_now) {
351 sizetocopy -= sizetocopy_now;
352
353 ret = copy_block(data, buffer->addr, start, sizetocopy_now,
354 buffer->cov);
355 if (ret == 0)
356 ret = copy_block(data + sizetocopy_now, buffer->addr, 0,
357 sizetocopy, buffer->cov);
358 } else {
359 ret = copy_block(data, buffer->addr, start, sizetocopy,
360 buffer->cov);
361 }
362
363 return ret;
364}
365
366void emu10k1_wavein_update(struct emu10k1_card *card, struct wiinst *wiinst)
367{
368 u32 hw_pos;
369 u32 diff;
370
371 /* There is no actual start yet */
372 if (!(wiinst->state & WAVE_STATE_STARTED)) {
373 hw_pos = wiinst->buffer.hw_pos;
374 } else {
375 /* hw_pos in byte units */
376 hw_pos = sblive_readptr(card, wiinst->buffer.idxreg, 0) / wiinst->buffer.cov;
377 }
378
379 diff = (wiinst->buffer.size + hw_pos - wiinst->buffer.hw_pos) % wiinst->buffer.size;
380 wiinst->total_recorded += diff;
381 wiinst->buffer.bytestocopy += diff;
382
383 wiinst->buffer.hw_pos = hw_pos;
384}
diff --git a/sound/oss/emu10k1/cardwi.h b/sound/oss/emu10k1/cardwi.h
deleted file mode 100644
index e82029b46ad1..000000000000
--- a/sound/oss/emu10k1/cardwi.h
+++ /dev/null
@@ -1,91 +0,0 @@
1/*
2 **********************************************************************
3 * cardwi.h -- header file for card wave input functions
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31#ifndef _CARDWI_H
32#define _CARDWI_H
33
34#include "icardwav.h"
35#include "audio.h"
36#include "timer.h"
37
38struct wavein_buffer {
39 u16 ossfragshift;
40 u32 fragment_size;
41 u32 numfrags;
42 u32 hw_pos; /* hardware cursor position */
43 u32 pos; /* software cursor position */
44 u32 bytestocopy; /* bytes of recorded data available */
45 u32 size;
46 u32 pages;
47 u32 sizereg;
48 u32 sizeregval;
49 u32 addrreg;
50 u32 idxreg;
51 u32 adcctl;
52 void *addr;
53 u8 cov;
54 dma_addr_t dma_handle;
55};
56
57struct wiinst
58{
59 u8 state;
60 struct emu_timer timer;
61 struct wave_format format;
62 struct wavein_buffer buffer;
63 wait_queue_head_t wait_queue;
64 u8 mmapped;
65 u32 total_recorded; /* total bytes read() from device */
66 u32 blocks;
67 spinlock_t lock;
68 u8 recsrc;
69 u16 fxwc;
70};
71
72#define WAVEIN_MAXBUFSIZE 65536
73#define WAVEIN_MINBUFSIZE 368
74
75#define WAVEIN_DEFAULTFRAGLEN 100
76#define WAVEIN_DEFAULTBUFLEN 1000
77
78#define WAVEIN_MINFRAGSHIFT 8
79#define WAVEIN_MINFRAGS 2
80
81int emu10k1_wavein_open(struct emu10k1_wavedevice *);
82void emu10k1_wavein_close(struct emu10k1_wavedevice *);
83void emu10k1_wavein_start(struct emu10k1_wavedevice *);
84void emu10k1_wavein_stop(struct emu10k1_wavedevice *);
85void emu10k1_wavein_getxfersize(struct wiinst *, u32 *);
86int emu10k1_wavein_xferdata(struct wiinst *, u8 __user *, u32 *);
87int emu10k1_wavein_setformat(struct emu10k1_wavedevice *, struct wave_format *);
88void emu10k1_wavein_update(struct emu10k1_card *, struct wiinst *);
89
90
91#endif /* _CARDWI_H */
diff --git a/sound/oss/emu10k1/cardwo.c b/sound/oss/emu10k1/cardwo.c
deleted file mode 100644
index 54daca4f57b4..000000000000
--- a/sound/oss/emu10k1/cardwo.c
+++ /dev/null
@@ -1,643 +0,0 @@
1/*
2 **********************************************************************
3 * cardwo.c - PCM output HAL for emu10k1 driver
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#include <linux/poll.h>
33#include "hwaccess.h"
34#include "8010.h"
35#include "voicemgr.h"
36#include "cardwo.h"
37#include "audio.h"
38
39static u32 samplerate_to_linearpitch(u32 samplingrate)
40{
41 samplingrate = (samplingrate << 8) / 375;
42 return (samplingrate >> 1) + (samplingrate & 1);
43}
44
45static void query_format(struct emu10k1_wavedevice *wave_dev, struct wave_format *wave_fmt)
46{
47 int i, j, do_passthrough = 0, is_ac3 = 0;
48 struct emu10k1_card *card = wave_dev->card;
49 struct woinst *woinst = wave_dev->woinst;
50
51 if ((wave_fmt->channels > 2) && (wave_fmt->id != AFMT_S16_LE) && (wave_fmt->id != AFMT_U8))
52 wave_fmt->channels = 2;
53
54 if ((wave_fmt->channels < 1) || (wave_fmt->channels > WAVEOUT_MAXVOICES))
55 wave_fmt->channels = 2;
56
57 if (wave_fmt->channels == 2)
58 woinst->num_voices = 1;
59 else
60 woinst->num_voices = wave_fmt->channels;
61
62 if (wave_fmt->samplingrate >= 0x2ee00)
63 wave_fmt->samplingrate = 0x2ee00;
64
65 wave_fmt->passthrough = 0;
66 do_passthrough = is_ac3 = 0;
67
68 if (card->pt.selected)
69 do_passthrough = 1;
70
71 switch (wave_fmt->id) {
72 case AFMT_S16_LE:
73 wave_fmt->bitsperchannel = 16;
74 break;
75 case AFMT_U8:
76 wave_fmt->bitsperchannel = 8;
77 break;
78 case AFMT_AC3:
79 do_passthrough = 1;
80 is_ac3 = 1;
81 break;
82 default:
83 wave_fmt->id = AFMT_S16_LE;
84 wave_fmt->bitsperchannel = 16;
85 break;
86 }
87 if (do_passthrough) {
88 /* currently only one waveout instance may use pass-through */
89 if (woinst->state != WAVE_STATE_CLOSED ||
90 card->pt.state != PT_STATE_INACTIVE ||
91 (wave_fmt->samplingrate != 48000 && !is_ac3)) {
92 DPF(2, "unable to set pass-through mode\n");
93 } else if (USE_PT_METHOD1) {
94 i = emu10k1_find_control_gpr(&card->mgr, card->pt.patch_name, card->pt.intr_gpr_name);
95 j = emu10k1_find_control_gpr(&card->mgr, card->pt.patch_name, card->pt.enable_gpr_name);
96 if (i < 0 || j < 0)
97 DPF(2, "unable to set pass-through mode\n");
98 else {
99 wave_fmt->samplingrate = 48000;
100 wave_fmt->channels = 2;
101 card->pt.pos_gpr = emu10k1_find_control_gpr(&card->mgr, card->pt.patch_name,
102 card->pt.pos_gpr_name);
103 wave_fmt->passthrough = 1;
104 card->pt.intr_gpr = i;
105 card->pt.enable_gpr = j;
106 card->pt.state = PT_STATE_INACTIVE;
107
108 DPD(2, "is_ac3 is %d\n", is_ac3);
109 card->pt.ac3data = is_ac3;
110 wave_fmt->bitsperchannel = 16;
111 }
112 }else{
113 DPF(2, "Using Passthrough Method 2\n");
114 card->pt.enable_gpr = emu10k1_find_control_gpr(&card->mgr, card->pt.patch_name,
115 card->pt.enable_gpr_name);
116 wave_fmt->passthrough = 2;
117 wave_fmt->bitsperchannel = 16;
118 }
119 }
120
121 wave_fmt->bytesperchannel = wave_fmt->bitsperchannel >> 3;
122 wave_fmt->bytespersample = wave_fmt->channels * wave_fmt->bytesperchannel;
123 wave_fmt->bytespersec = wave_fmt->bytespersample * wave_fmt->samplingrate;
124
125 if (wave_fmt->channels == 2)
126 wave_fmt->bytespervoicesample = wave_fmt->channels * wave_fmt->bytesperchannel;
127 else
128 wave_fmt->bytespervoicesample = wave_fmt->bytesperchannel;
129}
130
131static int get_voice(struct emu10k1_card *card, struct woinst *woinst, unsigned int voicenum)
132{
133 struct emu_voice *voice = &woinst->voice[voicenum];
134
135 /* Allocate voices here, if no voices available, return error. */
136
137 voice->usage = VOICE_USAGE_PLAYBACK;
138
139 voice->flags = 0;
140
141 if (woinst->format.channels == 2)
142 voice->flags |= VOICE_FLAGS_STEREO;
143
144 if (woinst->format.bitsperchannel == 16)
145 voice->flags |= VOICE_FLAGS_16BIT;
146
147 if (emu10k1_voice_alloc(card, voice) < 0) {
148 voice->usage = VOICE_USAGE_FREE;
149 return -1;
150 }
151
152 /* Calculate pitch */
153 voice->initial_pitch = (u16) (srToPitch(woinst->format.samplingrate) >> 8);
154 voice->pitch_target = samplerate_to_linearpitch(woinst->format.samplingrate);
155
156 DPD(2, "Initial pitch --> %#x\n", voice->initial_pitch);
157
158 voice->startloop = (voice->mem.emupageindex << 12) /
159 woinst->format.bytespervoicesample;
160 voice->endloop = voice->startloop + woinst->buffer.size / woinst->format.bytespervoicesample;
161 voice->start = voice->startloop;
162
163
164 voice->params[0].volume_target = 0xffff;
165 voice->params[0].initial_fc = 0xff;
166 voice->params[0].initial_attn = 0x00;
167 voice->params[0].byampl_env_sustain = 0x7f;
168 voice->params[0].byampl_env_decay = 0x7f;
169
170
171 if (voice->flags & VOICE_FLAGS_STEREO) {
172 if (woinst->format.passthrough == 2) {
173 voice->params[0].send_routing = voice->params[1].send_routing = card->waveout.send_routing[ROUTE_PT];
174 voice->params[0].send_routing2 = voice->params[1].send_routing2 = card->waveout.send_routing2[ROUTE_PT];
175 voice->params[0].send_dcba = 0xff;
176 voice->params[1].send_dcba = 0xff00;
177 voice->params[0].send_hgfe = voice->params[1].send_hgfe=0;
178 } else {
179 voice->params[0].send_dcba = card->waveout.send_dcba[SEND_LEFT];
180 voice->params[0].send_hgfe = card->waveout.send_hgfe[SEND_LEFT];
181 voice->params[1].send_dcba = card->waveout.send_dcba[SEND_RIGHT];
182 voice->params[1].send_hgfe = card->waveout.send_hgfe[SEND_RIGHT];
183
184 if (woinst->device) {
185 // /dev/dps1
186 voice->params[0].send_routing = voice->params[1].send_routing = card->waveout.send_routing[ROUTE_PCM1];
187 voice->params[0].send_routing2 = voice->params[1].send_routing2 = card->waveout.send_routing2[ROUTE_PCM1];
188 } else {
189 voice->params[0].send_routing = voice->params[1].send_routing = card->waveout.send_routing[ROUTE_PCM];
190 voice->params[0].send_routing2 = voice->params[1].send_routing2 = card->waveout.send_routing2[ROUTE_PCM];
191 }
192 }
193
194 voice->params[1].volume_target = 0xffff;
195 voice->params[1].initial_fc = 0xff;
196 voice->params[1].initial_attn = 0x00;
197 voice->params[1].byampl_env_sustain = 0x7f;
198 voice->params[1].byampl_env_decay = 0x7f;
199 } else {
200 if (woinst->num_voices > 1) {
201 // Multichannel pcm
202 voice->params[0].send_dcba=0xff;
203 voice->params[0].send_hgfe=0;
204 if (card->is_audigy) {
205 voice->params[0].send_routing = 0x3f3f3f00 + card->mchannel_fx + voicenum;
206 voice->params[0].send_routing2 = 0x3f3f3f3f;
207 } else {
208 voice->params[0].send_routing = 0xfff0 + card->mchannel_fx + voicenum;
209 }
210
211 } else {
212 voice->params[0].send_dcba = card->waveout.send_dcba[SEND_MONO];
213 voice->params[0].send_hgfe = card->waveout.send_hgfe[SEND_MONO];
214
215 if (woinst->device) {
216 voice->params[0].send_routing = card->waveout.send_routing[ROUTE_PCM1];
217 voice->params[0].send_routing2 = card->waveout.send_routing2[ROUTE_PCM1];
218 } else {
219 voice->params[0].send_routing = card->waveout.send_routing[ROUTE_PCM];
220 voice->params[0].send_routing2 = card->waveout.send_routing2[ROUTE_PCM];
221 }
222 }
223 }
224
225 DPD(2, "voice: startloop=%#x, endloop=%#x\n", voice->startloop, voice->endloop);
226
227 emu10k1_voice_playback_setup(voice);
228
229 return 0;
230}
231
232int emu10k1_waveout_open(struct emu10k1_wavedevice *wave_dev)
233{
234 struct emu10k1_card *card = wave_dev->card;
235 struct woinst *woinst = wave_dev->woinst;
236 struct waveout_buffer *buffer = &woinst->buffer;
237 unsigned int voicenum;
238 u16 delay;
239
240 DPF(2, "emu10k1_waveout_open()\n");
241
242 for (voicenum = 0; voicenum < woinst->num_voices; voicenum++) {
243 if (emu10k1_voice_alloc_buffer(card, &woinst->voice[voicenum].mem, woinst->buffer.pages) < 0) {
244 ERROR();
245 emu10k1_waveout_close(wave_dev);
246 return -1;
247 }
248
249 if (get_voice(card, woinst, voicenum) < 0) {
250 ERROR();
251 emu10k1_waveout_close(wave_dev);
252 return -1;
253 }
254 }
255
256 buffer->fill_silence = 0;
257 buffer->silence_bytes = 0;
258 buffer->silence_pos = 0;
259 buffer->hw_pos = 0;
260 buffer->free_bytes = woinst->buffer.size;
261
262 delay = (48000 * woinst->buffer.fragment_size) /
263 (woinst->format.samplingrate * woinst->format.bytespervoicesample);
264
265 emu10k1_timer_install(card, &woinst->timer, delay);
266
267 woinst->state = WAVE_STATE_OPEN;
268
269 return 0;
270}
271
272void emu10k1_waveout_close(struct emu10k1_wavedevice *wave_dev)
273{
274 struct emu10k1_card *card = wave_dev->card;
275 struct woinst *woinst = wave_dev->woinst;
276 unsigned int voicenum;
277
278 DPF(2, "emu10k1_waveout_close()\n");
279
280 emu10k1_waveout_stop(wave_dev);
281
282 emu10k1_timer_uninstall(card, &woinst->timer);
283
284 for (voicenum = 0; voicenum < woinst->num_voices; voicenum++) {
285 emu10k1_voice_free(&woinst->voice[voicenum]);
286 emu10k1_voice_free_buffer(card, &woinst->voice[voicenum].mem);
287 }
288
289 woinst->state = WAVE_STATE_CLOSED;
290}
291
292void emu10k1_waveout_start(struct emu10k1_wavedevice *wave_dev)
293{
294 struct emu10k1_card *card = wave_dev->card;
295 struct woinst *woinst = wave_dev->woinst;
296 struct pt_data *pt = &card->pt;
297
298 DPF(2, "emu10k1_waveout_start()\n");
299
300 if (woinst->format.passthrough == 2) {
301 emu10k1_pt_setup(wave_dev);
302 sblive_writeptr(card, (card->is_audigy ? A_GPR_BASE : GPR_BASE) + pt->enable_gpr, 0, 1);
303 pt->state = PT_STATE_PLAYING;
304 }
305
306 /* Actual start */
307 emu10k1_voices_start(woinst->voice, woinst->num_voices, woinst->total_played);
308
309 emu10k1_timer_enable(card, &woinst->timer);
310
311 woinst->state |= WAVE_STATE_STARTED;
312}
313
314int emu10k1_waveout_setformat(struct emu10k1_wavedevice *wave_dev, struct wave_format *format)
315{
316 struct emu10k1_card *card = wave_dev->card;
317 struct woinst *woinst = wave_dev->woinst;
318 unsigned int voicenum;
319 u16 delay;
320
321 DPF(2, "emu10k1_waveout_setformat()\n");
322
323 if (woinst->state & WAVE_STATE_STARTED)
324 return -1;
325
326 query_format(wave_dev, format);
327
328 if (woinst->format.samplingrate != format->samplingrate ||
329 woinst->format.channels != format->channels ||
330 woinst->format.bitsperchannel != format->bitsperchannel) {
331
332 woinst->format = *format;
333
334 if (woinst->state == WAVE_STATE_CLOSED)
335 return 0;
336
337 emu10k1_timer_uninstall(card, &woinst->timer);
338
339 for (voicenum = 0; voicenum < woinst->num_voices; voicenum++) {
340 emu10k1_voice_free(&woinst->voice[voicenum]);
341
342 if (get_voice(card, woinst, voicenum) < 0) {
343 ERROR();
344 emu10k1_waveout_close(wave_dev);
345 return -1;
346 }
347 }
348
349 delay = (48000 * woinst->buffer.fragment_size) /
350 (woinst->format.samplingrate * woinst->format.bytespervoicesample);
351
352 emu10k1_timer_install(card, &woinst->timer, delay);
353 }
354
355 return 0;
356}
357
358void emu10k1_waveout_stop(struct emu10k1_wavedevice *wave_dev)
359{
360 struct emu10k1_card *card = wave_dev->card;
361 struct woinst *woinst = wave_dev->woinst;
362
363 DPF(2, "emu10k1_waveout_stop()\n");
364
365 if (!(woinst->state & WAVE_STATE_STARTED))
366 return;
367
368 emu10k1_timer_disable(card, &woinst->timer);
369
370 /* Stop actual voices */
371 emu10k1_voices_stop(woinst->voice, woinst->num_voices);
372
373 emu10k1_waveout_update(woinst);
374
375 woinst->state &= ~WAVE_STATE_STARTED;
376}
377
378/**
379 * emu10k1_waveout_getxfersize -
380 *
381 * gives the total free bytes on the voice buffer, including silence bytes
382 * (basically: total_free_bytes = free_bytes + silence_bytes).
383 *
384 */
385void emu10k1_waveout_getxfersize(struct woinst *woinst, u32 *total_free_bytes)
386{
387 struct waveout_buffer *buffer = &woinst->buffer;
388 int pending_bytes;
389
390 if (woinst->mmapped) {
391 *total_free_bytes = buffer->free_bytes;
392 return;
393 }
394
395 pending_bytes = buffer->size - buffer->free_bytes;
396
397 buffer->fill_silence = (pending_bytes < (signed) buffer->fragment_size * 2) ? 1 : 0;
398
399 if (pending_bytes > (signed) buffer->silence_bytes) {
400 *total_free_bytes = (buffer->free_bytes + buffer->silence_bytes);
401 } else {
402 *total_free_bytes = buffer->size;
403 buffer->silence_bytes = pending_bytes;
404 if (pending_bytes < 0) {
405 buffer->silence_pos = buffer->hw_pos;
406 buffer->silence_bytes = 0;
407 buffer->free_bytes = buffer->size;
408 DPF(1, "buffer underrun\n");
409 }
410 }
411}
412
413/**
414 * copy_block -
415 *
416 * copies a block of pcm data to a voice buffer.
417 * Notice that the voice buffer is actually a set of disjointed memory pages.
418 *
419 */
420static void copy_block(void **dst, u32 str, u8 __user *src, u32 len)
421{
422 unsigned int pg;
423 unsigned int pgoff;
424 unsigned int k;
425
426 pg = str / PAGE_SIZE;
427 pgoff = str % PAGE_SIZE;
428
429 if (len > PAGE_SIZE - pgoff) {
430 k = PAGE_SIZE - pgoff;
431 if (__copy_from_user((u8 *)dst[pg] + pgoff, src, k))
432 return;
433 len -= k;
434 while (len > PAGE_SIZE) {
435 if (__copy_from_user(dst[++pg], src + k, PAGE_SIZE))
436 return;
437 k += PAGE_SIZE;
438 len -= PAGE_SIZE;
439 }
440 if (__copy_from_user(dst[++pg], src + k, len))
441 return;
442
443 } else
444 __copy_from_user((u8 *)dst[pg] + pgoff, src, len);
445}
446
447/**
448 * copy_ilv_block -
449 *
450 * copies a block of pcm data containing n interleaved channels to n mono voice buffers.
451 * Notice that the voice buffer is actually a set of disjointed memory pages.
452 *
453 */
454static void copy_ilv_block(struct woinst *woinst, u32 str, u8 __user *src, u32 len)
455{
456 unsigned int pg;
457 unsigned int pgoff;
458 unsigned int voice_num;
459 struct emu_voice *voice = woinst->voice;
460
461 pg = str / PAGE_SIZE;
462 pgoff = str % PAGE_SIZE;
463
464 while (len) {
465 for (voice_num = 0; voice_num < woinst->num_voices; voice_num++) {
466 if (__copy_from_user((u8 *)(voice[voice_num].mem.addr[pg]) + pgoff, src, woinst->format.bytespervoicesample))
467 return;
468 src += woinst->format.bytespervoicesample;
469 }
470
471 len -= woinst->format.bytespervoicesample;
472
473 pgoff += woinst->format.bytespervoicesample;
474 if (pgoff >= PAGE_SIZE) {
475 pgoff = 0;
476 pg++;
477 }
478 }
479}
480
481/**
482 * fill_block -
483 *
484 * fills a set voice buffers with a block of a given sample.
485 *
486 */
487static void fill_block(struct woinst *woinst, u32 str, u8 data, u32 len)
488{
489 unsigned int pg;
490 unsigned int pgoff;
491 unsigned int voice_num;
492 struct emu_voice *voice = woinst->voice;
493 unsigned int k;
494
495 pg = str / PAGE_SIZE;
496 pgoff = str % PAGE_SIZE;
497
498 if (len > PAGE_SIZE - pgoff) {
499 k = PAGE_SIZE - pgoff;
500 for (voice_num = 0; voice_num < woinst->num_voices; voice_num++)
501 memset((u8 *)voice[voice_num].mem.addr[pg] + pgoff, data, k);
502 len -= k;
503 while (len > PAGE_SIZE) {
504 pg++;
505 for (voice_num = 0; voice_num < woinst->num_voices; voice_num++)
506 memset(voice[voice_num].mem.addr[pg], data, PAGE_SIZE);
507
508 len -= PAGE_SIZE;
509 }
510 pg++;
511 for (voice_num = 0; voice_num < woinst->num_voices; voice_num++)
512 memset(voice[voice_num].mem.addr[pg], data, len);
513
514 } else {
515 for (voice_num = 0; voice_num < woinst->num_voices; voice_num++)
516 memset((u8 *)voice[voice_num].mem.addr[pg] + pgoff, data, len);
517 }
518}
519
520/**
521 * emu10k1_waveout_xferdata -
522 *
523 * copies pcm data to the voice buffer. Silence samples
524 * previously added to the buffer are overwritten.
525 *
526 */
527void emu10k1_waveout_xferdata(struct woinst *woinst, u8 __user *data, u32 *size)
528{
529 struct waveout_buffer *buffer = &woinst->buffer;
530 struct voice_mem *mem = &woinst->voice[0].mem;
531 u32 sizetocopy, sizetocopy_now, start;
532 unsigned long flags;
533
534 sizetocopy = min_t(u32, buffer->size, *size);
535 *size = sizetocopy;
536
537 if (!sizetocopy)
538 return;
539
540 spin_lock_irqsave(&woinst->lock, flags);
541 start = (buffer->size + buffer->silence_pos - buffer->silence_bytes) % buffer->size;
542
543 if (sizetocopy > buffer->silence_bytes) {
544 buffer->silence_pos += sizetocopy - buffer->silence_bytes;
545 buffer->free_bytes -= sizetocopy - buffer->silence_bytes;
546 buffer->silence_bytes = 0;
547 } else
548 buffer->silence_bytes -= sizetocopy;
549
550 spin_unlock_irqrestore(&woinst->lock, flags);
551
552 sizetocopy_now = buffer->size - start;
553 if (sizetocopy > sizetocopy_now) {
554 sizetocopy -= sizetocopy_now;
555 if (woinst->num_voices > 1) {
556 copy_ilv_block(woinst, start, data, sizetocopy_now);
557 copy_ilv_block(woinst, 0, data + sizetocopy_now * woinst->num_voices, sizetocopy);
558 } else {
559 copy_block(mem->addr, start, data, sizetocopy_now);
560 copy_block(mem->addr, 0, data + sizetocopy_now, sizetocopy);
561 }
562 } else {
563 if (woinst->num_voices > 1)
564 copy_ilv_block(woinst, start, data, sizetocopy);
565 else
566 copy_block(mem->addr, start, data, sizetocopy);
567 }
568}
569
570/**
571 * emu10k1_waveout_fillsilence -
572 *
573 * adds samples of silence to the voice buffer so that we
574 * don't loop over stale pcm data.
575 *
576 */
577void emu10k1_waveout_fillsilence(struct woinst *woinst)
578{
579 struct waveout_buffer *buffer = &woinst->buffer;
580 u32 sizetocopy, sizetocopy_now, start;
581 u8 filldata;
582 unsigned long flags;
583
584 sizetocopy = buffer->fragment_size;
585
586 if (woinst->format.bitsperchannel == 16)
587 filldata = 0x00;
588 else
589 filldata = 0x80;
590
591 spin_lock_irqsave(&woinst->lock, flags);
592 buffer->silence_bytes += sizetocopy;
593 buffer->free_bytes -= sizetocopy;
594 buffer->silence_pos %= buffer->size;
595 start = buffer->silence_pos;
596 buffer->silence_pos += sizetocopy;
597 spin_unlock_irqrestore(&woinst->lock, flags);
598
599 sizetocopy_now = buffer->size - start;
600
601 if (sizetocopy > sizetocopy_now) {
602 sizetocopy -= sizetocopy_now;
603 fill_block(woinst, start, filldata, sizetocopy_now);
604 fill_block(woinst, 0, filldata, sizetocopy);
605 } else {
606 fill_block(woinst, start, filldata, sizetocopy);
607 }
608}
609
610/**
611 * emu10k1_waveout_update -
612 *
613 * updates the position of the voice buffer hardware pointer (hw_pos)
614 * and the number of free bytes on the buffer (free_bytes).
615 * The free bytes _don't_ include silence bytes that may have been
616 * added to the buffer.
617 *
618 */
619void emu10k1_waveout_update(struct woinst *woinst)
620{
621 u32 hw_pos;
622 u32 diff;
623
624 /* There is no actual start yet */
625 if (!(woinst->state & WAVE_STATE_STARTED)) {
626 hw_pos = woinst->buffer.hw_pos;
627 } else {
628 /* hw_pos in sample units */
629 hw_pos = sblive_readptr(woinst->voice[0].card, CCCA_CURRADDR, woinst->voice[0].num);
630
631 if(hw_pos < woinst->voice[0].start)
632 hw_pos += woinst->buffer.size / woinst->format.bytespervoicesample - woinst->voice[0].start;
633 else
634 hw_pos -= woinst->voice[0].start;
635
636 hw_pos *= woinst->format.bytespervoicesample;
637 }
638
639 diff = (woinst->buffer.size + hw_pos - woinst->buffer.hw_pos) % woinst->buffer.size;
640 woinst->total_played += diff;
641 woinst->buffer.free_bytes += diff;
642 woinst->buffer.hw_pos = hw_pos;
643}
diff --git a/sound/oss/emu10k1/cardwo.h b/sound/oss/emu10k1/cardwo.h
deleted file mode 100644
index 1dece8853e5c..000000000000
--- a/sound/oss/emu10k1/cardwo.h
+++ /dev/null
@@ -1,90 +0,0 @@
1/*
2 **********************************************************************
3 * cardwo.h -- header file for card wave out functions
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#ifndef _CARDWO_H
33#define _CARDWO_H
34
35#include "icardwav.h"
36#include "audio.h"
37#include "voicemgr.h"
38#include "timer.h"
39
40/* setting this to other than a power of two may break some applications */
41#define WAVEOUT_MAXBUFSIZE MAXBUFSIZE
42
43#define WAVEOUT_DEFAULTFRAGLEN 20 /* Time to play a fragment in ms (latency) */
44#define WAVEOUT_DEFAULTBUFLEN 500 /* Time to play the entire buffer in ms */
45
46#define WAVEOUT_MINFRAGSHIFT 6 /* Minimum fragment size in bytes is 2^6 */
47#define WAVEOUT_MINFRAGS 3 /* _don't_ go bellow 3, it would break silence filling */
48#define WAVEOUT_MAXVOICES 6
49
50struct waveout_buffer {
51 u16 ossfragshift;
52 u32 numfrags;
53 u32 fragment_size; /* in bytes units */
54 u32 size; /* in bytes units */
55 u32 pages; /* buffer size in page units*/
56 u32 silence_pos; /* software cursor position (including silence bytes) */
57 u32 hw_pos; /* hardware cursor position */
58 u32 free_bytes; /* free bytes available on the buffer (not including silence bytes) */
59 u8 fill_silence;
60 u32 silence_bytes; /* silence bytes on the buffer */
61};
62
63struct woinst
64{
65 u8 state;
66 u8 num_voices;
67 struct emu_voice voice[WAVEOUT_MAXVOICES];
68 struct emu_timer timer;
69 struct wave_format format;
70 struct waveout_buffer buffer;
71 wait_queue_head_t wait_queue;
72 u8 mmapped;
73 u32 total_copied; /* total number of bytes written() to the buffer (excluding silence) */
74 u32 total_played; /* total number of bytes played including silence */
75 u32 blocks;
76 u8 device;
77 spinlock_t lock;
78};
79
80int emu10k1_waveout_open(struct emu10k1_wavedevice *);
81void emu10k1_waveout_close(struct emu10k1_wavedevice *);
82void emu10k1_waveout_start(struct emu10k1_wavedevice *);
83void emu10k1_waveout_stop(struct emu10k1_wavedevice *);
84void emu10k1_waveout_getxfersize(struct woinst*, u32 *);
85void emu10k1_waveout_xferdata(struct woinst*, u8 __user *, u32 *);
86void emu10k1_waveout_fillsilence(struct woinst*);
87int emu10k1_waveout_setformat(struct emu10k1_wavedevice*, struct wave_format*);
88void emu10k1_waveout_update(struct woinst*);
89
90#endif /* _CARDWO_H */
diff --git a/sound/oss/emu10k1/ecard.c b/sound/oss/emu10k1/ecard.c
deleted file mode 100644
index 4ae635fe1402..000000000000
--- a/sound/oss/emu10k1/ecard.c
+++ /dev/null
@@ -1,157 +0,0 @@
1/*
2 **********************************************************************
3 * ecard.c - E-card initialization code
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#include "ecard.h"
33#include "hwaccess.h"
34
35/* Private routines */
36static void ecard_setadcgain(struct emu10k1_card *, struct ecard_state *, u16);
37static void ecard_write(struct emu10k1_card *, u32);
38
39/**************************************************************************
40 * @func Set the gain of the ECARD's CS3310 Trim/gain controller. The
41 * trim value consists of a 16bit value which is composed of two
42 * 8 bit gain/trim values, one for the left channel and one for the
43 * right channel. The following table maps from the Gain/Attenuation
44 * value in decibels into the corresponding bit pattern for a single
45 * channel.
46 */
47
48static void ecard_setadcgain(struct emu10k1_card *card, struct ecard_state *ecard, u16 gain)
49{
50 u32 currbit;
51 ecard->adc_gain = gain;
52
53 /* Enable writing to the TRIM registers */
54 ecard_write(card, ecard->control_bits & ~EC_TRIM_CSN);
55
56 /* Do it again to insure that we meet hold time requirements */
57 ecard_write(card, ecard->control_bits & ~EC_TRIM_CSN);
58
59 for (currbit = (1L << 15); currbit; currbit >>= 1) {
60
61 u32 value = ecard->control_bits & ~(EC_TRIM_CSN|EC_TRIM_SDATA);
62
63 if (gain & currbit)
64 value |= EC_TRIM_SDATA;
65
66 /* Clock the bit */
67 ecard_write(card, value);
68 ecard_write(card, value | EC_TRIM_SCLK);
69 ecard_write(card, value);
70 }
71
72 ecard_write(card, ecard->control_bits);
73}
74
75/**************************************************************************
76 * @func Clock bits into the Ecard's control latch. The Ecard uses a
77 * control latch will is loaded bit-serially by toggling the Modem control
78 * lines from function 2 on the E8010. This function hides these details
79 * and presents the illusion that we are actually writing to a distinct
80 * register.
81 */
82static void ecard_write(struct emu10k1_card *card, u32 value)
83{
84 u16 count;
85 u32 data, hcvalue;
86 unsigned long flags;
87
88 spin_lock_irqsave(&card->lock, flags);
89
90 hcvalue = inl(card->iobase + HCFG) & ~(HOOKN_BIT|HANDN_BIT|PULSEN_BIT);
91
92 outl(card->iobase + HCFG, hcvalue);
93
94 for (count = 0 ; count < EC_NUM_CONTROL_BITS; count++) {
95
96 /* Set up the value */
97 data = ((value & 0x1) ? PULSEN_BIT : 0);
98 value >>= 1;
99
100 outl(card->iobase + HCFG, hcvalue | data);
101
102 /* Clock the shift register */
103 outl(card->iobase + HCFG, hcvalue | data | HANDN_BIT);
104 outl(card->iobase + HCFG, hcvalue | data);
105 }
106
107 /* Latch the bits */
108 outl(card->iobase + HCFG, hcvalue | HOOKN_BIT);
109 outl(card->iobase + HCFG, hcvalue);
110
111 spin_unlock_irqrestore(&card->lock, flags);
112}
113
114void __devinit emu10k1_ecard_init(struct emu10k1_card *card)
115{
116 u32 hcvalue;
117 struct ecard_state ecard;
118
119 /* Set up the initial settings */
120 ecard.mux0_setting = EC_DEFAULT_SPDIF0_SEL;
121 ecard.mux1_setting = EC_DEFAULT_SPDIF1_SEL;
122 ecard.mux2_setting = 0;
123 ecard.adc_gain = EC_DEFAULT_ADC_GAIN;
124 ecard.control_bits = EC_RAW_RUN_MODE |
125 EC_SPDIF0_SELECT(ecard.mux0_setting) |
126 EC_SPDIF1_SELECT(ecard.mux1_setting);
127
128
129 /* Step 0: Set the codec type in the hardware control register
130 * and enable audio output */
131 hcvalue = emu10k1_readfn0(card, HCFG);
132 emu10k1_writefn0(card, HCFG, hcvalue | HCFG_AUDIOENABLE | HCFG_CODECFORMAT_I2S);
133
134 /* Step 1: Turn off the led and deassert TRIM_CS */
135 ecard_write(card, EC_ADCCAL | EC_LEDN | EC_TRIM_CSN);
136
137 /* Step 2: Calibrate the ADC and DAC */
138 ecard_write(card, EC_DACCAL | EC_LEDN | EC_TRIM_CSN);
139
140 /* Step 3: Wait for awhile; FIXME: Is this correct? */
141
142 current->state = TASK_INTERRUPTIBLE;
143 schedule_timeout(HZ);
144
145 /* Step 4: Switch off the DAC and ADC calibration. Note
146 * That ADC_CAL is actually an inverted signal, so we assert
147 * it here to stop calibration. */
148 ecard_write(card, EC_ADCCAL | EC_LEDN | EC_TRIM_CSN);
149
150 /* Step 4: Switch into run mode */
151 ecard_write(card, ecard.control_bits);
152
153 /* Step 5: Set the analog input gain */
154 ecard_setadcgain(card, &ecard, ecard.adc_gain);
155}
156
157
diff --git a/sound/oss/emu10k1/ecard.h b/sound/oss/emu10k1/ecard.h
deleted file mode 100644
index 67aead16e8ec..000000000000
--- a/sound/oss/emu10k1/ecard.h
+++ /dev/null
@@ -1,113 +0,0 @@
1/*
2 **********************************************************************
3 * ecard.h
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
21 * USA.
22 *
23 **********************************************************************
24 */
25
26#ifndef _ECARD_H
27#define _ECARD_H
28
29#include "8010.h"
30#include "hwaccess.h"
31#include <linux/init.h>
32
33/* In A1 Silicon, these bits are in the HC register */
34#define HOOKN_BIT (1L << 12)
35#define HANDN_BIT (1L << 11)
36#define PULSEN_BIT (1L << 10)
37
38#define EC_GDI1 (1 << 13)
39#define EC_GDI0 (1 << 14)
40
41#define EC_NUM_CONTROL_BITS 20
42
43#define EC_AC3_DATA_SELN 0x0001L
44#define EC_EE_DATA_SEL 0x0002L
45#define EC_EE_CNTRL_SELN 0x0004L
46#define EC_EECLK 0x0008L
47#define EC_EECS 0x0010L
48#define EC_EESDO 0x0020L
49#define EC_TRIM_CSN 0x0040L
50#define EC_TRIM_SCLK 0x0080L
51#define EC_TRIM_SDATA 0x0100L
52#define EC_TRIM_MUTEN 0x0200L
53#define EC_ADCCAL 0x0400L
54#define EC_ADCRSTN 0x0800L
55#define EC_DACCAL 0x1000L
56#define EC_DACMUTEN 0x2000L
57#define EC_LEDN 0x4000L
58
59#define EC_SPDIF0_SEL_SHIFT 15
60#define EC_SPDIF1_SEL_SHIFT 17
61#define EC_SPDIF0_SEL_MASK (0x3L << EC_SPDIF0_SEL_SHIFT)
62#define EC_SPDIF1_SEL_MASK (0x7L << EC_SPDIF1_SEL_SHIFT)
63#define EC_SPDIF0_SELECT(_x) (((_x) << EC_SPDIF0_SEL_SHIFT) & EC_SPDIF0_SEL_MASK)
64#define EC_SPDIF1_SELECT(_x) (((_x) << EC_SPDIF1_SEL_SHIFT) & EC_SPDIF1_SEL_MASK)
65#define EC_CURRENT_PROM_VERSION 0x01 /* Self-explanatory. This should
66 * be incremented any time the EEPROM's
67 * format is changed. */
68
69#define EC_EEPROM_SIZE 0x40 /* ECARD EEPROM has 64 16-bit words */
70
71/* Addresses for special values stored in to EEPROM */
72#define EC_PROM_VERSION_ADDR 0x20 /* Address of the current prom version */
73#define EC_BOARDREV0_ADDR 0x21 /* LSW of board rev */
74#define EC_BOARDREV1_ADDR 0x22 /* MSW of board rev */
75
76#define EC_LAST_PROMFILE_ADDR 0x2f
77
78#define EC_SERIALNUM_ADD 0x30 /* First word of serial number. The number
79 * can be up to 30 characters in length
80 * and is stored as a NULL-terminated
81 * ASCII string. Any unused bytes must be
82 * filled with zeros */
83#define EC_CHECKSUM_ADDR 0x3f /* Location at which checksum is stored */
84
85
86
87/* Most of this stuff is pretty self-evident. According to the hardware
88 * dudes, we need to leave the ADCCAL bit low in order to avoid a DC
89 * offset problem. Weird.
90 */
91#define EC_RAW_RUN_MODE (EC_DACMUTEN | EC_ADCRSTN | EC_TRIM_MUTEN | EC_TRIM_CSN)
92
93
94#define EC_DEFAULT_ADC_GAIN 0xC4C4
95#define EC_DEFAULT_SPDIF0_SEL 0x0
96#define EC_DEFAULT_SPDIF1_SEL 0x4
97
98#define HC_EA 0x01L
99
100/* ECARD state structure. This structure maintains the state
101 * for various portions of the ECARD's onboard hardware.
102 */
103struct ecard_state {
104 u32 control_bits;
105 u16 adc_gain;
106 u16 mux0_setting;
107 u16 mux1_setting;
108 u16 mux2_setting;
109};
110
111void emu10k1_ecard_init(struct emu10k1_card *) __devinit;
112
113#endif /* _ECARD_H */
diff --git a/sound/oss/emu10k1/efxmgr.c b/sound/oss/emu10k1/efxmgr.c
deleted file mode 100644
index 7d5865de4c2e..000000000000
--- a/sound/oss/emu10k1/efxmgr.c
+++ /dev/null
@@ -1,220 +0,0 @@
1/*
2 **********************************************************************
3 * efxmgr.c
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#include <linux/bitops.h>
33#include "hwaccess.h"
34#include "efxmgr.h"
35
36int emu10k1_find_control_gpr(struct patch_manager *mgr, const char *patch_name, const char *gpr_name)
37{
38 struct dsp_patch *patch;
39 struct dsp_rpatch *rpatch;
40 char s[PATCH_NAME_SIZE + 4];
41 unsigned long *gpr_used;
42 int i;
43
44 DPD(2, "emu10k1_find_control_gpr(): %s %s\n", patch_name, gpr_name);
45
46 rpatch = &mgr->rpatch;
47 if (!strcmp(rpatch->name, patch_name)) {
48 gpr_used = rpatch->gpr_used;
49 goto match;
50 }
51
52 for (i = 0; i < mgr->current_pages * PATCHES_PER_PAGE; i++) {
53 patch = PATCH(mgr, i);
54 sprintf(s,"%s", patch->name);
55
56 if (!strcmp(s, patch_name)) {
57 gpr_used = patch->gpr_used;
58 goto match;
59 }
60 }
61
62 return -1;
63
64 match:
65 for (i = 0; i < NUM_GPRS; i++)
66 if (mgr->gpr[i].type == GPR_TYPE_CONTROL &&
67 test_bit(i, gpr_used) &&
68 !strcmp(mgr->gpr[i].name, gpr_name))
69 return i;
70
71 return -1;
72}
73
74void emu10k1_set_control_gpr(struct emu10k1_card *card, int addr, s32 val, int flag)
75{
76 struct patch_manager *mgr = &card->mgr;
77
78 DPD(2, "emu10k1_set_control_gpr(): %d %x\n", addr, val);
79
80 if (addr < 0 || addr >= NUM_GPRS)
81 return;
82
83 //fixme: once patch manager is up, remember to fix this for the audigy
84 if (card->is_audigy) {
85 sblive_writeptr(card, A_GPR_BASE + addr, 0, val);
86 } else {
87 if (flag)
88 val += sblive_readptr(card, GPR_BASE + addr, 0);
89 if (val > mgr->gpr[addr].max)
90 val = mgr->gpr[addr].max;
91 else if (val < mgr->gpr[addr].min)
92 val = mgr->gpr[addr].min;
93 sblive_writeptr(card, GPR_BASE + addr, 0, val);
94 }
95
96
97}
98
99//TODO: make this configurable:
100#define VOLCTRL_CHANNEL SOUND_MIXER_VOLUME
101#define VOLCTRL_STEP_SIZE 5
102
103//An internal function for setting OSS mixer controls.
104static void emu10k1_set_oss_vol(struct emu10k1_card *card, int oss_mixer,
105 unsigned int left, unsigned int right)
106{
107 extern char volume_params[SOUND_MIXER_NRDEVICES];
108
109 card->ac97->mixer_state[oss_mixer] = (right << 8) | left;
110
111 if (!card->is_aps)
112 card->ac97->write_mixer(card->ac97, oss_mixer, left, right);
113
114 emu10k1_set_volume_gpr(card, card->mgr.ctrl_gpr[oss_mixer][0], left,
115 volume_params[oss_mixer]);
116
117 emu10k1_set_volume_gpr(card, card->mgr.ctrl_gpr[oss_mixer][1], right,
118 volume_params[oss_mixer]);
119}
120
121//FIXME: mute should unmute when pressed a second time
122void emu10k1_mute_irqhandler(struct emu10k1_card *card)
123{
124 int oss_channel = VOLCTRL_CHANNEL;
125 int left, right;
126 static int val;
127
128 if (val) {
129 left = val & 0xff;
130 right = (val >> 8) & 0xff;
131 val = 0;
132 } else {
133 val = card->ac97->mixer_state[oss_channel];
134 left = 0;
135 right = 0;
136 }
137
138 emu10k1_set_oss_vol(card, oss_channel, left, right);
139}
140
141void emu10k1_volincr_irqhandler(struct emu10k1_card *card)
142{
143 int oss_channel = VOLCTRL_CHANNEL;
144 int left, right;
145
146 left = card->ac97->mixer_state[oss_channel] & 0xff;
147 right = (card->ac97->mixer_state[oss_channel] >> 8) & 0xff;
148
149 if ((left += VOLCTRL_STEP_SIZE) > 100)
150 left = 100;
151
152 if ((right += VOLCTRL_STEP_SIZE) > 100)
153 right = 100;
154
155 emu10k1_set_oss_vol(card, oss_channel, left, right);
156}
157
158void emu10k1_voldecr_irqhandler(struct emu10k1_card *card)
159{
160 int oss_channel = VOLCTRL_CHANNEL;
161 int left, right;
162
163 left = card->ac97->mixer_state[oss_channel] & 0xff;
164 right = (card->ac97->mixer_state[oss_channel] >> 8) & 0xff;
165
166 if ((left -= VOLCTRL_STEP_SIZE) < 0)
167 left = 0;
168
169 if ((right -= VOLCTRL_STEP_SIZE) < 0)
170 right = 0;
171
172 emu10k1_set_oss_vol(card, oss_channel, left, right);
173}
174
175void emu10k1_set_volume_gpr(struct emu10k1_card *card, int addr, s32 vol, int scale)
176{
177 struct patch_manager *mgr = &card->mgr;
178 unsigned long flags;
179
180 static const s32 log2lin[4] ={ // attenuation (dB)
181 0x7fffffff, // 0.0
182 0x7fffffff * 0.840896415253715 , // 1.5
183 0x7fffffff * 0.707106781186548, // 3.0
184 0x7fffffff * 0.594603557501361 , // 4.5
185 };
186
187 if (addr < 0)
188 return;
189
190 vol = (100 - vol ) * scale / 100;
191
192 // Thanks to the comp.dsp newsgroup for this neat trick:
193 vol = (vol >= scale) ? 0 : (log2lin[vol & 3] >> (vol >> 2));
194
195 spin_lock_irqsave(&mgr->lock, flags);
196 emu10k1_set_control_gpr(card, addr, vol, 0);
197 spin_unlock_irqrestore(&mgr->lock, flags);
198}
199
200void emu10k1_dsp_irqhandler(struct emu10k1_card *card)
201{
202 unsigned long flags;
203
204 if (card->pt.state != PT_STATE_INACTIVE) {
205 u32 bc;
206 bc = sblive_readptr(card, GPR_BASE + card->pt.intr_gpr, 0);
207 if (bc != 0) {
208 DPD(3, "pt interrupt, bc = %d\n", bc);
209 spin_lock_irqsave(&card->pt.lock, flags);
210 card->pt.blocks_played = bc;
211 if (card->pt.blocks_played >= card->pt.blocks_copied) {
212 DPF(1, "buffer underrun in passthrough playback\n");
213 emu10k1_pt_stop(card);
214 }
215 wake_up_interruptible(&card->pt.wait);
216 spin_unlock_irqrestore(&card->pt.lock, flags);
217 }
218 }
219}
220
diff --git a/sound/oss/emu10k1/efxmgr.h b/sound/oss/emu10k1/efxmgr.h
deleted file mode 100644
index ef48e5c70d1f..000000000000
--- a/sound/oss/emu10k1/efxmgr.h
+++ /dev/null
@@ -1,270 +0,0 @@
1/*
2 **********************************************************************
3 * sblive_fx.h
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#ifndef _EFXMGR_H
33#define _EFXMGR_H
34
35struct emu_efx_info_t{
36 int opcode_shift;
37 int high_operand_shift;
38 int instruction_start;
39 int gpr_base;
40 int output_base;
41};
42
43
44#define WRITE_EFX(a, b, c) sblive_writeptr((a), emu_efx_info[card->is_audigy].instruction_start + (b), 0, (c))
45
46#define OP(op, z, w, x, y) \
47 do { WRITE_EFX(card, (pc) * 2, ((x) << emu_efx_info[card->is_audigy].high_operand_shift) | (y)); \
48 WRITE_EFX(card, (pc) * 2 + 1, ((op) << emu_efx_info[card->is_audigy].opcode_shift ) | ((z) << emu_efx_info[card->is_audigy].high_operand_shift) | (w)); \
49 ++pc; } while (0)
50
51#define NUM_INPUTS 0x20
52#define NUM_OUTPUTS 0x20
53#define NUM_GPRS 0x100
54
55#define A_NUM_INPUTS 0x60
56#define A_NUM_OUTPUTS 0x60 //fixme: this may or may not be true
57#define A_NUM_GPRS 0x200
58
59#define GPR_NAME_SIZE 32
60#define PATCH_NAME_SIZE 32
61
62struct dsp_rpatch {
63 char name[PATCH_NAME_SIZE];
64 u16 code_start;
65 u16 code_size;
66
67 unsigned long gpr_used[NUM_GPRS / (sizeof(unsigned long) * 8) + 1];
68 unsigned long gpr_input[NUM_GPRS / (sizeof(unsigned long) * 8) + 1];
69 unsigned long route[NUM_OUTPUTS];
70 unsigned long route_v[NUM_OUTPUTS];
71};
72
73struct dsp_patch {
74 char name[PATCH_NAME_SIZE];
75 u8 id;
76 unsigned long input; /* bitmap of the lines used as inputs */
77 unsigned long output; /* bitmap of the lines used as outputs */
78 u16 code_start;
79 u16 code_size;
80
81 unsigned long gpr_used[NUM_GPRS / (sizeof(unsigned long) * 8) + 1]; /* bitmap of used gprs */
82 unsigned long gpr_input[NUM_GPRS / (sizeof(unsigned long) * 8) + 1];
83 u8 traml_istart; /* starting address of the internal tram lines used */
84 u8 traml_isize; /* number of internal tram lines used */
85
86 u8 traml_estart;
87 u8 traml_esize;
88
89 u16 tramb_istart; /* starting address of the internal tram memory used */
90 u16 tramb_isize; /* amount of internal memory used */
91 u32 tramb_estart;
92 u32 tramb_esize;
93};
94
95struct dsp_gpr {
96 u8 type; /* gpr type, STATIC, DYNAMIC, INPUT, OUTPUT, CONTROL */
97 char name[GPR_NAME_SIZE]; /* gpr value, only valid for control gprs */
98 s32 min, max; /* value range for this gpr, only valid for control gprs */
99 u8 line; /* which input/output line is the gpr attached, only valid for input/output gprs */
100 u8 usage;
101};
102
103enum {
104 GPR_TYPE_NULL = 0,
105 GPR_TYPE_IO,
106 GPR_TYPE_STATIC,
107 GPR_TYPE_DYNAMIC,
108 GPR_TYPE_CONTROL,
109 GPR_TYPE_CONSTANT
110};
111
112#define GPR_BASE 0x100
113#define OUTPUT_BASE 0x20
114
115#define A_GPR_BASE 0x400
116#define A_OUTPUT_BASE 0x60
117
118#define MAX_PATCHES_PAGES 32
119
120struct patch_manager {
121 void *patch[MAX_PATCHES_PAGES];
122 int current_pages;
123 struct dsp_rpatch rpatch;
124 struct dsp_gpr gpr[NUM_GPRS]; /* gpr usage table */
125 spinlock_t lock;
126 s16 ctrl_gpr[SOUND_MIXER_NRDEVICES][2];
127};
128
129#define PATCHES_PER_PAGE (PAGE_SIZE / sizeof(struct dsp_patch))
130
131#define PATCH(mgr, i) ((struct dsp_patch *) (mgr)->patch[(i) / PATCHES_PER_PAGE] + (i) % PATCHES_PER_PAGE)
132
133/* PCM volume control */
134#define TMP_PCM_L 0x100 //temp PCM L (after the vol control)
135#define TMP_PCM_R 0x101
136#define VOL_PCM_L 0x102 //vol PCM
137#define VOL_PCM_R 0x103
138
139/* Routing patch */
140#define TMP_AC_L 0x104 //tmp ac97 out
141#define TMP_AC_R 0x105
142#define TMP_REAR_L 0x106 //output - Temp Rear
143#define TMP_REAR_R 0x107
144#define TMP_DIGI_L 0x108 //output - Temp digital
145#define TMP_DIGI_R 0x109
146#define DSP_VOL_L 0x10a // main dsp volume
147#define DSP_VOL_R 0x10b
148
149/* hw inputs */
150#define PCM_IN_L 0x00
151#define PCM_IN_R 0x01
152
153#define PCM1_IN_L 0x04
154#define PCM1_IN_R 0x05
155//mutilchannel playback stream appear here:
156
157#define MULTI_FRONT_L 0x08
158#define MULTI_FRONT_R 0x09
159#define MULTI_REAR_L 0x0a
160#define MULTI_REAR_R 0x0b
161#define MULTI_CENTER 0x0c
162#define MULTI_LFE 0x0d
163
164#define AC97_IN_L 0x10
165#define AC97_IN_R 0x11
166#define SPDIF_CD_L 0x12
167#define SPDIF_CD_R 0x13
168
169/* hw outputs */
170#define AC97_FRONT_L 0x20
171#define AC97_FRONT_R 0x21
172#define DIGITAL_OUT_L 0x22
173#define DIGITAL_OUT_R 0x23
174#define DIGITAL_CENTER 0x24
175#define DIGITAL_LFE 0x25
176
177#define ANALOG_REAR_L 0x28
178#define ANALOG_REAR_R 0x29
179#define ADC_REC_L 0x2a
180#define ADC_REC_R 0x2b
181
182#define ANALOG_CENTER 0x31
183#define ANALOG_LFE 0x32
184
185
186#define INPUT_PATCH_START(patch, nm, ln, i) \
187do { \
188 patch = PATCH(mgr, patch_n); \
189 strcpy(patch->name, nm); \
190 patch->code_start = pc * 2; \
191 patch->input = (1<<(0x1f&ln)); \
192 patch->output= (1<<(0x1f&ln)); \
193 patch->id = i; \
194} while(0)
195
196#define INPUT_PATCH_END(patch) \
197do { \
198 patch->code_size = pc * 2 - patch->code_start; \
199 patch_n++; \
200} while(0)
201
202
203#define ROUTING_PATCH_START(patch, nm) \
204do { \
205 patch = &mgr->rpatch; \
206 strcpy(patch->name, nm); \
207 patch->code_start = pc * 2; \
208} while(0)
209
210#define ROUTING_PATCH_END(patch) \
211do { \
212 patch->code_size = pc * 2 - patch->code_start; \
213} while(0)
214
215#define CONNECT(input, output) set_bit(input, &rpatch->route[(output) - OUTPUT_BASE]);
216
217#define CONNECT_V(input, output) set_bit(input, &rpatch->route_v[(output) - OUTPUT_BASE]);
218
219#define OUTPUT_PATCH_START(patch, nm, ln, i) \
220do { \
221 patch = PATCH(mgr, patch_n); \
222 strcpy(patch->name, nm); \
223 patch->code_start = pc * 2; \
224 patch->input = (1<<(0x1f&ln)); \
225 patch->output= (1<<(0x1f&ln)); \
226 patch->id = i; \
227} while(0)
228
229#define OUTPUT_PATCH_END(patch) \
230do { \
231 patch->code_size = pc * 2 - patch->code_start; \
232 patch_n++; \
233} while(0)
234
235#define GET_OUTPUT_GPR(patch, g, ln) \
236do { \
237 mgr->gpr[(g) - GPR_BASE].type = GPR_TYPE_IO; \
238 mgr->gpr[(g) - GPR_BASE].usage++; \
239 mgr->gpr[(g) - GPR_BASE].line = ln; \
240 set_bit((g) - GPR_BASE, patch->gpr_used); \
241} while(0)
242
243#define GET_INPUT_GPR(patch, g, ln) \
244do { \
245 mgr->gpr[(g) - GPR_BASE].type = GPR_TYPE_IO; \
246 mgr->gpr[(g) - GPR_BASE].usage++; \
247 mgr->gpr[(g) - GPR_BASE].line = ln; \
248 set_bit((g) - GPR_BASE, patch->gpr_used); \
249 set_bit((g) - GPR_BASE, patch->gpr_input); \
250} while(0)
251
252#define GET_DYNAMIC_GPR(patch, g) \
253do { \
254 mgr->gpr[(g) - GPR_BASE].type = GPR_TYPE_DYNAMIC; \
255 mgr->gpr[(g) - GPR_BASE].usage++; \
256 set_bit((g) - GPR_BASE, patch->gpr_used); \
257} while(0)
258
259#define GET_CONTROL_GPR(patch, g, nm, a, b) \
260do { \
261 strcpy(mgr->gpr[(g) - GPR_BASE].name, nm); \
262 mgr->gpr[(g) - GPR_BASE].type = GPR_TYPE_CONTROL; \
263 mgr->gpr[(g) - GPR_BASE].usage++; \
264 mgr->gpr[(g) - GPR_BASE].min = a; \
265 mgr->gpr[(g) - GPR_BASE].max = b; \
266 sblive_writeptr(card, g, 0, b); \
267 set_bit((g) - GPR_BASE, patch->gpr_used); \
268} while(0)
269
270#endif /* _EFXMGR_H */
diff --git a/sound/oss/emu10k1/emuadxmg.c b/sound/oss/emu10k1/emuadxmg.c
deleted file mode 100644
index d7d2d4caf7ba..000000000000
--- a/sound/oss/emu10k1/emuadxmg.c
+++ /dev/null
@@ -1,104 +0,0 @@
1
2/*
3 **********************************************************************
4 * emuadxmg.c - Address space manager for emu10k1 driver
5 * Copyright 1999, 2000 Creative Labs, Inc.
6 *
7 **********************************************************************
8 *
9 * Date Author Summary of changes
10 * ---- ------ ------------------
11 * October 20, 1999 Bertrand Lee base code release
12 *
13 **********************************************************************
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this program; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
28 * USA.
29 *
30 **********************************************************************
31 */
32
33#include "hwaccess.h"
34
35/* Allocates emu address space */
36
37int emu10k1_addxmgr_alloc(u32 size, struct emu10k1_card *card)
38{
39 u16 *pagetable = card->emupagetable;
40 u16 index = 0;
41 u16 numpages;
42 unsigned long flags;
43
44 /* Convert bytes to pages */
45 numpages = (size / EMUPAGESIZE) + ((size % EMUPAGESIZE) ? 1 : 0);
46
47 spin_lock_irqsave(&card->lock, flags);
48
49 while (index < (MAXPAGES - 1)) {
50 if (pagetable[index] & 0x8000) {
51 /* This block of pages is in use, jump to the start of the next block. */
52 index += (pagetable[index] & 0x7fff);
53 } else {
54 /* Found free block */
55 if (pagetable[index] >= numpages) {
56
57 /* Block is large enough */
58
59 /* If free block is larger than the block requested
60 * then adjust the size of the block remaining */
61 if (pagetable[index] > numpages)
62 pagetable[index + numpages] = pagetable[index] - numpages;
63
64 pagetable[index] = (numpages | 0x8000); /* Mark block as used */
65
66 spin_unlock_irqrestore(&card->lock, flags);
67
68 return index;
69 } else {
70 /* Block too small, jump to the start of the next block */
71 index += pagetable[index];
72 }
73 }
74 }
75
76 spin_unlock_irqrestore(&card->lock, flags);
77
78 return -1;
79}
80
81/* Frees a previously allocated emu address space. */
82
83void emu10k1_addxmgr_free(struct emu10k1_card *card, int index)
84{
85 u16 *pagetable = card->emupagetable;
86 u16 origsize = 0;
87 unsigned long flags;
88
89 spin_lock_irqsave(&card->lock, flags);
90
91 if (pagetable[index] & 0x8000) {
92 /* Block is allocated - mark block as free */
93 origsize = pagetable[index] & 0x7fff;
94 pagetable[index] = origsize;
95
96 /* If next block is free, we concat both blocks */
97 if (!(pagetable[index + origsize] & 0x8000))
98 pagetable[index] += pagetable[index + origsize] & 0x7fff;
99 }
100
101 spin_unlock_irqrestore(&card->lock, flags);
102
103 return;
104}
diff --git a/sound/oss/emu10k1/hwaccess.c b/sound/oss/emu10k1/hwaccess.c
deleted file mode 100644
index 2dc16a841fa1..000000000000
--- a/sound/oss/emu10k1/hwaccess.c
+++ /dev/null
@@ -1,507 +0,0 @@
1/*
2 **********************************************************************
3 * hwaccess.c -- Hardware access layer
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 * December 9, 1999 Jon Taylor rewrote the I/O subsystem
12 *
13 **********************************************************************
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this program; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
28 * USA.
29 *
30 **********************************************************************
31 */
32
33#include <asm/io.h>
34
35#include "hwaccess.h"
36#include "8010.h"
37#include "icardmid.h"
38
39/*************************************************************************
40* Function : srToPitch *
41* Input : sampleRate - sampling rate *
42* Return : pitch value *
43* About : convert sampling rate to pitch *
44* Note : for 8010, sampling rate is at 48kHz, this function should *
45* be changed. *
46*************************************************************************/
47u32 srToPitch(u32 sampleRate)
48{
49 int i;
50
51 /* FIXME: These tables should be defined in a headerfile */
52 static u32 logMagTable[128] = {
53 0x00000, 0x02dfc, 0x05b9e, 0x088e6, 0x0b5d6, 0x0e26f, 0x10eb3, 0x13aa2,
54 0x1663f, 0x1918a, 0x1bc84, 0x1e72e, 0x2118b, 0x23b9a, 0x2655d, 0x28ed5,
55 0x2b803, 0x2e0e8, 0x30985, 0x331db, 0x359eb, 0x381b6, 0x3a93d, 0x3d081,
56 0x3f782, 0x41e42, 0x444c1, 0x46b01, 0x49101, 0x4b6c4, 0x4dc49, 0x50191,
57 0x5269e, 0x54b6f, 0x57006, 0x59463, 0x5b888, 0x5dc74, 0x60029, 0x623a7,
58 0x646ee, 0x66a00, 0x68cdd, 0x6af86, 0x6d1fa, 0x6f43c, 0x7164b, 0x73829,
59 0x759d4, 0x77b4f, 0x79c9a, 0x7bdb5, 0x7dea1, 0x7ff5e, 0x81fed, 0x8404e,
60 0x86082, 0x88089, 0x8a064, 0x8c014, 0x8df98, 0x8fef1, 0x91e20, 0x93d26,
61 0x95c01, 0x97ab4, 0x9993e, 0x9b79f, 0x9d5d9, 0x9f3ec, 0xa11d8, 0xa2f9d,
62 0xa4d3c, 0xa6ab5, 0xa8808, 0xaa537, 0xac241, 0xadf26, 0xafbe7, 0xb1885,
63 0xb3500, 0xb5157, 0xb6d8c, 0xb899f, 0xba58f, 0xbc15e, 0xbdd0c, 0xbf899,
64 0xc1404, 0xc2f50, 0xc4a7b, 0xc6587, 0xc8073, 0xc9b3f, 0xcb5ed, 0xcd07c,
65 0xceaec, 0xd053f, 0xd1f73, 0xd398a, 0xd5384, 0xd6d60, 0xd8720, 0xda0c3,
66 0xdba4a, 0xdd3b4, 0xded03, 0xe0636, 0xe1f4e, 0xe384a, 0xe512c, 0xe69f3,
67 0xe829f, 0xe9b31, 0xeb3a9, 0xecc08, 0xee44c, 0xefc78, 0xf148a, 0xf2c83,
68 0xf4463, 0xf5c2a, 0xf73da, 0xf8b71, 0xfa2f0, 0xfba57, 0xfd1a7, 0xfe8df
69 };
70
71 static char logSlopeTable[128] = {
72 0x5c, 0x5c, 0x5b, 0x5a, 0x5a, 0x59, 0x58, 0x58,
73 0x57, 0x56, 0x56, 0x55, 0x55, 0x54, 0x53, 0x53,
74 0x52, 0x52, 0x51, 0x51, 0x50, 0x50, 0x4f, 0x4f,
75 0x4e, 0x4d, 0x4d, 0x4d, 0x4c, 0x4c, 0x4b, 0x4b,
76 0x4a, 0x4a, 0x49, 0x49, 0x48, 0x48, 0x47, 0x47,
77 0x47, 0x46, 0x46, 0x45, 0x45, 0x45, 0x44, 0x44,
78 0x43, 0x43, 0x43, 0x42, 0x42, 0x42, 0x41, 0x41,
79 0x41, 0x40, 0x40, 0x40, 0x3f, 0x3f, 0x3f, 0x3e,
80 0x3e, 0x3e, 0x3d, 0x3d, 0x3d, 0x3c, 0x3c, 0x3c,
81 0x3b, 0x3b, 0x3b, 0x3b, 0x3a, 0x3a, 0x3a, 0x39,
82 0x39, 0x39, 0x39, 0x38, 0x38, 0x38, 0x38, 0x37,
83 0x37, 0x37, 0x37, 0x36, 0x36, 0x36, 0x36, 0x35,
84 0x35, 0x35, 0x35, 0x34, 0x34, 0x34, 0x34, 0x34,
85 0x33, 0x33, 0x33, 0x33, 0x32, 0x32, 0x32, 0x32,
86 0x32, 0x31, 0x31, 0x31, 0x31, 0x31, 0x30, 0x30,
87 0x30, 0x30, 0x30, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f
88 };
89
90 if (sampleRate == 0)
91 return 0; /* Bail out if no leading "1" */
92
93 sampleRate *= 11185; /* Scale 48000 to 0x20002380 */
94
95 for (i = 31; i > 0; i--) {
96 if (sampleRate & 0x80000000) { /* Detect leading "1" */
97 return (u32) (((s32) (i - 15) << 20) +
98 logMagTable[0x7f & (sampleRate >> 24)] +
99 (0x7f & (sampleRate >> 17)) * logSlopeTable[0x7f & (sampleRate >> 24)]);
100 }
101 sampleRate = sampleRate << 1;
102 }
103
104 DPF(2, "srToPitch: BUG!\n");
105 return 0; /* Should never reach this point */
106}
107
108/*******************************************
109* write/read PCI function 0 registers *
110********************************************/
111void emu10k1_writefn0(struct emu10k1_card *card, u32 reg, u32 data)
112{
113 unsigned long flags;
114
115 if (reg & 0xff000000) {
116 u32 mask;
117 u8 size, offset;
118
119 size = (reg >> 24) & 0x3f;
120 offset = (reg >> 16) & 0x1f;
121 mask = ((1 << size) - 1) << offset;
122 data = (data << offset) & mask;
123 reg &= 0x7f;
124
125 spin_lock_irqsave(&card->lock, flags);
126 data |= inl(card->iobase + reg) & ~mask;
127 outl(data, card->iobase + reg);
128 spin_unlock_irqrestore(&card->lock, flags);
129 } else {
130 spin_lock_irqsave(&card->lock, flags);
131 outl(data, card->iobase + reg);
132 spin_unlock_irqrestore(&card->lock, flags);
133 }
134
135 return;
136}
137
138#ifdef DBGEMU
139void emu10k1_writefn0_2(struct emu10k1_card *card, u32 reg, u32 data, int size)
140{
141 unsigned long flags;
142
143 spin_lock_irqsave(&card->lock, flags);
144
145 if (size == 32)
146 outl(data, card->iobase + (reg & 0x1F));
147 else if (size == 16)
148 outw(data, card->iobase + (reg & 0x1F));
149 else
150 outb(data, card->iobase + (reg & 0x1F));
151
152 spin_unlock_irqrestore(&card->lock, flags);
153
154 return;
155}
156#endif /* DBGEMU */
157
158u32 emu10k1_readfn0(struct emu10k1_card * card, u32 reg)
159{
160 u32 val;
161 unsigned long flags;
162
163 if (reg & 0xff000000) {
164 u32 mask;
165 u8 size, offset;
166
167 size = (reg >> 24) & 0x3f;
168 offset = (reg >> 16) & 0x1f;
169 mask = ((1 << size) - 1) << offset;
170 reg &= 0x7f;
171
172 spin_lock_irqsave(&card->lock, flags);
173 val = inl(card->iobase + reg);
174 spin_unlock_irqrestore(&card->lock, flags);
175
176 return (val & mask) >> offset;
177 } else {
178 spin_lock_irqsave(&card->lock, flags);
179 val = inl(card->iobase + reg);
180 spin_unlock_irqrestore(&card->lock, flags);
181 return val;
182 }
183}
184
185void emu10k1_timer_set(struct emu10k1_card * card, u16 data)
186{
187 unsigned long flags;
188
189 spin_lock_irqsave(&card->lock, flags);
190 outw(data & TIMER_RATE_MASK, card->iobase + TIMER);
191 spin_unlock_irqrestore(&card->lock, flags);
192}
193
194/************************************************************************
195* write/read Emu10k1 pointer-offset register set, accessed through *
196* the PTR and DATA registers *
197*************************************************************************/
198#define A_PTR_ADDRESS_MASK 0x0fff0000
199void sblive_writeptr(struct emu10k1_card *card, u32 reg, u32 channel, u32 data)
200{
201 u32 regptr;
202 unsigned long flags;
203
204 regptr = ((reg << 16) & A_PTR_ADDRESS_MASK) | (channel & PTR_CHANNELNUM_MASK);
205
206 if (reg & 0xff000000) {
207 u32 mask;
208 u8 size, offset;
209
210 size = (reg >> 24) & 0x3f;
211 offset = (reg >> 16) & 0x1f;
212 mask = ((1 << size) - 1) << offset;
213 data = (data << offset) & mask;
214
215 spin_lock_irqsave(&card->lock, flags);
216 outl(regptr, card->iobase + PTR);
217 data |= inl(card->iobase + DATA) & ~mask;
218 outl(data, card->iobase + DATA);
219 spin_unlock_irqrestore(&card->lock, flags);
220 } else {
221 spin_lock_irqsave(&card->lock, flags);
222 outl(regptr, card->iobase + PTR);
223 outl(data, card->iobase + DATA);
224 spin_unlock_irqrestore(&card->lock, flags);
225 }
226}
227
228/* ... : data, reg, ... , TAGLIST_END */
229void sblive_writeptr_tag(struct emu10k1_card *card, u32 channel, ...)
230{
231 va_list args;
232
233 unsigned long flags;
234 u32 reg;
235
236 va_start(args, channel);
237
238 spin_lock_irqsave(&card->lock, flags);
239 while ((reg = va_arg(args, u32)) != TAGLIST_END) {
240 u32 data = va_arg(args, u32);
241 u32 regptr = (((reg << 16) & A_PTR_ADDRESS_MASK)
242 | (channel & PTR_CHANNELNUM_MASK));
243 outl(regptr, card->iobase + PTR);
244 if (reg & 0xff000000) {
245 int size = (reg >> 24) & 0x3f;
246 int offset = (reg >> 16) & 0x1f;
247 u32 mask = ((1 << size) - 1) << offset;
248 data = (data << offset) & mask;
249
250 data |= inl(card->iobase + DATA) & ~mask;
251 }
252 outl(data, card->iobase + DATA);
253 }
254 spin_unlock_irqrestore(&card->lock, flags);
255
256 va_end(args);
257
258 return;
259}
260
261u32 sblive_readptr(struct emu10k1_card * card, u32 reg, u32 channel)
262{
263 u32 regptr, val;
264 unsigned long flags;
265
266 regptr = ((reg << 16) & A_PTR_ADDRESS_MASK) | (channel & PTR_CHANNELNUM_MASK);
267
268 if (reg & 0xff000000) {
269 u32 mask;
270 u8 size, offset;
271
272 size = (reg >> 24) & 0x3f;
273 offset = (reg >> 16) & 0x1f;
274 mask = ((1 << size) - 1) << offset;
275
276 spin_lock_irqsave(&card->lock, flags);
277 outl(regptr, card->iobase + PTR);
278 val = inl(card->iobase + DATA);
279 spin_unlock_irqrestore(&card->lock, flags);
280
281 return (val & mask) >> offset;
282 } else {
283 spin_lock_irqsave(&card->lock, flags);
284 outl(regptr, card->iobase + PTR);
285 val = inl(card->iobase + DATA);
286 spin_unlock_irqrestore(&card->lock, flags);
287
288 return val;
289 }
290}
291
292void emu10k1_irq_enable(struct emu10k1_card *card, u32 irq_mask)
293{
294 u32 val;
295 unsigned long flags;
296
297 DPF(2,"emu10k1_irq_enable()\n");
298
299 spin_lock_irqsave(&card->lock, flags);
300 val = inl(card->iobase + INTE) | irq_mask;
301 outl(val, card->iobase + INTE);
302 spin_unlock_irqrestore(&card->lock, flags);
303 return;
304}
305
306void emu10k1_irq_disable(struct emu10k1_card *card, u32 irq_mask)
307{
308 u32 val;
309 unsigned long flags;
310
311 DPF(2,"emu10k1_irq_disable()\n");
312
313 spin_lock_irqsave(&card->lock, flags);
314 val = inl(card->iobase + INTE) & ~irq_mask;
315 outl(val, card->iobase + INTE);
316 spin_unlock_irqrestore(&card->lock, flags);
317 return;
318}
319
320void emu10k1_clear_stop_on_loop(struct emu10k1_card *card, u32 voicenum)
321{
322 /* Voice interrupt */
323 if (voicenum >= 32)
324 sblive_writeptr(card, SOLEH | ((0x0100 | (voicenum - 32)) << 16), 0, 0);
325 else
326 sblive_writeptr(card, SOLEL | ((0x0100 | voicenum) << 16), 0, 0);
327
328 return;
329}
330
331static void sblive_wcwait(struct emu10k1_card *card, u32 wait)
332{
333 volatile unsigned uCount;
334 u32 newtime = 0, curtime;
335
336 curtime = emu10k1_readfn0(card, WC_SAMPLECOUNTER);
337 while (wait--) {
338 uCount = 0;
339 while (uCount++ < TIMEOUT) {
340 newtime = emu10k1_readfn0(card, WC_SAMPLECOUNTER);
341 if (newtime != curtime)
342 break;
343 }
344
345 if (uCount >= TIMEOUT)
346 break;
347
348 curtime = newtime;
349 }
350}
351
352u16 emu10k1_ac97_read(struct ac97_codec *codec, u8 reg)
353{
354 struct emu10k1_card *card = codec->private_data;
355 u16 data;
356 unsigned long flags;
357
358 spin_lock_irqsave(&card->lock, flags);
359
360 outb(reg, card->iobase + AC97ADDRESS);
361 data = inw(card->iobase + AC97DATA);
362
363 spin_unlock_irqrestore(&card->lock, flags);
364
365 return data;
366}
367
368void emu10k1_ac97_write(struct ac97_codec *codec, u8 reg, u16 value)
369{
370 struct emu10k1_card *card = codec->private_data;
371 unsigned long flags;
372
373 spin_lock_irqsave(&card->lock, flags);
374
375 outb(reg, card->iobase + AC97ADDRESS);
376 outw(value, card->iobase + AC97DATA);
377 outb( AC97_EXTENDED_ID, card->iobase + AC97ADDRESS);
378 spin_unlock_irqrestore(&card->lock, flags);
379}
380
381/*********************************************************
382* MPU access functions *
383**********************************************************/
384
385int emu10k1_mpu_write_data(struct emu10k1_card *card, u8 data)
386{
387 unsigned long flags;
388 int ret;
389
390 if (card->is_audigy) {
391 if ((sblive_readptr(card, A_MUSTAT,0) & MUSTAT_ORDYN) == 0) {
392 sblive_writeptr(card, A_MUDATA, 0, data);
393 ret = 0;
394 } else
395 ret = -1;
396 } else {
397 spin_lock_irqsave(&card->lock, flags);
398
399 if ((inb(card->iobase + MUSTAT) & MUSTAT_ORDYN) == 0) {
400 outb(data, card->iobase + MUDATA);
401 ret = 0;
402 } else
403 ret = -1;
404
405 spin_unlock_irqrestore(&card->lock, flags);
406 }
407
408 return ret;
409}
410
411int emu10k1_mpu_read_data(struct emu10k1_card *card, u8 * data)
412{
413 unsigned long flags;
414 int ret;
415
416 if (card->is_audigy) {
417 if ((sblive_readptr(card, A_MUSTAT,0) & MUSTAT_IRDYN) == 0) {
418 *data = sblive_readptr(card, A_MUDATA,0);
419 ret = 0;
420 } else
421 ret = -1;
422 } else {
423 spin_lock_irqsave(&card->lock, flags);
424
425 if ((inb(card->iobase + MUSTAT) & MUSTAT_IRDYN) == 0) {
426 *data = inb(card->iobase + MUDATA);
427 ret = 0;
428 } else
429 ret = -1;
430
431 spin_unlock_irqrestore(&card->lock, flags);
432 }
433
434 return ret;
435}
436
437int emu10k1_mpu_reset(struct emu10k1_card *card)
438{
439 u8 status;
440 unsigned long flags;
441
442 DPF(2, "emu10k1_mpu_reset()\n");
443 if (card->is_audigy) {
444 if (card->mpuacqcount == 0) {
445 sblive_writeptr(card, A_MUCMD, 0, MUCMD_RESET);
446 sblive_wcwait(card, 8);
447 sblive_writeptr(card, A_MUCMD, 0, MUCMD_RESET);
448 sblive_wcwait(card, 8);
449 sblive_writeptr(card, A_MUCMD, 0, MUCMD_ENTERUARTMODE);
450 sblive_wcwait(card, 8);
451 status = sblive_readptr(card, A_MUDATA, 0);
452 if (status == 0xfe)
453 return 0;
454 else
455 return -1;
456 }
457
458 return 0;
459 } else {
460 if (card->mpuacqcount == 0) {
461 spin_lock_irqsave(&card->lock, flags);
462 outb(MUCMD_RESET, card->iobase + MUCMD);
463 spin_unlock_irqrestore(&card->lock, flags);
464
465 sblive_wcwait(card, 8);
466
467 spin_lock_irqsave(&card->lock, flags);
468 outb(MUCMD_RESET, card->iobase + MUCMD);
469 spin_unlock_irqrestore(&card->lock, flags);
470
471 sblive_wcwait(card, 8);
472
473 spin_lock_irqsave(&card->lock, flags);
474 outb(MUCMD_ENTERUARTMODE, card->iobase + MUCMD);
475 spin_unlock_irqrestore(&card->lock, flags);
476
477 sblive_wcwait(card, 8);
478
479 spin_lock_irqsave(&card->lock, flags);
480 status = inb(card->iobase + MUDATA);
481 spin_unlock_irqrestore(&card->lock, flags);
482
483 if (status == 0xfe)
484 return 0;
485 else
486 return -1;
487 }
488
489 return 0;
490 }
491}
492
493int emu10k1_mpu_acquire(struct emu10k1_card *card)
494{
495 /* FIXME: This should be a macro */
496 ++card->mpuacqcount;
497
498 return 0;
499}
500
501int emu10k1_mpu_release(struct emu10k1_card *card)
502{
503 /* FIXME: this should be a macro */
504 --card->mpuacqcount;
505
506 return 0;
507}
diff --git a/sound/oss/emu10k1/hwaccess.h b/sound/oss/emu10k1/hwaccess.h
deleted file mode 100644
index 85e27bda694b..000000000000
--- a/sound/oss/emu10k1/hwaccess.h
+++ /dev/null
@@ -1,247 +0,0 @@
1/*
2 **********************************************************************
3 * hwaccess.h
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#ifndef _HWACCESS_H
33#define _HWACCESS_H
34
35#include <linux/fs.h>
36#include <linux/sound.h>
37#include <linux/soundcard.h>
38#include <linux/ac97_codec.h>
39#include <linux/pci.h>
40#include <linux/slab.h>
41#include <linux/sched.h>
42#include <asm/io.h>
43
44#include "efxmgr.h"
45#include "passthrough.h"
46#include "midi.h"
47
48#define EMUPAGESIZE 4096 /* don't change */
49#define NUM_G 64 /* use all channels */
50#define NUM_FXSENDS 4 /* don't change */
51/* setting this to other than a power of two may break some applications */
52#define MAXBUFSIZE 65536
53#define MAXPAGES 8192
54#define BUFMAXPAGES (MAXBUFSIZE / PAGE_SIZE)
55
56#define FLAGS_AVAILABLE 0x0001
57#define FLAGS_READY 0x0002
58
59struct memhandle
60{
61 dma_addr_t dma_handle;
62 void *addr;
63 u32 size;
64};
65
66#define DEBUG_LEVEL 2
67
68#ifdef EMU10K1_DEBUG
69# define DPD(level,x,y...) do {if(level <= DEBUG_LEVEL) printk( KERN_NOTICE "emu10k1: %s: %d: " x , __FILE__ , __LINE__ , y );} while(0)
70# define DPF(level,x) do {if(level <= DEBUG_LEVEL) printk( KERN_NOTICE "emu10k1: %s: %d: " x , __FILE__ , __LINE__ );} while(0)
71#else
72# define DPD(level,x,y...) do { } while (0) /* not debugging: nothing */
73# define DPF(level,x) do { } while (0)
74#endif /* EMU10K1_DEBUG */
75
76#define ERROR() DPF(1,"error\n")
77
78/* DATA STRUCTURES */
79
80struct emu10k1_waveout
81{
82 u32 send_routing[3];
83 // audigy only:
84 u32 send_routing2[3];
85
86 u32 send_dcba[3];
87 // audigy only:
88 u32 send_hgfe[3];
89};
90#define ROUTE_PCM 0
91#define ROUTE_PT 1
92#define ROUTE_PCM1 2
93
94#define SEND_MONO 0
95#define SEND_LEFT 1
96#define SEND_RIGHT 2
97
98struct emu10k1_wavein
99{
100 struct wiinst *ac97;
101 struct wiinst *mic;
102 struct wiinst *fx;
103
104 u8 recsrc;
105 u32 fxwc;
106};
107
108#define CMD_READ 1
109#define CMD_WRITE 2
110
111struct mixer_private_ioctl {
112 u32 cmd;
113 u32 val[90];
114};
115
116/* bogus ioctls numbers to escape from OSS mixer limitations */
117#define CMD_WRITEFN0 _IOW('D', 0, struct mixer_private_ioctl)
118#define CMD_READFN0 _IOR('D', 1, struct mixer_private_ioctl)
119#define CMD_WRITEPTR _IOW('D', 2, struct mixer_private_ioctl)
120#define CMD_READPTR _IOR('D', 3, struct mixer_private_ioctl)
121#define CMD_SETRECSRC _IOW('D', 4, struct mixer_private_ioctl)
122#define CMD_GETRECSRC _IOR('D', 5, struct mixer_private_ioctl)
123#define CMD_GETVOICEPARAM _IOR('D', 6, struct mixer_private_ioctl)
124#define CMD_SETVOICEPARAM _IOW('D', 7, struct mixer_private_ioctl)
125#define CMD_GETPATCH _IOR('D', 8, struct mixer_private_ioctl)
126#define CMD_GETGPR _IOR('D', 9, struct mixer_private_ioctl)
127#define CMD_GETCTLGPR _IOR('D', 10, struct mixer_private_ioctl)
128#define CMD_SETPATCH _IOW('D', 11, struct mixer_private_ioctl)
129#define CMD_SETGPR _IOW('D', 12, struct mixer_private_ioctl)
130#define CMD_SETCTLGPR _IOW('D', 13, struct mixer_private_ioctl)
131#define CMD_SETGPOUT _IOW('D', 14, struct mixer_private_ioctl)
132#define CMD_GETGPR2OSS _IOR('D', 15, struct mixer_private_ioctl)
133#define CMD_SETGPR2OSS _IOW('D', 16, struct mixer_private_ioctl)
134#define CMD_SETMCH_FX _IOW('D', 17, struct mixer_private_ioctl)
135#define CMD_SETPASSTHROUGH _IOW('D', 18, struct mixer_private_ioctl)
136#define CMD_PRIVATE3_VERSION _IOW('D', 19, struct mixer_private_ioctl)
137#define CMD_AC97_BOOST _IOW('D', 20, struct mixer_private_ioctl)
138
139//up this number when breaking compatibility
140#define PRIVATE3_VERSION 2
141
142struct emu10k1_card
143{
144 struct list_head list;
145
146 struct memhandle virtualpagetable;
147 struct memhandle tankmem;
148 struct memhandle silentpage;
149
150 spinlock_t lock;
151
152 u8 voicetable[NUM_G];
153 u16 emupagetable[MAXPAGES];
154
155 struct list_head timers;
156 u16 timer_delay;
157 spinlock_t timer_lock;
158
159 struct pci_dev *pci_dev;
160 unsigned long iobase;
161 unsigned long length;
162 unsigned short model;
163 unsigned int irq;
164
165 int audio_dev;
166 int audio_dev1;
167 int midi_dev;
168#ifdef EMU10K1_SEQUENCER
169 int seq_dev;
170 struct emu10k1_mididevice *seq_mididev;
171#endif
172
173 struct ac97_codec *ac97;
174 int ac97_supported_mixers;
175 int ac97_stereo_mixers;
176
177 /* Number of first fx voice for multichannel output */
178 u8 mchannel_fx;
179 struct emu10k1_waveout waveout;
180 struct emu10k1_wavein wavein;
181 struct emu10k1_mpuout *mpuout;
182 struct emu10k1_mpuin *mpuin;
183
184 struct mutex open_sem;
185 mode_t open_mode;
186 wait_queue_head_t open_wait;
187
188 u32 mpuacqcount; // Mpu acquire count
189 u32 has_toslink; // TOSLink detection
190
191 u8 chiprev; /* Chip revision */
192 u8 is_audigy;
193 u8 is_aps;
194
195 struct patch_manager mgr;
196 struct pt_data pt;
197};
198
199int emu10k1_addxmgr_alloc(u32, struct emu10k1_card *);
200void emu10k1_addxmgr_free(struct emu10k1_card *, int);
201
202int emu10k1_find_control_gpr(struct patch_manager *, const char *, const char *);
203void emu10k1_set_control_gpr(struct emu10k1_card *, int , s32, int );
204
205void emu10k1_set_volume_gpr(struct emu10k1_card *, int, s32, int);
206
207
208#define VOL_6BIT 0x40
209#define VOL_5BIT 0x20
210#define VOL_4BIT 0x10
211
212#define TIMEOUT 16384
213
214u32 srToPitch(u32);
215
216extern struct list_head emu10k1_devs;
217
218/* Hardware Abstraction Layer access functions */
219
220void emu10k1_writefn0(struct emu10k1_card *, u32, u32);
221void emu10k1_writefn0_2(struct emu10k1_card *, u32, u32, int);
222u32 emu10k1_readfn0(struct emu10k1_card *, u32);
223
224void emu10k1_timer_set(struct emu10k1_card *, u16);
225
226void sblive_writeptr(struct emu10k1_card *, u32, u32, u32);
227void sblive_writeptr_tag(struct emu10k1_card *, u32, ...);
228#define TAGLIST_END 0
229
230u32 sblive_readptr(struct emu10k1_card *, u32 , u32 );
231
232void emu10k1_irq_enable(struct emu10k1_card *, u32);
233void emu10k1_irq_disable(struct emu10k1_card *, u32);
234void emu10k1_clear_stop_on_loop(struct emu10k1_card *, u32);
235
236/* AC97 Codec register access function */
237u16 emu10k1_ac97_read(struct ac97_codec *, u8);
238void emu10k1_ac97_write(struct ac97_codec *, u8, u16);
239
240/* MPU access function*/
241int emu10k1_mpu_write_data(struct emu10k1_card *, u8);
242int emu10k1_mpu_read_data(struct emu10k1_card *, u8 *);
243int emu10k1_mpu_reset(struct emu10k1_card *);
244int emu10k1_mpu_acquire(struct emu10k1_card *);
245int emu10k1_mpu_release(struct emu10k1_card *);
246
247#endif /* _HWACCESS_H */
diff --git a/sound/oss/emu10k1/icardmid.h b/sound/oss/emu10k1/icardmid.h
deleted file mode 100644
index 6a6ef419401f..000000000000
--- a/sound/oss/emu10k1/icardmid.h
+++ /dev/null
@@ -1,163 +0,0 @@
1/*
2 **********************************************************************
3 * isblive_mid.h
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#ifndef _ICARDMIDI_H
33#define _ICARDMIDI_H
34
35/* MIDI defines */
36#define MIDI_DATA_FIRST 0x00
37#define MIDI_DATA_LAST 0x7F
38#define MIDI_STATUS_FIRST 0x80
39#define MIDI_STATUS_LAST 0xFF
40
41/* Channel status bytes */
42#define MIDI_STATUS_CHANNEL_FIRST 0x80
43#define MIDI_STATUS_CHANNEL_LAST 0xE0
44#define MIDI_STATUS_CHANNEL_MASK 0xF0
45
46/* Channel voice messages */
47#define MIDI_VOICE_NOTE_OFF 0x80
48#define MIDI_VOICE_NOTE_ON 0x90
49#define MIDI_VOICE_POLY_PRESSURE 0xA0
50#define MIDI_VOICE_CONTROL_CHANGE 0xB0
51#define MIDI_VOICE_PROGRAM_CHANGE 0xC0
52#define MIDI_VOICE_CHANNEL_PRESSURE 0xD0
53#define MIDI_VOICE_PITCH_BEND 0xE0
54
55/* Channel mode messages */
56#define MIDI_MODE_CHANNEL MIDI_VOICE_CONTROL_CHANGE
57
58/* System status bytes */
59#define MIDI_STATUS_SYSTEM_FIRST 0xF0
60#define MIDI_STATUS_SYSTEM_LAST 0xFF
61
62/* System exclusive messages */
63#define MIDI_SYSEX_BEGIN 0xF0
64#define MIDI_SYSEX_EOX 0xF7
65
66/* System common messages */
67#define MIDI_COMMON_TCQF 0xF1 /* Time code quarter frame */
68#define MIDI_COMMON_SONG_POSITION 0xF2
69#define MIDI_COMMON_SONG_SELECT 0xF3
70#define MIDI_COMMON_UNDEFINED_F4 0xF4
71#define MIDI_COMMON_UNDEFINED_F5 0xF5
72#define MIDI_COMMON_TUNE_REQUEST 0xF6
73
74/* System real-time messages */
75#define MIDI_RTIME_TIMING_CLOCK 0xF8
76#define MIDI_RTIME_UNDEFINED_F9 0xF9
77#define MIDI_RTIME_START 0xFA
78#define MIDI_RTIME_CONTINUE 0xFB
79#define MIDI_RTIME_STOP 0xFC
80#define MIDI_RTIME_UNDEFINED_FD 0xFD
81#define MIDI_RTIME_ACTIVE_SENSING 0xFE
82#define MIDI_RTIME_SYSTEM_RESET 0xFF
83
84/* Flags for flags parm of midiOutCachePatches(), midiOutCacheDrumPatches() */
85#define MIDI_CACHE_ALL 1
86#define MIDI_CACHE_BESTFIT 2
87#define MIDI_CACHE_QUERY 3
88#define MIDI_UNCACHE 4
89
90/* Event declarations for MPU IRQ Callbacks */
91#define ICARDMIDI_INLONGDATA 0x00000001 /* MIM_LONGDATA */
92#define ICARDMIDI_INLONGERROR 0x00000002 /* MIM_LONGERROR */
93#define ICARDMIDI_OUTLONGDATA 0x00000004 /* MOM_DONE for MPU OUT buffer */
94#define ICARDMIDI_INDATA 0x00000010 /* MIM_DATA */
95#define ICARDMIDI_INDATAERROR 0x00000020 /* MIM_ERROR */
96
97/* Declaration for flags in CARDMIDIBUFFERHDR */
98/* Make it the same as MHDR_DONE, MHDR_INQUEUE in mmsystem.h */
99#define MIDIBUF_DONE 0x00000001
100#define MIDIBUF_INQUEUE 0x00000004
101
102/* Declaration for msg parameter in midiCallbackFn */
103#define ICARDMIDI_OUTBUFFEROK 0x00000001
104#define ICARDMIDI_INMIDIOK 0x00000002
105
106/* Declaration for technology in struct midi_caps */
107#define MT_MIDIPORT 0x00000001 /* In original MIDIOUTCAPS structure */
108#define MT_FMSYNTH 0x00000004 /* In original MIDIOUTCAPS structure */
109#define MT_AWESYNTH 0x00001000
110#define MT_PCISYNTH 0x00002000
111#define MT_PCISYNTH64 0x00004000
112#define CARDMIDI_AWEMASK 0x0000F000
113
114enum LocalErrorCode
115{
116 CTSTATUS_NOTENABLED = 0x7000,
117 CTSTATUS_READY,
118 CTSTATUS_BUSY,
119 CTSTATUS_DATAAVAIL,
120 CTSTATUS_NODATA,
121 CTSTATUS_NEXT_BYTE
122};
123
124/* MIDI data block header */
125struct midi_hdr
126{
127 u8 *reserved; /* Pointer to original locked data block */
128 u32 bufferlength; /* Length of data in data block */
129 u32 bytesrecorded; /* Used for input only */
130 u32 user; /* For client's use */
131 u32 flags; /* Assorted flags (see defines) */
132 struct list_head list; /* Reserved for driver */
133 u8 *data; /* Second copy of first pointer */
134};
135
136/* Enumeration for SetControl */
137enum
138{
139 MIDIOBJVOLUME = 0x1,
140 MIDIQUERYACTIVEINST
141};
142
143struct midi_queue
144{
145 struct midi_queue *next;
146 u32 qtype; /* 0 = short message, 1 = long data */
147 u32 length;
148 u32 sizeLeft;
149 u8 *midibyte;
150 unsigned long refdata;
151};
152
153struct midi_openinfo
154{
155 u32 cbsize;
156 u32 flags;
157 unsigned long refdata;
158 u32 streamid;
159};
160
161int emu10k1_midi_callback(unsigned long , unsigned long, unsigned long *);
162
163#endif /* _ICARDMIDI_H */
diff --git a/sound/oss/emu10k1/icardwav.h b/sound/oss/emu10k1/icardwav.h
deleted file mode 100644
index 25be40928b4d..000000000000
--- a/sound/oss/emu10k1/icardwav.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 **********************************************************************
3 * icardwav.h
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#ifndef _ICARDWAV_H
33#define _ICARDWAV_H
34
35struct wave_format
36{
37 int id;
38 int samplingrate;
39 u8 bitsperchannel;
40 u8 channels; /* 1 = Mono, 2 = Stereo, 3, ... = Multichannel */
41 u8 bytesperchannel;
42 u8 bytespervoicesample;
43 u8 bytespersample;
44 int bytespersec;
45 u8 passthrough;
46};
47
48/* emu10k1_wave states */
49#define WAVE_STATE_OPEN 0x01
50#define WAVE_STATE_STARTED 0x02
51#define WAVE_STATE_CLOSED 0x04
52
53#endif /* _ICARDWAV_H */
diff --git a/sound/oss/emu10k1/irqmgr.c b/sound/oss/emu10k1/irqmgr.c
deleted file mode 100644
index fb2ce638f01c..000000000000
--- a/sound/oss/emu10k1/irqmgr.c
+++ /dev/null
@@ -1,113 +0,0 @@
1/*
2 **********************************************************************
3 * irqmgr.c - IRQ manager for emu10k1 driver
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#include "hwaccess.h"
33#include "8010.h"
34#include "cardmi.h"
35#include "cardmo.h"
36#include "irqmgr.h"
37
38/* Interrupt handler */
39
40irqreturn_t emu10k1_interrupt(int irq, void *dev_id)
41{
42 struct emu10k1_card *card = (struct emu10k1_card *) dev_id;
43 u32 irqstatus, irqstatus_tmp;
44 int handled = 0;
45
46 DPD(4, "emu10k1_interrupt called, irq = %u\n", irq);
47
48 /*
49 ** NOTE :
50 ** We do a 'while loop' here cos on certain machines, with both
51 ** playback and recording going on at the same time, IRQs will
52 ** stop coming in after a while. Checking IPND indeed shows that
53 ** there are interrupts pending but the PIC says no IRQs pending.
54 ** I suspect that some boards need edge-triggered IRQs but are not
55 ** getting that condition if we don't completely clear the IPND
56 ** (make sure no more interrupts are pending).
57 ** - Eric
58 */
59
60 while ((irqstatus = inl(card->iobase + IPR))) {
61 DPD(4, "irq status %#x\n", irqstatus);
62
63 irqstatus_tmp = irqstatus;
64
65 if (irqstatus & IRQTYPE_TIMER) {
66 emu10k1_timer_irqhandler(card);
67 irqstatus &= ~IRQTYPE_TIMER;
68 }
69
70 if (irqstatus & IRQTYPE_DSP) {
71 emu10k1_dsp_irqhandler(card);
72 irqstatus &= ~IRQTYPE_DSP;
73 }
74
75 if (irqstatus & IRQTYPE_MPUIN) {
76 emu10k1_mpuin_irqhandler(card);
77 irqstatus &= ~IRQTYPE_MPUIN;
78 }
79
80 if (irqstatus & IRQTYPE_MPUOUT) {
81 emu10k1_mpuout_irqhandler(card);
82 irqstatus &= ~IRQTYPE_MPUOUT;
83 }
84
85 if (irqstatus & IPR_MUTE) {
86 emu10k1_mute_irqhandler(card);
87 irqstatus &=~IPR_MUTE;
88 }
89
90 if (irqstatus & IPR_VOLINCR) {
91 emu10k1_volincr_irqhandler(card);
92 irqstatus &=~IPR_VOLINCR;
93 }
94
95 if (irqstatus & IPR_VOLDECR) {
96 emu10k1_voldecr_irqhandler(card);
97 irqstatus &=~IPR_VOLDECR;
98 }
99
100 if (irqstatus){
101 printk(KERN_ERR "emu10k1: Warning, unhandled interrupt: %#08x\n", irqstatus);
102 //make sure any interrupts we don't handle are disabled:
103 emu10k1_irq_disable(card, ~(INTE_MIDIRXENABLE | INTE_MIDITXENABLE | INTE_INTERVALTIMERENB |
104 INTE_VOLDECRENABLE | INTE_VOLINCRENABLE | INTE_MUTEENABLE |
105 INTE_FXDSPENABLE));
106 }
107
108 /* acknowledge interrupt */
109 outl(irqstatus_tmp, card->iobase + IPR);
110 handled = 1;
111 }
112 return IRQ_RETVAL(handled);
113}
diff --git a/sound/oss/emu10k1/irqmgr.h b/sound/oss/emu10k1/irqmgr.h
deleted file mode 100644
index 7e7c9ca1098c..000000000000
--- a/sound/oss/emu10k1/irqmgr.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 **********************************************************************
3 * irq.h
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#ifndef _IRQ_H
33#define _IRQ_H
34
35/* EMU Irq Types */
36#define IRQTYPE_PCIBUSERROR IPR_PCIERROR
37#define IRQTYPE_MIXERBUTTON (IPR_VOLINCR | IPR_VOLDECR | IPR_MUTE)
38#define IRQTYPE_VOICE (IPR_CHANNELLOOP | IPR_CHANNELNUMBERMASK)
39#define IRQTYPE_RECORD (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL | IPR_MICBUFFULL | IPR_MICBUFHALFFULL | IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL)
40#define IRQTYPE_MPUOUT (IPR_MIDITRANSBUFEMPTY | A_IPR_MIDITRANSBUFEMPTY2)
41#define IRQTYPE_MPUIN (IPR_MIDIRECVBUFEMPTY | A_IPR_MIDIRECVBUFEMPTY2)
42#define IRQTYPE_TIMER IPR_INTERVALTIMER
43#define IRQTYPE_SPDIF (IPR_GPSPDIFSTATUSCHANGE | IPR_CDROMSTATUSCHANGE)
44#define IRQTYPE_DSP IPR_FXDSP
45
46void emu10k1_timer_irqhandler(struct emu10k1_card *);
47void emu10k1_dsp_irqhandler(struct emu10k1_card *);
48void emu10k1_mute_irqhandler(struct emu10k1_card *);
49void emu10k1_volincr_irqhandler(struct emu10k1_card *);
50void emu10k1_voldecr_irqhandler(struct emu10k1_card *);
51
52#endif /* _IRQ_H */
diff --git a/sound/oss/emu10k1/main.c b/sound/oss/emu10k1/main.c
deleted file mode 100644
index 5058411b7524..000000000000
--- a/sound/oss/emu10k1/main.c
+++ /dev/null
@@ -1,1471 +0,0 @@
1 /*
2 **********************************************************************
3 * main.c - Creative EMU10K1 audio driver
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 * November 2, 1999 Alan Cox cleaned up stuff
12 *
13 **********************************************************************
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this program; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
28 * USA.
29 *
30 **********************************************************************
31 *
32 * Supported devices:
33 * /dev/dsp: Standard /dev/dsp device, OSS-compatible
34 * /dev/dsp1: Routes to rear speakers only
35 * /dev/mixer: Standard /dev/mixer device, OSS-compatible
36 * /dev/midi: Raw MIDI UART device, mostly OSS-compatible
37 * /dev/sequencer: Sequencer Interface (requires sound.o)
38 *
39 * Revision history:
40 * 0.1 beta Initial release
41 * 0.2 Lowered initial mixer vol. Improved on stuttering wave playback. Added MIDI UART support.
42 * 0.3 Fixed mixer routing bug, added APS, joystick support.
43 * 0.4 Added rear-channel, SPDIF support.
44 * 0.5 Source cleanup, SMP fixes, multiopen support, 64 bit arch fixes,
45 * moved bh's to tasklets, moved to the new PCI driver initialization style.
46 * 0.6 Make use of pci_alloc_consistent, improve compatibility layer for 2.2 kernels,
47 * code reorganization and cleanup.
48 * 0.7 Support for the Emu-APS. Bug fixes for voice cache setup, mmaped sound + poll().
49 * Support for setting external TRAM size.
50 * 0.8 Make use of the kernel ac97 interface. Support for a dsp patch manager.
51 * 0.9 Re-enables rear speakers volume controls
52 * 0.10 Initializes rear speaker volume.
53 * Dynamic patch storage allocation.
54 * New private ioctls to change control gpr values.
55 * Enable volume control interrupts.
56 * By default enable dsp routes to digital out.
57 * 0.11 Fixed fx / 4 problem.
58 * 0.12 Implemented mmaped for recording.
59 * Fixed bug: not unreserving mmaped buffer pages.
60 * IRQ handler cleanup.
61 * 0.13 Fixed problem with dsp1
62 * Simplified dsp patch writing (inside the driver)
63 * Fixed several bugs found by the Stanford tools
64 * 0.14 New control gpr to oss mixer mapping feature (Chris Purnell)
65 * Added AC3 Passthrough Support (Juha Yrjola)
66 * Added Support for 5.1 cards (digital out and the third analog out)
67 * 0.15 Added Sequencer Support (Daniel Mack)
68 * Support for multichannel pcm playback (Eduard Hasenleithner)
69 * 0.16 Mixer improvements, added old treble/bass support (Daniel Bertrand)
70 * Small code format cleanup.
71 * Deadlock bug fix for emu10k1_volxxx_irqhandler().
72 * 0.17 Fix for mixer SOUND_MIXER_INFO ioctl.
73 * Fix for HIGHMEM machines (emu10k1 can only do 31 bit bus master)
74 * midi poll initial implementation.
75 * Small mixer fixes/cleanups.
76 * Improved support for 5.1 cards.
77 * 0.18 Fix for possible leak in pci_alloc_consistent()
78 * Cleaned up poll() functions (audio and midi). Don't start input.
79 * Restrict DMA pages used to 512Mib range.
80 * New AC97_BOOST mixer ioctl.
81 * 0.19a Added Support for Audigy Cards
82 * Real fix for kernel with highmem support (cast dma_handle to u32).
83 * Fix recording buffering parameters calculation.
84 * Use unsigned long for variables in bit ops.
85 * 0.20a Fixed recording startup
86 * Fixed timer rate setting (it's a 16-bit register)
87 * 0.21 Converted code to use pci_name() instead of accessing slot_name
88 * directly (Eugene Teo)
89 *********************************************************************/
90
91/* These are only included once per module */
92#include <linux/module.h>
93#include <linux/slab.h>
94#include <linux/init.h>
95#include <linux/delay.h>
96#include <linux/proc_fs.h>
97#include <linux/dma-mapping.h>
98
99#include "hwaccess.h"
100#include "8010.h"
101#include "efxmgr.h"
102#include "cardwo.h"
103#include "cardwi.h"
104#include "cardmo.h"
105#include "cardmi.h"
106#include "recmgr.h"
107#include "ecard.h"
108
109
110#ifdef EMU10K1_SEQUENCER
111#define MIDI_SYNTH_NAME "EMU10K1 MIDI"
112#define MIDI_SYNTH_CAPS SYNTH_CAP_INPUT
113
114#include "../sound_config.h"
115#include "../midi_synth.h"
116
117/* this should be in dev_table.h */
118#define SNDCARD_EMU10K1 46
119#endif
120
121
122/* the emu10k1 _seems_ to only supports 29 bit (512MiB) bit bus master */
123#define EMU10K1_DMA_MASK DMA_29BIT_MASK /* DMA buffer mask for pci_alloc_consist */
124
125#ifndef PCI_VENDOR_ID_CREATIVE
126#define PCI_VENDOR_ID_CREATIVE 0x1102
127#endif
128
129#ifndef PCI_DEVICE_ID_CREATIVE_EMU10K1
130#define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002
131#endif
132#ifndef PCI_DEVICE_ID_CREATIVE_AUDIGY
133#define PCI_DEVICE_ID_CREATIVE_AUDIGY 0x0004
134#endif
135
136#define EMU_APS_SUBID 0x40011102
137
138enum {
139 EMU10K1 = 0,
140 AUDIGY,
141};
142
143static char *card_names[] __devinitdata = {
144 "EMU10K1",
145 "Audigy",
146};
147
148static struct pci_device_id emu10k1_pci_tbl[] = {
149 {PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_EMU10K1,
150 PCI_ANY_ID, PCI_ANY_ID, 0, 0, EMU10K1},
151 {PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_AUDIGY,
152 PCI_ANY_ID, PCI_ANY_ID, 0, 0, AUDIGY},
153 {0,}
154};
155
156MODULE_DEVICE_TABLE(pci, emu10k1_pci_tbl);
157
158/* Global var instantiation */
159
160LIST_HEAD(emu10k1_devs);
161
162extern struct file_operations emu10k1_audio_fops;
163extern struct file_operations emu10k1_mixer_fops;
164extern struct file_operations emu10k1_midi_fops;
165
166#ifdef EMU10K1_SEQUENCER
167static struct midi_operations emu10k1_midi_operations;
168#endif
169
170extern irqreturn_t emu10k1_interrupt(int, void *);
171
172static int __devinit emu10k1_audio_init(struct emu10k1_card *card)
173{
174 /* Assign default playback voice parameters */
175 if (card->is_audigy)
176 card->mchannel_fx = 0;
177 else
178 card->mchannel_fx = 8;
179
180
181 if (card->is_audigy) {
182 /* mono voice */
183 card->waveout.send_dcba[SEND_MONO] = 0xffffffff;
184 card->waveout.send_hgfe[SEND_MONO] = 0x0000ffff;
185
186 /* stereo voice */
187 /* left */
188 card->waveout.send_dcba[SEND_LEFT] = 0x00ff00ff;
189 card->waveout.send_hgfe[SEND_LEFT] = 0x00007f7f;
190 /* right */
191 card->waveout.send_dcba[SEND_RIGHT] = 0xff00ff00;
192 card->waveout.send_hgfe[SEND_RIGHT] = 0x00007f7f;
193
194 card->waveout.send_routing[ROUTE_PCM] = 0x03020100; // Regular pcm
195 card->waveout.send_routing2[ROUTE_PCM] = 0x07060504;
196
197 card->waveout.send_routing[ROUTE_PT] = 0x3f3f3d3c; // Passthrough
198 card->waveout.send_routing2[ROUTE_PT] = 0x3f3f3f3f;
199
200 card->waveout.send_routing[ROUTE_PCM1] = 0x03020100; // Spare
201 card->waveout.send_routing2[ROUTE_PCM1] = 0x07060404;
202
203 } else {
204 /* mono voice */
205 card->waveout.send_dcba[SEND_MONO] = 0x0000ffff;
206
207 /* stereo voice */
208 /* left */
209 card->waveout.send_dcba[SEND_LEFT] = 0x000000ff;
210 /* right */
211 card->waveout.send_dcba[SEND_RIGHT] = 0x0000ff00;
212
213 card->waveout.send_routing[ROUTE_PCM] = 0x3210; // pcm
214 card->waveout.send_routing[ROUTE_PT] = 0x3210; // passthrough
215 card->waveout.send_routing[ROUTE_PCM1] = 0x7654; // /dev/dsp1
216 }
217
218 /* Assign default recording parameters */
219 /* FIXME */
220 if (card->is_aps)
221 card->wavein.recsrc = WAVERECORD_FX;
222 else
223 card->wavein.recsrc = WAVERECORD_AC97;
224
225 card->wavein.fxwc = 0x0003;
226 return 0;
227}
228
229static void emu10k1_audio_cleanup(struct emu10k1_card *card)
230{
231}
232
233static int __devinit emu10k1_register_devices(struct emu10k1_card *card)
234{
235 card->audio_dev = register_sound_dsp(&emu10k1_audio_fops, -1);
236 if (card->audio_dev < 0) {
237 printk(KERN_ERR "emu10k1: cannot register first audio device!\n");
238 goto err_dev;
239 }
240
241 card->audio_dev1 = register_sound_dsp(&emu10k1_audio_fops, -1);
242 if (card->audio_dev1 < 0) {
243 printk(KERN_ERR "emu10k1: cannot register second audio device!\n");
244 goto err_dev1;
245 }
246
247 card->ac97->dev_mixer = register_sound_mixer(&emu10k1_mixer_fops, -1);
248 if (card->ac97->dev_mixer < 0) {
249 printk(KERN_ERR "emu10k1: cannot register mixer device\n");
250 goto err_mixer;
251 }
252
253 card->midi_dev = register_sound_midi(&emu10k1_midi_fops, -1);
254 if (card->midi_dev < 0) {
255 printk(KERN_ERR "emu10k1: cannot register midi device!\n");
256 goto err_midi;
257 }
258
259#ifdef EMU10K1_SEQUENCER
260 card->seq_dev = sound_alloc_mididev();
261 if (card->seq_dev == -1)
262 printk(KERN_WARNING "emu10k1: unable to register sequencer device!");
263 else {
264 std_midi_synth.midi_dev = card->seq_dev;
265 midi_devs[card->seq_dev] =
266 (struct midi_operations *)
267 kmalloc(sizeof(struct midi_operations), GFP_KERNEL);
268
269 if (midi_devs[card->seq_dev] == NULL) {
270 printk(KERN_ERR "emu10k1: unable to allocate memory!");
271 sound_unload_mididev(card->seq_dev);
272 card->seq_dev = -1;
273 /* return without error */
274 } else {
275 memcpy((char *)midi_devs[card->seq_dev],
276 (char *)&emu10k1_midi_operations,
277 sizeof(struct midi_operations));
278 midi_devs[card->seq_dev]->devc = card;
279 sequencer_init();
280 card->seq_mididev = NULL;
281 }
282 }
283#endif
284 return 0;
285
286err_midi:
287 unregister_sound_mixer(card->ac97->dev_mixer);
288err_mixer:
289 unregister_sound_dsp(card->audio_dev);
290err_dev1:
291 unregister_sound_dsp(card->audio_dev);
292err_dev:
293 return -ENODEV;
294}
295
296static void emu10k1_unregister_devices(struct emu10k1_card *card)
297{
298#ifdef EMU10K1_SEQUENCER
299 if (card->seq_dev > -1) {
300 kfree(midi_devs[card->seq_dev]);
301 midi_devs[card->seq_dev] = NULL;
302 sound_unload_mididev(card->seq_dev);
303 card->seq_dev = -1;
304 }
305#endif
306
307 unregister_sound_midi(card->midi_dev);
308 unregister_sound_mixer(card->ac97->dev_mixer);
309 unregister_sound_dsp(card->audio_dev1);
310 unregister_sound_dsp(card->audio_dev);
311}
312
313static int emu10k1_info_proc (char *page, char **start, off_t off,
314 int count, int *eof, void *data)
315{
316 struct emu10k1_card *card = data;
317 int len = 0;
318
319 if (card == NULL)
320 return -ENODEV;
321
322 len += sprintf (page + len, "Driver Version : %s\n", DRIVER_VERSION);
323 len += sprintf (page + len, "Card type : %s\n", card->is_aps ? "Aps" : (card->is_audigy ? "Audigy" : "Emu10k1"));
324 len += sprintf (page + len, "Revision : %d\n", card->chiprev);
325 len += sprintf (page + len, "Model : %#06x\n", card->model);
326 len += sprintf (page + len, "IO : %#06lx-%#06lx\n", card->iobase, card->iobase + card->length - 1);
327 len += sprintf (page + len, "IRQ : %d\n\n", card->irq);
328
329 len += sprintf (page + len, "Registered /dev Entries:\n");
330 len += sprintf (page + len, "/dev/dsp%d\n", card->audio_dev / 16);
331 len += sprintf (page + len, "/dev/dsp%d\n", card->audio_dev1 / 16);
332 len += sprintf (page + len, "/dev/mixer%d\n", card->ac97->dev_mixer / 16);
333 len += sprintf (page + len, "/dev/midi%d\n", card->midi_dev / 16);
334
335#ifdef EMU10K1_SEQUENCER
336 len += sprintf (page + len, "/dev/sequencer\n");
337#endif
338
339 return len;
340}
341
342static int __devinit emu10k1_proc_init(struct emu10k1_card *card)
343{
344 char s[48];
345
346 if (!proc_mkdir ("driver/emu10k1", NULL)) {
347 printk(KERN_ERR "emu10k1: unable to create proc directory driver/emu10k1\n");
348 goto err_out;
349 }
350
351 sprintf(s, "driver/emu10k1/%s", pci_name(card->pci_dev));
352 if (!proc_mkdir (s, NULL)) {
353 printk(KERN_ERR "emu10k1: unable to create proc directory %s\n", s);
354 goto err_emu10k1_proc;
355 }
356
357 sprintf(s, "driver/emu10k1/%s/info", pci_name(card->pci_dev));
358 if (!create_proc_read_entry (s, 0, NULL, emu10k1_info_proc, card)) {
359 printk(KERN_ERR "emu10k1: unable to create proc entry %s\n", s);
360 goto err_dev_proc;
361 }
362
363 if (!card->is_aps) {
364 sprintf(s, "driver/emu10k1/%s/ac97", pci_name(card->pci_dev));
365 if (!create_proc_read_entry (s, 0, NULL, ac97_read_proc, card->ac97)) {
366 printk(KERN_ERR "emu10k1: unable to create proc entry %s\n", s);
367 goto err_proc_ac97;
368 }
369 }
370
371 return 0;
372
373err_proc_ac97:
374 sprintf(s, "driver/emu10k1/%s/info", pci_name(card->pci_dev));
375 remove_proc_entry(s, NULL);
376
377err_dev_proc:
378 sprintf(s, "driver/emu10k1/%s", pci_name(card->pci_dev));
379 remove_proc_entry(s, NULL);
380
381err_emu10k1_proc:
382 remove_proc_entry("driver/emu10k1", NULL);
383
384err_out:
385 return -EIO;
386}
387
388static void emu10k1_proc_cleanup(struct emu10k1_card *card)
389{
390 char s[48];
391
392 if (!card->is_aps) {
393 sprintf(s, "driver/emu10k1/%s/ac97", pci_name(card->pci_dev));
394 remove_proc_entry(s, NULL);
395 }
396
397 sprintf(s, "driver/emu10k1/%s/info", pci_name(card->pci_dev));
398 remove_proc_entry(s, NULL);
399
400 sprintf(s, "driver/emu10k1/%s", pci_name(card->pci_dev));
401 remove_proc_entry(s, NULL);
402
403 remove_proc_entry("driver/emu10k1", NULL);
404}
405
406static int __devinit emu10k1_mixer_init(struct emu10k1_card *card)
407{
408 struct ac97_codec *codec = ac97_alloc_codec();
409
410 if(codec == NULL)
411 {
412 printk(KERN_ERR "emu10k1: cannot allocate mixer\n");
413 return -EIO;
414 }
415 card->ac97 = codec;
416 card->ac97->private_data = card;
417
418 if (!card->is_aps) {
419 card->ac97->id = 0;
420 card->ac97->codec_read = emu10k1_ac97_read;
421 card->ac97->codec_write = emu10k1_ac97_write;
422
423 if (ac97_probe_codec (card->ac97) == 0) {
424 printk(KERN_ERR "emu10k1: unable to probe AC97 codec\n");
425 goto err_out;
426 }
427 /* 5.1: Enable the additional AC97 Slots and unmute extra channels on AC97 codec */
428 if (codec->codec_read(codec, AC97_EXTENDED_ID) & 0x0080){
429 printk(KERN_INFO "emu10k1: SBLive! 5.1 card detected\n");
430 sblive_writeptr(card, AC97SLOT, 0, AC97SLOT_CNTR | AC97SLOT_LFE);
431 codec->codec_write(codec, AC97_SURROUND_MASTER, 0x0);
432 }
433
434 // Force 5bit:
435 //card->ac97->bit_resolution=5;
436
437 /* these will store the original values and never be modified */
438 card->ac97_supported_mixers = card->ac97->supported_mixers;
439 card->ac97_stereo_mixers = card->ac97->stereo_mixers;
440 }
441
442 return 0;
443
444 err_out:
445 ac97_release_codec(card->ac97);
446 return -EIO;
447}
448
449static void emu10k1_mixer_cleanup(struct emu10k1_card *card)
450{
451 ac97_release_codec(card->ac97);
452}
453
454static int __devinit emu10k1_midi_init(struct emu10k1_card *card)
455{
456 int ret;
457
458 card->mpuout = kzalloc(sizeof(struct emu10k1_mpuout), GFP_KERNEL);
459 if (card->mpuout == NULL) {
460 printk(KERN_WARNING "emu10k1: Unable to allocate emu10k1_mpuout: out of memory\n");
461 ret = -ENOMEM;
462 goto err_out1;
463 }
464
465 card->mpuout->intr = 1;
466 card->mpuout->status = FLAGS_AVAILABLE;
467 card->mpuout->state = CARDMIDIOUT_STATE_DEFAULT;
468
469 tasklet_init(&card->mpuout->tasklet, emu10k1_mpuout_bh, (unsigned long) card);
470
471 spin_lock_init(&card->mpuout->lock);
472
473 card->mpuin = kzalloc(sizeof(struct emu10k1_mpuin), GFP_KERNEL);
474 if (card->mpuin == NULL) {
475 printk(KERN_WARNING "emu10k1: Unable to allocate emu10k1_mpuin: out of memory\n");
476 ret = -ENOMEM;
477 goto err_out2;
478 }
479
480 card->mpuin->status = FLAGS_AVAILABLE;
481
482 tasklet_init(&card->mpuin->tasklet, emu10k1_mpuin_bh, (unsigned long) card->mpuin);
483
484 spin_lock_init(&card->mpuin->lock);
485
486 /* Reset the MPU port */
487 if (emu10k1_mpu_reset(card) < 0) {
488 ERROR();
489 ret = -EIO;
490 goto err_out3;
491 }
492
493 return 0;
494
495err_out3:
496 kfree(card->mpuin);
497err_out2:
498 kfree(card->mpuout);
499err_out1:
500 return ret;
501}
502
503static void emu10k1_midi_cleanup(struct emu10k1_card *card)
504{
505 tasklet_kill(&card->mpuout->tasklet);
506 kfree(card->mpuout);
507
508 tasklet_kill(&card->mpuin->tasklet);
509 kfree(card->mpuin);
510}
511
512static void __devinit voice_init(struct emu10k1_card *card)
513{
514 int i;
515
516 for (i = 0; i < NUM_G; i++)
517 card->voicetable[i] = VOICE_USAGE_FREE;
518}
519
520static void __devinit timer_init(struct emu10k1_card *card)
521{
522 INIT_LIST_HEAD(&card->timers);
523 card->timer_delay = TIMER_STOPPED;
524 spin_lock_init(&card->timer_lock);
525}
526
527static void __devinit addxmgr_init(struct emu10k1_card *card)
528{
529 u32 count;
530
531 for (count = 0; count < MAXPAGES; count++)
532 card->emupagetable[count] = 0;
533
534 /* Mark first page as used */
535 /* This page is reserved by the driver */
536 card->emupagetable[0] = 0x8001;
537 card->emupagetable[1] = MAXPAGES - 1;
538}
539
540static void fx_cleanup(struct patch_manager *mgr)
541{
542 int i;
543 for(i = 0; i < mgr->current_pages; i++)
544 free_page((unsigned long) mgr->patch[i]);
545}
546
547static int __devinit fx_init(struct emu10k1_card *card)
548{
549 struct patch_manager *mgr = &card->mgr;
550 struct dsp_patch *patch;
551 struct dsp_rpatch *rpatch;
552 s32 left, right;
553 int i;
554 u32 pc = 0;
555 u32 patch_n=0;
556 struct emu_efx_info_t emu_efx_info[2]=
557 {{ 20, 10, 0x400, 0x100, 0x20 },
558 { 24, 12, 0x600, 0x400, 0x60 },
559 };
560
561
562 for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
563 mgr->ctrl_gpr[i][0] = -1;
564 mgr->ctrl_gpr[i][1] = -1;
565 }
566
567
568 if (card->is_audigy)
569 mgr->current_pages = (2 + PATCHES_PER_PAGE - 1) / PATCHES_PER_PAGE;
570 else
571 /* !! The number below must equal the number of patches, currently 11 !! */
572 mgr->current_pages = (11 + PATCHES_PER_PAGE - 1) / PATCHES_PER_PAGE;
573
574 for (i = 0; i < mgr->current_pages; i++) {
575 mgr->patch[i] = (void *)__get_free_page(GFP_KERNEL);
576 if (mgr->patch[i] == NULL) {
577 mgr->current_pages = i;
578 fx_cleanup(mgr);
579 return -ENOMEM;
580 }
581 memset(mgr->patch[i], 0, PAGE_SIZE);
582 }
583
584 if (card->is_audigy) {
585 for (i = 0; i < 1024; i++)
586 OP(0xf, 0x0c0, 0x0c0, 0x0cf, 0x0c0);
587
588 for (i = 0; i < 512 ; i++)
589 sblive_writeptr(card, A_GPR_BASE+i,0,0);
590
591 pc=0;
592
593 //Pcm input volume
594 OP(0, 0x402, 0x0c0, 0x406, 0x000);
595 OP(0, 0x403, 0x0c0, 0x407, 0x001);
596
597 //CD-Digital input Volume
598 OP(0, 0x404, 0x0c0, 0x40d, 0x42);
599 OP(0, 0x405, 0x0c0, 0x40f, 0x43);
600
601 // CD + PCM
602 OP(6, 0x400, 0x0c0, 0x402, 0x404);
603 OP(6, 0x401, 0x0c0, 0x403, 0x405);
604
605 // Front Output + Master Volume
606 OP(0, 0x68, 0x0c0, 0x408, 0x400);
607 OP(0, 0x69, 0x0c0, 0x409, 0x401);
608
609 // Add-in analog inputs for other speakers
610 OP(6, 0x400, 0x40, 0x400, 0xc0);
611 OP(6, 0x401, 0x41, 0x401, 0xc0);
612
613 // Digital Front + Master Volume
614 OP(0, 0x60, 0x0c0, 0x408, 0x400);
615 OP(0, 0x61, 0x0c0, 0x409, 0x401);
616
617 // Rear Output + Rear Volume
618 OP(0, 0x06e, 0x0c0, 0x419, 0x400);
619 OP(0, 0x06f, 0x0c0, 0x41a, 0x401);
620
621 // Digital Rear Output + Rear Volume
622 OP(0, 0x066, 0x0c0, 0x419, 0x400);
623 OP(0, 0x067, 0x0c0, 0x41a, 0x401);
624
625 // Audigy Drive, Headphone out
626 OP(6, 0x64, 0x0c0, 0x0c0, 0x400);
627 OP(6, 0x65, 0x0c0, 0x0c0, 0x401);
628
629 // ac97 Recording
630 OP(6, 0x76, 0x0c0, 0x0c0, 0x40);
631 OP(6, 0x77, 0x0c0, 0x0c0, 0x41);
632
633 // Center = sub = Left/2 + Right/2
634 OP(0xe, 0x400, 0x401, 0xcd, 0x400);
635
636 // center/sub Volume (master)
637 OP(0, 0x06a, 0x0c0, 0x408, 0x400);
638 OP(0, 0x06b, 0x0c0, 0x409, 0x400);
639
640 // Digital center/sub Volume (master)
641 OP(0, 0x062, 0x0c0, 0x408, 0x400);
642 OP(0, 0x063, 0x0c0, 0x409, 0x400);
643
644 ROUTING_PATCH_START(rpatch, "Routing");
645 ROUTING_PATCH_END(rpatch);
646
647 /* delimiter patch */
648 patch = PATCH(mgr, patch_n);
649 patch->code_size = 0;
650
651
652 sblive_writeptr(card, 0x53, 0, 0);
653 } else {
654 for (i = 0; i < 512 ; i++)
655 OP(6, 0x40, 0x40, 0x40, 0x40);
656
657 for (i = 0; i < 256; i++)
658 sblive_writeptr_tag(card, 0,
659 FXGPREGBASE + i, 0,
660 TANKMEMADDRREGBASE + i, 0,
661 TAGLIST_END);
662
663
664 pc = 0;
665
666 //first free GPR = 0x11b
667
668
669 /* FX volume correction and Volume control*/
670 INPUT_PATCH_START(patch, "Pcm L vol", 0x0, 0);
671 GET_OUTPUT_GPR(patch, 0x100, 0x0);
672 GET_CONTROL_GPR(patch, 0x106, "Vol", 0, 0x7fffffff);
673 GET_DYNAMIC_GPR(patch, 0x112);
674
675 OP(4, 0x112, 0x40, PCM_IN_L, 0x44); //*4
676 OP(0, 0x100, 0x040, 0x112, 0x106); //*vol
677 INPUT_PATCH_END(patch);
678
679
680 INPUT_PATCH_START(patch, "Pcm R vol", 0x1, 0);
681 GET_OUTPUT_GPR(patch, 0x101, 0x1);
682 GET_CONTROL_GPR(patch, 0x107, "Vol", 0, 0x7fffffff);
683 GET_DYNAMIC_GPR(patch, 0x112);
684
685 OP(4, 0x112, 0x40, PCM_IN_R, 0x44);
686 OP(0, 0x101, 0x040, 0x112, 0x107);
687
688 INPUT_PATCH_END(patch);
689
690
691 // CD-Digital In Volume control
692 INPUT_PATCH_START(patch, "CD-Digital Vol L", 0x12, 0);
693 GET_OUTPUT_GPR(patch, 0x10c, 0x12);
694 GET_CONTROL_GPR(patch, 0x10d, "Vol", 0, 0x7fffffff);
695
696 OP(0, 0x10c, 0x040, SPDIF_CD_L, 0x10d);
697 INPUT_PATCH_END(patch);
698
699 INPUT_PATCH_START(patch, "CD-Digital Vol R", 0x13, 0);
700 GET_OUTPUT_GPR(patch, 0x10e, 0x13);
701 GET_CONTROL_GPR(patch, 0x10f, "Vol", 0, 0x7fffffff);
702
703 OP(0, 0x10e, 0x040, SPDIF_CD_R, 0x10f);
704 INPUT_PATCH_END(patch);
705
706 //Volume Correction for Multi-channel Inputs
707 INPUT_PATCH_START(patch, "Multi-Channel Gain", 0x08, 0);
708 patch->input=patch->output=0x3F00;
709
710 GET_OUTPUT_GPR(patch, 0x113, MULTI_FRONT_L);
711 GET_OUTPUT_GPR(patch, 0x114, MULTI_FRONT_R);
712 GET_OUTPUT_GPR(patch, 0x115, MULTI_REAR_L);
713 GET_OUTPUT_GPR(patch, 0x116, MULTI_REAR_R);
714 GET_OUTPUT_GPR(patch, 0x117, MULTI_CENTER);
715 GET_OUTPUT_GPR(patch, 0x118, MULTI_LFE);
716
717 OP(4, 0x113, 0x40, MULTI_FRONT_L, 0x44);
718 OP(4, 0x114, 0x40, MULTI_FRONT_R, 0x44);
719 OP(4, 0x115, 0x40, MULTI_REAR_L, 0x44);
720 OP(4, 0x116, 0x40, MULTI_REAR_R, 0x44);
721 OP(4, 0x117, 0x40, MULTI_CENTER, 0x44);
722 OP(4, 0x118, 0x40, MULTI_LFE, 0x44);
723
724 INPUT_PATCH_END(patch);
725
726
727 //Routing patch start
728 ROUTING_PATCH_START(rpatch, "Routing");
729 GET_INPUT_GPR(rpatch, 0x100, 0x0);
730 GET_INPUT_GPR(rpatch, 0x101, 0x1);
731 GET_INPUT_GPR(rpatch, 0x10c, 0x12);
732 GET_INPUT_GPR(rpatch, 0x10e, 0x13);
733 GET_INPUT_GPR(rpatch, 0x113, MULTI_FRONT_L);
734 GET_INPUT_GPR(rpatch, 0x114, MULTI_FRONT_R);
735 GET_INPUT_GPR(rpatch, 0x115, MULTI_REAR_L);
736 GET_INPUT_GPR(rpatch, 0x116, MULTI_REAR_R);
737 GET_INPUT_GPR(rpatch, 0x117, MULTI_CENTER);
738 GET_INPUT_GPR(rpatch, 0x118, MULTI_LFE);
739
740 GET_DYNAMIC_GPR(rpatch, 0x102);
741 GET_DYNAMIC_GPR(rpatch, 0x103);
742
743 GET_OUTPUT_GPR(rpatch, 0x104, 0x8);
744 GET_OUTPUT_GPR(rpatch, 0x105, 0x9);
745 GET_OUTPUT_GPR(rpatch, 0x10a, 0x2);
746 GET_OUTPUT_GPR(rpatch, 0x10b, 0x3);
747
748
749 /* input buffer */
750 OP(6, 0x102, AC97_IN_L, 0x40, 0x40);
751 OP(6, 0x103, AC97_IN_R, 0x40, 0x40);
752
753
754 /* Digital In + PCM + MULTI_FRONT-> AC97 out (front speakers)*/
755 OP(6, AC97_FRONT_L, 0x100, 0x10c, 0x113);
756
757 CONNECT(MULTI_FRONT_L, AC97_FRONT_L);
758 CONNECT(PCM_IN_L, AC97_FRONT_L);
759 CONNECT(SPDIF_CD_L, AC97_FRONT_L);
760
761 OP(6, AC97_FRONT_R, 0x101, 0x10e, 0x114);
762
763 CONNECT(MULTI_FRONT_R, AC97_FRONT_R);
764 CONNECT(PCM_IN_R, AC97_FRONT_R);
765 CONNECT(SPDIF_CD_R, AC97_FRONT_R);
766
767 /* Digital In + PCM + AC97 In + PCM1 + MULTI_REAR --> Rear Channel */
768 OP(6, 0x104, PCM1_IN_L, 0x100, 0x115);
769 OP(6, 0x104, 0x104, 0x10c, 0x102);
770
771 CONNECT(MULTI_REAR_L, ANALOG_REAR_L);
772 CONNECT(AC97_IN_L, ANALOG_REAR_L);
773 CONNECT(PCM_IN_L, ANALOG_REAR_L);
774 CONNECT(SPDIF_CD_L, ANALOG_REAR_L);
775 CONNECT(PCM1_IN_L, ANALOG_REAR_L);
776
777 OP(6, 0x105, PCM1_IN_R, 0x101, 0x116);
778 OP(6, 0x105, 0x105, 0x10e, 0x103);
779
780 CONNECT(MULTI_REAR_R, ANALOG_REAR_R);
781 CONNECT(AC97_IN_R, ANALOG_REAR_R);
782 CONNECT(PCM_IN_R, ANALOG_REAR_R);
783 CONNECT(SPDIF_CD_R, ANALOG_REAR_R);
784 CONNECT(PCM1_IN_R, ANALOG_REAR_R);
785
786 /* Digital In + PCM + AC97 In + MULTI_FRONT --> Digital out */
787 OP(6, 0x10b, 0x100, 0x102, 0x10c);
788 OP(6, 0x10b, 0x10b, 0x113, 0x40);
789
790 CONNECT(MULTI_FRONT_L, DIGITAL_OUT_L);
791 CONNECT(PCM_IN_L, DIGITAL_OUT_L);
792 CONNECT(AC97_IN_L, DIGITAL_OUT_L);
793 CONNECT(SPDIF_CD_L, DIGITAL_OUT_L);
794
795 OP(6, 0x10a, 0x101, 0x103, 0x10e);
796 OP(6, 0x10b, 0x10b, 0x114, 0x40);
797
798 CONNECT(MULTI_FRONT_R, DIGITAL_OUT_R);
799 CONNECT(PCM_IN_R, DIGITAL_OUT_R);
800 CONNECT(AC97_IN_R, DIGITAL_OUT_R);
801 CONNECT(SPDIF_CD_R, DIGITAL_OUT_R);
802
803 /* AC97 In --> ADC Recording Buffer */
804 OP(6, ADC_REC_L, 0x102, 0x40, 0x40);
805
806 CONNECT(AC97_IN_L, ADC_REC_L);
807
808 OP(6, ADC_REC_R, 0x103, 0x40, 0x40);
809
810 CONNECT(AC97_IN_R, ADC_REC_R);
811
812
813 /* fx12:Analog-Center */
814 OP(6, ANALOG_CENTER, 0x117, 0x40, 0x40);
815 CONNECT(MULTI_CENTER, ANALOG_CENTER);
816
817 /* fx11:Analog-LFE */
818 OP(6, ANALOG_LFE, 0x118, 0x40, 0x40);
819 CONNECT(MULTI_LFE, ANALOG_LFE);
820
821 /* fx12:Digital-Center */
822 OP(6, DIGITAL_CENTER, 0x117, 0x40, 0x40);
823 CONNECT(MULTI_CENTER, DIGITAL_CENTER);
824
825 /* fx11:Analog-LFE */
826 OP(6, DIGITAL_LFE, 0x118, 0x40, 0x40);
827 CONNECT(MULTI_LFE, DIGITAL_LFE);
828
829 ROUTING_PATCH_END(rpatch);
830
831
832 // Rear volume control
833 OUTPUT_PATCH_START(patch, "Vol Rear L", 0x8, 0);
834 GET_INPUT_GPR(patch, 0x104, 0x8);
835 GET_CONTROL_GPR(patch, 0x119, "Vol", 0, 0x7fffffff);
836
837 OP(0, ANALOG_REAR_L, 0x040, 0x104, 0x119);
838 OUTPUT_PATCH_END(patch);
839
840 OUTPUT_PATCH_START(patch, "Vol Rear R", 0x9, 0);
841 GET_INPUT_GPR(patch, 0x105, 0x9);
842 GET_CONTROL_GPR(patch, 0x11a, "Vol", 0, 0x7fffffff);
843
844 OP(0, ANALOG_REAR_R, 0x040, 0x105, 0x11a);
845 OUTPUT_PATCH_END(patch);
846
847
848 //Master volume control on front-digital
849 OUTPUT_PATCH_START(patch, "Vol Master L", 0x2, 1);
850 GET_INPUT_GPR(patch, 0x10a, 0x2);
851 GET_CONTROL_GPR(patch, 0x108, "Vol", 0, 0x7fffffff);
852
853 OP(0, DIGITAL_OUT_L, 0x040, 0x10a, 0x108);
854 OUTPUT_PATCH_END(patch);
855
856
857 OUTPUT_PATCH_START(patch, "Vol Master R", 0x3, 1);
858 GET_INPUT_GPR(patch, 0x10b, 0x3);
859 GET_CONTROL_GPR(patch, 0x109, "Vol", 0, 0x7fffffff);
860
861 OP(0, DIGITAL_OUT_R, 0x040, 0x10b, 0x109);
862 OUTPUT_PATCH_END(patch);
863
864
865 /* delimiter patch */
866 patch = PATCH(mgr, patch_n);
867 patch->code_size = 0;
868
869
870 sblive_writeptr(card, DBG, 0, 0);
871 }
872
873 spin_lock_init(&mgr->lock);
874
875 // Set up Volume controls, try to keep this the same for both Audigy and Live
876
877 //Master volume
878 mgr->ctrl_gpr[SOUND_MIXER_VOLUME][0] = 8;
879 mgr->ctrl_gpr[SOUND_MIXER_VOLUME][1] = 9;
880
881 left = card->ac97->mixer_state[SOUND_MIXER_VOLUME] & 0xff;
882 right = (card->ac97->mixer_state[SOUND_MIXER_VOLUME] >> 8) & 0xff;
883
884 emu10k1_set_volume_gpr(card, 8, left, 1 << card->ac97->bit_resolution);
885 emu10k1_set_volume_gpr(card, 9, right, 1 << card->ac97->bit_resolution);
886
887 //Rear volume
888 mgr->ctrl_gpr[ SOUND_MIXER_OGAIN ][0] = 0x19;
889 mgr->ctrl_gpr[ SOUND_MIXER_OGAIN ][1] = 0x1a;
890
891 left = right = 67;
892 card->ac97->mixer_state[SOUND_MIXER_OGAIN] = (right << 8) | left;
893
894 card->ac97->supported_mixers |= SOUND_MASK_OGAIN;
895 card->ac97->stereo_mixers |= SOUND_MASK_OGAIN;
896
897 emu10k1_set_volume_gpr(card, 0x19, left, VOL_5BIT);
898 emu10k1_set_volume_gpr(card, 0x1a, right, VOL_5BIT);
899
900 //PCM Volume
901 mgr->ctrl_gpr[SOUND_MIXER_PCM][0] = 6;
902 mgr->ctrl_gpr[SOUND_MIXER_PCM][1] = 7;
903
904 left = card->ac97->mixer_state[SOUND_MIXER_PCM] & 0xff;
905 right = (card->ac97->mixer_state[SOUND_MIXER_PCM] >> 8) & 0xff;
906
907 emu10k1_set_volume_gpr(card, 6, left, VOL_5BIT);
908 emu10k1_set_volume_gpr(card, 7, right, VOL_5BIT);
909
910 //CD-Digital Volume
911 mgr->ctrl_gpr[SOUND_MIXER_DIGITAL1][0] = 0xd;
912 mgr->ctrl_gpr[SOUND_MIXER_DIGITAL1][1] = 0xf;
913
914 left = right = 67;
915 card->ac97->mixer_state[SOUND_MIXER_DIGITAL1] = (right << 8) | left;
916
917 card->ac97->supported_mixers |= SOUND_MASK_DIGITAL1;
918 card->ac97->stereo_mixers |= SOUND_MASK_DIGITAL1;
919
920 emu10k1_set_volume_gpr(card, 0xd, left, VOL_5BIT);
921 emu10k1_set_volume_gpr(card, 0xf, right, VOL_5BIT);
922
923
924 //hard wire the ac97's pcm, pcm volume is done above using dsp code.
925 if (card->is_audigy)
926 //for Audigy, we mute it and use the philips 6 channel DAC instead
927 emu10k1_ac97_write(card->ac97, 0x18, 0x8000);
928 else
929 //For the Live we hardwire it to full volume
930 emu10k1_ac97_write(card->ac97, 0x18, 0x0);
931
932 //remove it from the ac97_codec's control
933 card->ac97_supported_mixers &= ~SOUND_MASK_PCM;
934 card->ac97_stereo_mixers &= ~SOUND_MASK_PCM;
935
936 //set Igain to 0dB by default, maybe consider hardwiring it here.
937 emu10k1_ac97_write(card->ac97, AC97_RECORD_GAIN, 0x0000);
938 card->ac97->mixer_state[SOUND_MIXER_IGAIN] = 0x101;
939
940 return 0;
941}
942
943static int __devinit hw_init(struct emu10k1_card *card)
944{
945 int nCh;
946 u32 pagecount; /* tmp */
947 int ret;
948
949 /* Disable audio and lock cache */
950 emu10k1_writefn0(card, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE);
951
952 /* Reset recording buffers */
953 sblive_writeptr_tag(card, 0,
954 MICBS, ADCBS_BUFSIZE_NONE,
955 MICBA, 0,
956 FXBS, ADCBS_BUFSIZE_NONE,
957 FXBA, 0,
958 ADCBS, ADCBS_BUFSIZE_NONE,
959 ADCBA, 0,
960 TAGLIST_END);
961
962 /* Disable channel interrupt */
963 emu10k1_writefn0(card, INTE, 0);
964 sblive_writeptr_tag(card, 0,
965 CLIEL, 0,
966 CLIEH, 0,
967 SOLEL, 0,
968 SOLEH, 0,
969 TAGLIST_END);
970
971 if (card->is_audigy) {
972 sblive_writeptr_tag(card,0,
973 0x5e,0xf00,
974 0x5f,0x3,
975 TAGLIST_END);
976 }
977
978 /* Init envelope engine */
979 for (nCh = 0; nCh < NUM_G; nCh++) {
980 sblive_writeptr_tag(card, nCh,
981 DCYSUSV, 0,
982 IP, 0,
983 VTFT, 0xffff,
984 CVCF, 0xffff,
985 PTRX, 0,
986 //CPF, 0,
987 CCR, 0,
988
989 PSST, 0,
990 DSL, 0x10,
991 CCCA, 0,
992 Z1, 0,
993 Z2, 0,
994 FXRT, 0xd01c0000,
995
996 ATKHLDM, 0,
997 DCYSUSM, 0,
998 IFATN, 0xffff,
999 PEFE, 0,
1000 FMMOD, 0,
1001 TREMFRQ, 24, /* 1 Hz */
1002 FM2FRQ2, 24, /* 1 Hz */
1003 TEMPENV, 0,
1004
1005 /*** These are last so OFF prevents writing ***/
1006 LFOVAL2, 0,
1007 LFOVAL1, 0,
1008 ATKHLDV, 0,
1009 ENVVOL, 0,
1010 ENVVAL, 0,
1011 TAGLIST_END);
1012 sblive_writeptr(card, CPF, nCh, 0);
1013 /*
1014 Audigy FXRT initialization
1015 reversed eng'd, may not be accurate.
1016 */
1017 if (card->is_audigy) {
1018 sblive_writeptr_tag(card,nCh,
1019 0x4c,0x0,
1020 0x4d,0x0,
1021 0x4e,0x0,
1022 0x4f,0x0,
1023 A_FXRT1, 0x3f3f3f3f,
1024 A_FXRT2, 0x3f3f3f3f,
1025 A_SENDAMOUNTS, 0,
1026 TAGLIST_END);
1027 }
1028 }
1029
1030
1031 /*
1032 ** Init to 0x02109204 :
1033 ** Clock accuracy = 0 (1000ppm)
1034 ** Sample Rate = 2 (48kHz)
1035 ** Audio Channel = 1 (Left of 2)
1036 ** Source Number = 0 (Unspecified)
1037 ** Generation Status = 1 (Original for Cat Code 12)
1038 ** Cat Code = 12 (Digital Signal Mixer)
1039 ** Mode = 0 (Mode 0)
1040 ** Emphasis = 0 (None)
1041 ** CP = 1 (Copyright unasserted)
1042 ** AN = 0 (Digital audio)
1043 ** P = 0 (Consumer)
1044 */
1045
1046 sblive_writeptr_tag(card, 0,
1047
1048 /* SPDIF0 */
1049 SPCS0, (SPCS_CLKACCY_1000PPM | 0x002000000 |
1050 SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC | SPCS_GENERATIONSTATUS | 0x00001200 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT),
1051
1052 /* SPDIF1 */
1053 SPCS1, (SPCS_CLKACCY_1000PPM | 0x002000000 |
1054 SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC | SPCS_GENERATIONSTATUS | 0x00001200 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT),
1055
1056 /* SPDIF2 & SPDIF3 */
1057 SPCS2, (SPCS_CLKACCY_1000PPM | 0x002000000 |
1058 SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC | SPCS_GENERATIONSTATUS | 0x00001200 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT),
1059
1060 TAGLIST_END);
1061
1062 if (card->is_audigy && (card->chiprev == 4)) {
1063 /* Hacks for Alice3 to work independent of haP16V driver */
1064 u32 tmp;
1065
1066 //Setup SRCMulti_I2S SamplingRate
1067 tmp = sblive_readptr(card, A_SPDIF_SAMPLERATE, 0);
1068 tmp &= 0xfffff1ff;
1069 tmp |= (0x2<<9);
1070 sblive_writeptr(card, A_SPDIF_SAMPLERATE, 0, tmp);
1071
1072 /* Setup SRCSel (Enable Spdif,I2S SRCMulti) */
1073 emu10k1_writefn0(card, 0x20, 0x600000);
1074 emu10k1_writefn0(card, 0x24, 0x14);
1075
1076 /* Setup SRCMulti Input Audio Enable */
1077 emu10k1_writefn0(card, 0x20, 0x6E0000);
1078 emu10k1_writefn0(card, 0x24, 0xFF00FF00);
1079 }
1080
1081 ret = fx_init(card); /* initialize effects engine */
1082 if (ret < 0)
1083 return ret;
1084
1085 card->tankmem.size = 0;
1086
1087 card->virtualpagetable.size = MAXPAGES * sizeof(u32);
1088
1089 card->virtualpagetable.addr = pci_alloc_consistent(card->pci_dev, card->virtualpagetable.size, &card->virtualpagetable.dma_handle);
1090 if (card->virtualpagetable.addr == NULL) {
1091 ERROR();
1092 ret = -ENOMEM;
1093 goto err0;
1094 }
1095
1096 card->silentpage.size = EMUPAGESIZE;
1097
1098 card->silentpage.addr = pci_alloc_consistent(card->pci_dev, card->silentpage.size, &card->silentpage.dma_handle);
1099 if (card->silentpage.addr == NULL) {
1100 ERROR();
1101 ret = -ENOMEM;
1102 goto err1;
1103 }
1104
1105 for (pagecount = 0; pagecount < MAXPAGES; pagecount++)
1106 ((u32 *) card->virtualpagetable.addr)[pagecount] = cpu_to_le32(((u32) card->silentpage.dma_handle * 2) | pagecount);
1107
1108 /* Init page table & tank memory base register */
1109 sblive_writeptr_tag(card, 0,
1110 PTB, (u32) card->virtualpagetable.dma_handle,
1111 TCB, 0,
1112 TCBS, 0,
1113 TAGLIST_END);
1114
1115 for (nCh = 0; nCh < NUM_G; nCh++) {
1116 sblive_writeptr_tag(card, nCh,
1117 MAPA, MAP_PTI_MASK | ((u32) card->silentpage.dma_handle * 2),
1118 MAPB, MAP_PTI_MASK | ((u32) card->silentpage.dma_handle * 2),
1119 TAGLIST_END);
1120 }
1121
1122 /* Hokay, now enable the AUD bit */
1123 /* Enable Audio = 1 */
1124 /* Mute Disable Audio = 0 */
1125 /* Lock Tank Memory = 1 */
1126 /* Lock Sound Memory = 0 */
1127 /* Auto Mute = 1 */
1128 if (card->is_audigy) {
1129 if (card->chiprev == 4)
1130 emu10k1_writefn0(card, HCFG, HCFG_AUDIOENABLE | HCFG_AC3ENABLE_CDSPDIF | HCFG_AC3ENABLE_GPSPDIF | HCFG_AUTOMUTE | HCFG_JOYENABLE);
1131 else
1132 emu10k1_writefn0(card, HCFG, HCFG_AUDIOENABLE | HCFG_AUTOMUTE | HCFG_JOYENABLE);
1133 } else {
1134 if (card->model == 0x20 || card->model == 0xc400 ||
1135 (card->model == 0x21 && card->chiprev < 6))
1136 emu10k1_writefn0(card, HCFG, HCFG_AUDIOENABLE | HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE);
1137 else
1138 emu10k1_writefn0(card, HCFG, HCFG_AUDIOENABLE | HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE | HCFG_JOYENABLE);
1139 }
1140 /* Enable Vol_Ctrl irqs */
1141 emu10k1_irq_enable(card, INTE_VOLINCRENABLE | INTE_VOLDECRENABLE | INTE_MUTEENABLE | INTE_FXDSPENABLE);
1142
1143 if (card->is_audigy && (card->chiprev == 4)) {
1144 /* Unmute Analog now. Set GPO6 to 1 for Apollo.
1145 * This has to be done after init ALice3 I2SOut beyond 48KHz.
1146 * So, sequence is important. */
1147 u32 tmp = emu10k1_readfn0(card, A_IOCFG);
1148 tmp |= 0x0040;
1149 emu10k1_writefn0(card, A_IOCFG, tmp);
1150 }
1151
1152 /* FIXME: TOSLink detection */
1153 card->has_toslink = 0;
1154
1155 /* Initialize digital passthrough variables */
1156 card->pt.pos_gpr = card->pt.intr_gpr = card->pt.enable_gpr = -1;
1157 card->pt.selected = 0;
1158 card->pt.state = PT_STATE_INACTIVE;
1159 card->pt.spcs_to_use = 0x01;
1160 card->pt.patch_name = "AC3pass";
1161 card->pt.intr_gpr_name = "count";
1162 card->pt.enable_gpr_name = "enable";
1163 card->pt.pos_gpr_name = "ptr";
1164 spin_lock_init(&card->pt.lock);
1165 init_waitqueue_head(&card->pt.wait);
1166
1167/* tmp = sblive_readfn0(card, HCFG);
1168 if (tmp & (HCFG_GPINPUT0 | HCFG_GPINPUT1)) {
1169 sblive_writefn0(card, HCFG, tmp | 0x800);
1170
1171 udelay(512);
1172
1173 if (tmp != (sblive_readfn0(card, HCFG) & ~0x800)) {
1174 card->has_toslink = 1;
1175 sblive_writefn0(card, HCFG, tmp);
1176 }
1177 }
1178*/
1179 return 0;
1180
1181 err1:
1182 pci_free_consistent(card->pci_dev, card->virtualpagetable.size, card->virtualpagetable.addr, card->virtualpagetable.dma_handle);
1183 err0:
1184 fx_cleanup(&card->mgr);
1185
1186 return ret;
1187}
1188
1189static int __devinit emu10k1_init(struct emu10k1_card *card)
1190{
1191 /* Init Card */
1192 if (hw_init(card) < 0)
1193 return -1;
1194
1195 voice_init(card);
1196 timer_init(card);
1197 addxmgr_init(card);
1198
1199 DPD(2, " hw control register -> %#x\n", emu10k1_readfn0(card, HCFG));
1200
1201 return 0;
1202}
1203
1204static void emu10k1_cleanup(struct emu10k1_card *card)
1205{
1206 int ch;
1207
1208 emu10k1_writefn0(card, INTE, 0);
1209
1210 /** Shutdown the chip **/
1211 for (ch = 0; ch < NUM_G; ch++)
1212 sblive_writeptr(card, DCYSUSV, ch, 0);
1213
1214 for (ch = 0; ch < NUM_G; ch++) {
1215 sblive_writeptr_tag(card, ch,
1216 VTFT, 0,
1217 CVCF, 0,
1218 PTRX, 0,
1219 //CPF, 0,
1220 TAGLIST_END);
1221 sblive_writeptr(card, CPF, ch, 0);
1222 }
1223
1224 /* Disable audio and lock cache */
1225 emu10k1_writefn0(card, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE);
1226
1227 sblive_writeptr_tag(card, 0,
1228 PTB, 0,
1229
1230 /* Reset recording buffers */
1231 MICBS, ADCBS_BUFSIZE_NONE,
1232 MICBA, 0,
1233 FXBS, ADCBS_BUFSIZE_NONE,
1234 FXBA, 0,
1235 FXWC, 0,
1236 ADCBS, ADCBS_BUFSIZE_NONE,
1237 ADCBA, 0,
1238 TCBS, 0,
1239 TCB, 0,
1240 DBG, 0x8000,
1241
1242 /* Disable channel interrupt */
1243 CLIEL, 0,
1244 CLIEH, 0,
1245 SOLEL, 0,
1246 SOLEH, 0,
1247 TAGLIST_END);
1248
1249 if (card->is_audigy)
1250 sblive_writeptr(card, 0, A_DBG, A_DBG_SINGLE_STEP);
1251
1252 pci_free_consistent(card->pci_dev, card->virtualpagetable.size, card->virtualpagetable.addr, card->virtualpagetable.dma_handle);
1253 pci_free_consistent(card->pci_dev, card->silentpage.size, card->silentpage.addr, card->silentpage.dma_handle);
1254
1255 if(card->tankmem.size != 0)
1256 pci_free_consistent(card->pci_dev, card->tankmem.size, card->tankmem.addr, card->tankmem.dma_handle);
1257
1258 /* release patch storage memory */
1259 fx_cleanup(&card->mgr);
1260}
1261
1262/* Driver initialization routine */
1263static int __devinit emu10k1_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
1264{
1265 struct emu10k1_card *card;
1266 u32 subsysvid;
1267 int ret;
1268
1269 if (pci_set_dma_mask(pci_dev, EMU10K1_DMA_MASK)) {
1270 printk(KERN_ERR "emu10k1: architecture does not support 29bit PCI busmaster DMA\n");
1271 return -ENODEV;
1272 }
1273
1274 if (pci_enable_device(pci_dev))
1275 return -EIO;
1276
1277 pci_set_master(pci_dev);
1278
1279 if ((card = kzalloc(sizeof(struct emu10k1_card), GFP_KERNEL)) == NULL) {
1280 printk(KERN_ERR "emu10k1: out of memory\n");
1281 return -ENOMEM;
1282 }
1283
1284 card->iobase = pci_resource_start(pci_dev, 0);
1285 card->length = pci_resource_len(pci_dev, 0);
1286
1287 if (request_region(card->iobase, card->length, card_names[pci_id->driver_data]) == NULL) {
1288 printk(KERN_ERR "emu10k1: IO space in use\n");
1289 ret = -EBUSY;
1290 goto err_region;
1291 }
1292
1293 pci_set_drvdata(pci_dev, card);
1294
1295 card->irq = pci_dev->irq;
1296 card->pci_dev = pci_dev;
1297
1298 /* Reserve IRQ Line */
1299 if (request_irq(card->irq, emu10k1_interrupt, IRQF_SHARED, card_names[pci_id->driver_data], card)) {
1300 printk(KERN_ERR "emu10k1: IRQ in use\n");
1301 ret = -EBUSY;
1302 goto err_irq;
1303 }
1304
1305 card->chiprev = pci_dev->revision;
1306 pci_read_config_word(pci_dev, PCI_SUBSYSTEM_ID, &card->model);
1307
1308 printk(KERN_INFO "emu10k1: %s rev %d model %#04x found, IO at %#04lx-%#04lx, IRQ %d\n",
1309 card_names[pci_id->driver_data], card->chiprev, card->model, card->iobase,
1310 card->iobase + card->length - 1, card->irq);
1311
1312 if (pci_id->device == PCI_DEVICE_ID_CREATIVE_AUDIGY)
1313 card->is_audigy = 1;
1314
1315 pci_read_config_dword(pci_dev, PCI_SUBSYSTEM_VENDOR_ID, &subsysvid);
1316 card->is_aps = (subsysvid == EMU_APS_SUBID);
1317
1318 spin_lock_init(&card->lock);
1319 mutex_init(&card->open_sem);
1320 card->open_mode = 0;
1321 init_waitqueue_head(&card->open_wait);
1322
1323 ret = emu10k1_audio_init(card);
1324 if (ret < 0) {
1325 printk(KERN_ERR "emu10k1: cannot initialize audio devices\n");
1326 goto err_audio;
1327 }
1328
1329 ret = emu10k1_mixer_init(card);
1330 if (ret < 0) {
1331 printk(KERN_ERR "emu10k1: cannot initialize AC97 codec\n");
1332 goto err_mixer;
1333 }
1334
1335 ret = emu10k1_midi_init(card);
1336 if (ret < 0) {
1337 printk(KERN_ERR "emu10k1: cannot register midi device\n");
1338 goto err_midi;
1339 }
1340
1341 ret = emu10k1_init(card);
1342 if (ret < 0) {
1343 printk(KERN_ERR "emu10k1: cannot initialize device\n");
1344 goto err_emu10k1_init;
1345 }
1346
1347 if (card->is_aps)
1348 emu10k1_ecard_init(card);
1349
1350 ret = emu10k1_register_devices(card);
1351 if (ret < 0)
1352 goto err_register;
1353
1354 /* proc entries must be created after registering devices, as
1355 * emu10k1_info_proc prints card->audio_dev &co. */
1356 ret = emu10k1_proc_init(card);
1357 if (ret < 0) {
1358 printk(KERN_ERR "emu10k1: cannot initialize proc directory\n");
1359 goto err_proc;
1360 }
1361
1362 list_add(&card->list, &emu10k1_devs);
1363
1364 return 0;
1365
1366err_proc:
1367 emu10k1_unregister_devices(card);
1368
1369err_register:
1370 emu10k1_cleanup(card);
1371
1372err_emu10k1_init:
1373 emu10k1_midi_cleanup(card);
1374
1375err_midi:
1376 emu10k1_mixer_cleanup(card);
1377
1378err_mixer:
1379 emu10k1_audio_cleanup(card);
1380
1381err_audio:
1382 free_irq(card->irq, card);
1383
1384err_irq:
1385 release_region(card->iobase, card->length);
1386 pci_set_drvdata(pci_dev, NULL);
1387
1388err_region:
1389 kfree(card);
1390
1391 return ret;
1392}
1393
1394static void __devexit emu10k1_remove(struct pci_dev *pci_dev)
1395{
1396 struct emu10k1_card *card = pci_get_drvdata(pci_dev);
1397
1398 list_del(&card->list);
1399
1400 emu10k1_unregister_devices(card);
1401 emu10k1_cleanup(card);
1402 emu10k1_midi_cleanup(card);
1403 emu10k1_mixer_cleanup(card);
1404 emu10k1_proc_cleanup(card);
1405 emu10k1_audio_cleanup(card);
1406 free_irq(card->irq, card);
1407 release_region(card->iobase, card->length);
1408 kfree(card);
1409 pci_set_drvdata(pci_dev, NULL);
1410}
1411
1412MODULE_AUTHOR("Bertrand Lee, Cai Ying. (Email to: emu10k1-devel@lists.sourceforge.net)");
1413MODULE_DESCRIPTION("Creative EMU10K1 PCI Audio Driver v" DRIVER_VERSION "\nCopyright (C) 1999 Creative Technology Ltd.");
1414MODULE_LICENSE("GPL");
1415
1416static struct pci_driver emu10k1_pci_driver = {
1417 .name = "emu10k1",
1418 .id_table = emu10k1_pci_tbl,
1419 .probe = emu10k1_probe,
1420 .remove = __devexit_p(emu10k1_remove),
1421};
1422
1423static int __init emu10k1_init_module(void)
1424{
1425 printk(KERN_INFO "Creative EMU10K1 PCI Audio Driver, version " DRIVER_VERSION ", " __TIME__ " " __DATE__ "\n");
1426
1427 return pci_register_driver(&emu10k1_pci_driver);
1428}
1429
1430static void __exit emu10k1_cleanup_module(void)
1431{
1432 pci_unregister_driver(&emu10k1_pci_driver);
1433
1434 return;
1435}
1436
1437module_init(emu10k1_init_module);
1438module_exit(emu10k1_cleanup_module);
1439
1440#ifdef EMU10K1_SEQUENCER
1441
1442/* in midi.c */
1443extern int emu10k1_seq_midi_open(int dev, int mode,
1444 void (*input)(int dev, unsigned char midi_byte),
1445 void (*output)(int dev));
1446extern void emu10k1_seq_midi_close(int dev);
1447extern int emu10k1_seq_midi_out(int dev, unsigned char midi_byte);
1448extern int emu10k1_seq_midi_start_read(int dev);
1449extern int emu10k1_seq_midi_end_read(int dev);
1450extern void emu10k1_seq_midi_kick(int dev);
1451extern int emu10k1_seq_midi_buffer_status(int dev);
1452
1453static struct midi_operations emu10k1_midi_operations =
1454{
1455 THIS_MODULE,
1456 {"EMU10K1 MIDI", 0, 0, SNDCARD_EMU10K1},
1457 &std_midi_synth,
1458 {0},
1459 emu10k1_seq_midi_open,
1460 emu10k1_seq_midi_close,
1461 NULL,
1462 emu10k1_seq_midi_out,
1463 emu10k1_seq_midi_start_read,
1464 emu10k1_seq_midi_end_read,
1465 emu10k1_seq_midi_kick,
1466 NULL,
1467 emu10k1_seq_midi_buffer_status,
1468 NULL
1469};
1470
1471#endif
diff --git a/sound/oss/emu10k1/midi.c b/sound/oss/emu10k1/midi.c
deleted file mode 100644
index df1e990449a0..000000000000
--- a/sound/oss/emu10k1/midi.c
+++ /dev/null
@@ -1,614 +0,0 @@
1/*
2 **********************************************************************
3 * midi.c - /dev/midi interface for emu10k1 driver
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#include <linux/module.h>
33#include <linux/poll.h>
34#include <linux/slab.h>
35#include <linux/sched.h>
36#include <linux/smp_lock.h>
37#include <asm/uaccess.h>
38
39#include "hwaccess.h"
40#include "cardmo.h"
41#include "cardmi.h"
42#include "midi.h"
43
44#ifdef EMU10K1_SEQUENCER
45#include "../sound_config.h"
46#endif
47
48static DEFINE_SPINLOCK(midi_spinlock);
49
50static void init_midi_hdr(struct midi_hdr *midihdr)
51{
52 midihdr->bufferlength = MIDIIN_BUFLEN;
53 midihdr->bytesrecorded = 0;
54 midihdr->flags = 0;
55}
56
57static int midiin_add_buffer(struct emu10k1_mididevice *midi_dev, struct midi_hdr **midihdrptr)
58{
59 struct midi_hdr *midihdr;
60
61 if ((midihdr = kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) {
62 ERROR();
63 return -EINVAL;
64 }
65
66 init_midi_hdr(midihdr);
67
68 midihdr->data = kmalloc(MIDIIN_BUFLEN, GFP_KERNEL);
69 if (!midihdr->data) {
70 ERROR();
71 kfree(midihdr);
72 return -1;
73 }
74
75 if (emu10k1_mpuin_add_buffer(midi_dev->card->mpuin, midihdr) < 0) {
76 ERROR();
77 kfree(midihdr->data);
78 kfree(midihdr);
79 return -1;
80 }
81
82 *midihdrptr = midihdr;
83 list_add_tail(&midihdr->list, &midi_dev->mid_hdrs);
84
85 return 0;
86}
87
88static int emu10k1_midi_open(struct inode *inode, struct file *file)
89{
90 int minor = iminor(inode);
91 struct emu10k1_card *card = NULL;
92 struct emu10k1_mididevice *midi_dev;
93 struct list_head *entry;
94
95 DPF(2, "emu10k1_midi_open()\n");
96
97 /* Check for correct device to open */
98 list_for_each(entry, &emu10k1_devs) {
99 card = list_entry(entry, struct emu10k1_card, list);
100
101 if (card->midi_dev == minor)
102 goto match;
103 }
104
105 return -ENODEV;
106
107match:
108#ifdef EMU10K1_SEQUENCER
109 if (card->seq_mididev) /* card is opened by sequencer */
110 return -EBUSY;
111#endif
112
113 /* Wait for device to become free */
114 mutex_lock(&card->open_sem);
115 while (card->open_mode & (file->f_mode << FMODE_MIDI_SHIFT)) {
116 if (file->f_flags & O_NONBLOCK) {
117 mutex_unlock(&card->open_sem);
118 return -EBUSY;
119 }
120
121 mutex_unlock(&card->open_sem);
122 interruptible_sleep_on(&card->open_wait);
123
124 if (signal_pending(current)) {
125 return -ERESTARTSYS;
126 }
127
128 mutex_lock(&card->open_sem);
129 }
130
131 if ((midi_dev = kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL)
132 return -EINVAL;
133
134 midi_dev->card = card;
135 midi_dev->mistate = MIDIIN_STATE_STOPPED;
136 init_waitqueue_head(&midi_dev->oWait);
137 init_waitqueue_head(&midi_dev->iWait);
138 midi_dev->ird = 0;
139 midi_dev->iwr = 0;
140 midi_dev->icnt = 0;
141 INIT_LIST_HEAD(&midi_dev->mid_hdrs);
142
143 if (file->f_mode & FMODE_READ) {
144 struct midi_openinfo dsCardMidiOpenInfo;
145 struct midi_hdr *midihdr1;
146 struct midi_hdr *midihdr2;
147
148 dsCardMidiOpenInfo.refdata = (unsigned long) midi_dev;
149
150 if (emu10k1_mpuin_open(card, &dsCardMidiOpenInfo) < 0) {
151 ERROR();
152 kfree(midi_dev);
153 return -ENODEV;
154 }
155
156 /* Add two buffers to receive sysex buffer */
157 if (midiin_add_buffer(midi_dev, &midihdr1) < 0) {
158 kfree(midi_dev);
159 return -ENODEV;
160 }
161
162 if (midiin_add_buffer(midi_dev, &midihdr2) < 0) {
163 list_del(&midihdr1->list);
164 kfree(midihdr1->data);
165 kfree(midihdr1);
166 kfree(midi_dev);
167 return -ENODEV;
168 }
169 }
170
171 if (file->f_mode & FMODE_WRITE) {
172 struct midi_openinfo dsCardMidiOpenInfo;
173
174 dsCardMidiOpenInfo.refdata = (unsigned long) midi_dev;
175
176 if (emu10k1_mpuout_open(card, &dsCardMidiOpenInfo) < 0) {
177 ERROR();
178 kfree(midi_dev);
179 return -ENODEV;
180 }
181 }
182
183 file->private_data = (void *) midi_dev;
184
185 card->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
186
187 mutex_unlock(&card->open_sem);
188
189 return nonseekable_open(inode, file);
190}
191
192static int emu10k1_midi_release(struct inode *inode, struct file *file)
193{
194 struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *) file->private_data;
195 struct emu10k1_card *card;
196
197 lock_kernel();
198
199 card = midi_dev->card;
200 DPF(2, "emu10k1_midi_release()\n");
201
202 if (file->f_mode & FMODE_WRITE) {
203 if (!(file->f_flags & O_NONBLOCK)) {
204
205 while (!signal_pending(current) && (card->mpuout->firstmidiq != NULL)) {
206 DPF(4, "Cannot close - buffers not empty\n");
207
208 interruptible_sleep_on(&midi_dev->oWait);
209
210 }
211 }
212
213 emu10k1_mpuout_close(card);
214 }
215
216 if (file->f_mode & FMODE_READ) {
217 struct midi_hdr *midihdr;
218
219 if (midi_dev->mistate == MIDIIN_STATE_STARTED) {
220 emu10k1_mpuin_stop(card);
221 midi_dev->mistate = MIDIIN_STATE_STOPPED;
222 }
223
224 emu10k1_mpuin_reset(card);
225 emu10k1_mpuin_close(card);
226
227 while (!list_empty(&midi_dev->mid_hdrs)) {
228 midihdr = list_entry(midi_dev->mid_hdrs.next, struct midi_hdr, list);
229
230 list_del(midi_dev->mid_hdrs.next);
231 kfree(midihdr->data);
232 kfree(midihdr);
233 }
234 }
235
236 kfree(midi_dev);
237
238 mutex_lock(&card->open_sem);
239 card->open_mode &= ~((file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE));
240 mutex_unlock(&card->open_sem);
241 wake_up_interruptible(&card->open_wait);
242
243 unlock_kernel();
244
245 return 0;
246}
247
248static ssize_t emu10k1_midi_read(struct file *file, char __user *buffer, size_t count, loff_t * pos)
249{
250 struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *) file->private_data;
251 ssize_t ret = 0;
252 u16 cnt;
253 unsigned long flags;
254
255 DPD(4, "emu10k1_midi_read(), count %#x\n", (u32) count);
256
257 if (!access_ok(VERIFY_WRITE, buffer, count))
258 return -EFAULT;
259
260 if (midi_dev->mistate == MIDIIN_STATE_STOPPED) {
261 if (emu10k1_mpuin_start(midi_dev->card) < 0) {
262 ERROR();
263 return -EINVAL;
264 }
265
266 midi_dev->mistate = MIDIIN_STATE_STARTED;
267 }
268
269 while (count > 0) {
270 cnt = MIDIIN_BUFLEN - midi_dev->ird;
271
272 spin_lock_irqsave(&midi_spinlock, flags);
273
274 if (midi_dev->icnt < cnt)
275 cnt = midi_dev->icnt;
276
277 spin_unlock_irqrestore(&midi_spinlock, flags);
278
279 if (cnt > count)
280 cnt = count;
281
282 if (cnt <= 0) {
283 if (file->f_flags & O_NONBLOCK)
284 return ret ? ret : -EAGAIN;
285 DPF(2, " Go to sleep...\n");
286
287 interruptible_sleep_on(&midi_dev->iWait);
288
289 if (signal_pending(current))
290 return ret ? ret : -ERESTARTSYS;
291
292 continue;
293 }
294
295 if (copy_to_user(buffer, midi_dev->iBuf + midi_dev->ird, cnt)) {
296 ERROR();
297 return ret ? ret : -EFAULT;
298 }
299
300 midi_dev->ird += cnt;
301 midi_dev->ird %= MIDIIN_BUFLEN;
302
303 spin_lock_irqsave(&midi_spinlock, flags);
304
305 midi_dev->icnt -= cnt;
306
307 spin_unlock_irqrestore(&midi_spinlock, flags);
308
309 count -= cnt;
310 buffer += cnt;
311 ret += cnt;
312
313 if (midi_dev->icnt == 0)
314 break;
315 }
316
317 return ret;
318}
319
320static ssize_t emu10k1_midi_write(struct file *file, const char __user *buffer, size_t count, loff_t * pos)
321{
322 struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *) file->private_data;
323 struct midi_hdr *midihdr;
324 unsigned long flags;
325
326 DPD(4, "emu10k1_midi_write(), count=%#x\n", (u32) count);
327
328 if (!access_ok(VERIFY_READ, buffer, count))
329 return -EFAULT;
330
331 if ((midihdr = kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL)
332 return -EINVAL;
333
334 midihdr->bufferlength = count;
335 midihdr->bytesrecorded = 0;
336 midihdr->flags = 0;
337
338 midihdr->data = kmalloc(count, GFP_KERNEL);
339 if (!midihdr->data) {
340 ERROR();
341 kfree(midihdr);
342 return -EINVAL;
343 }
344
345 if (copy_from_user(midihdr->data, buffer, count)) {
346 kfree(midihdr->data);
347 kfree(midihdr);
348 return -EFAULT;
349 }
350
351 spin_lock_irqsave(&midi_spinlock, flags);
352
353 if (emu10k1_mpuout_add_buffer(midi_dev->card, midihdr) < 0) {
354 ERROR();
355 kfree(midihdr->data);
356 kfree(midihdr);
357 spin_unlock_irqrestore(&midi_spinlock, flags);
358 return -EINVAL;
359 }
360
361 spin_unlock_irqrestore(&midi_spinlock, flags);
362
363 return count;
364}
365
366static unsigned int emu10k1_midi_poll(struct file *file, struct poll_table_struct *wait)
367{
368 struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *) file->private_data;
369 unsigned long flags;
370 unsigned int mask = 0;
371
372 DPF(4, "emu10k1_midi_poll() called\n");
373
374 if (file->f_mode & FMODE_WRITE)
375 poll_wait(file, &midi_dev->oWait, wait);
376
377 if (file->f_mode & FMODE_READ)
378 poll_wait(file, &midi_dev->iWait, wait);
379
380 spin_lock_irqsave(&midi_spinlock, flags);
381
382 if (file->f_mode & FMODE_WRITE)
383 mask |= POLLOUT | POLLWRNORM;
384
385 if (file->f_mode & FMODE_READ) {
386 if (midi_dev->mistate == MIDIIN_STATE_STARTED)
387 if (midi_dev->icnt > 0)
388 mask |= POLLIN | POLLRDNORM;
389 }
390
391 spin_unlock_irqrestore(&midi_spinlock, flags);
392
393 return mask;
394}
395
396int emu10k1_midi_callback(unsigned long msg, unsigned long refdata, unsigned long *pmsg)
397{
398 struct emu10k1_mididevice *midi_dev = (struct emu10k1_mididevice *) refdata;
399 struct midi_hdr *midihdr = NULL;
400 unsigned long flags;
401 int i;
402
403 DPF(4, "emu10k1_midi_callback()\n");
404
405 spin_lock_irqsave(&midi_spinlock, flags);
406
407 switch (msg) {
408 case ICARDMIDI_OUTLONGDATA:
409 midihdr = (struct midi_hdr *) pmsg[2];
410
411 kfree(midihdr->data);
412 kfree(midihdr);
413 wake_up_interruptible(&midi_dev->oWait);
414
415 break;
416
417 case ICARDMIDI_INLONGDATA:
418 midihdr = (struct midi_hdr *) pmsg[2];
419
420 for (i = 0; i < midihdr->bytesrecorded; i++) {
421 midi_dev->iBuf[midi_dev->iwr++] = midihdr->data[i];
422 midi_dev->iwr %= MIDIIN_BUFLEN;
423 }
424
425 midi_dev->icnt += midihdr->bytesrecorded;
426
427 if (midi_dev->mistate == MIDIIN_STATE_STARTED) {
428 init_midi_hdr(midihdr);
429 emu10k1_mpuin_add_buffer(midi_dev->card->mpuin, midihdr);
430 wake_up_interruptible(&midi_dev->iWait);
431 }
432 break;
433
434 case ICARDMIDI_INDATA:
435 {
436 u8 *pBuf = (u8 *) & pmsg[1];
437 u16 bytesvalid = pmsg[2];
438
439 for (i = 0; i < bytesvalid; i++) {
440 midi_dev->iBuf[midi_dev->iwr++] = pBuf[i];
441 midi_dev->iwr %= MIDIIN_BUFLEN;
442 }
443
444 midi_dev->icnt += bytesvalid;
445 }
446
447 wake_up_interruptible(&midi_dev->iWait);
448 break;
449
450 default: /* Unknown message */
451 spin_unlock_irqrestore(&midi_spinlock, flags);
452 return -1;
453 }
454
455 spin_unlock_irqrestore(&midi_spinlock, flags);
456
457 return 0;
458}
459
460/* MIDI file operations */
461const struct file_operations emu10k1_midi_fops = {
462 .owner = THIS_MODULE,
463 .read = emu10k1_midi_read,
464 .write = emu10k1_midi_write,
465 .poll = emu10k1_midi_poll,
466 .open = emu10k1_midi_open,
467 .release = emu10k1_midi_release,
468};
469
470
471#ifdef EMU10K1_SEQUENCER
472
473/* functions used for sequencer access */
474
475int emu10k1_seq_midi_open(int dev, int mode,
476 void (*input) (int dev, unsigned char data),
477 void (*output) (int dev))
478{
479 struct emu10k1_card *card;
480 struct midi_openinfo dsCardMidiOpenInfo;
481 struct emu10k1_mididevice *midi_dev;
482
483 if (midi_devs[dev] == NULL || midi_devs[dev]->devc == NULL)
484 return -EINVAL;
485
486 card = midi_devs[dev]->devc;
487
488 if (card->open_mode) /* card is opened native */
489 return -EBUSY;
490
491 DPF(2, "emu10k1_seq_midi_open()\n");
492
493 if ((midi_dev = kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL)
494 return -EINVAL;
495
496 midi_dev->card = card;
497 midi_dev->mistate = MIDIIN_STATE_STOPPED;
498 init_waitqueue_head(&midi_dev->oWait);
499 init_waitqueue_head(&midi_dev->iWait);
500 midi_dev->ird = 0;
501 midi_dev->iwr = 0;
502 midi_dev->icnt = 0;
503 INIT_LIST_HEAD(&midi_dev->mid_hdrs);
504
505 dsCardMidiOpenInfo.refdata = (unsigned long) midi_dev;
506
507 if (emu10k1_mpuout_open(card, &dsCardMidiOpenInfo) < 0) {
508 ERROR();
509 return -ENODEV;
510 }
511
512 card->seq_mididev = midi_dev;
513
514 return 0;
515}
516
517void emu10k1_seq_midi_close(int dev)
518{
519 struct emu10k1_card *card;
520
521 DPF(2, "emu10k1_seq_midi_close()\n");
522 if (midi_devs[dev] == NULL || midi_devs[dev]->devc == NULL)
523 return;
524
525 card = midi_devs[dev]->devc;
526 emu10k1_mpuout_close(card);
527
528 kfree(card->seq_mididev);
529 card->seq_mididev = NULL;
530}
531
532int emu10k1_seq_midi_out(int dev, unsigned char midi_byte)
533{
534 struct emu10k1_card *card;
535 struct midi_hdr *midihdr;
536 unsigned long flags;
537
538 if (midi_devs[dev] == NULL || midi_devs[dev]->devc == NULL)
539 return -EINVAL;
540
541 card = midi_devs[dev]->devc;
542
543 if ((midihdr = kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL)
544 return -EINVAL;
545
546 midihdr->bufferlength = 1;
547 midihdr->bytesrecorded = 0;
548 midihdr->flags = 0;
549
550 midihdr->data = kmalloc(1, GFP_KERNEL);
551 if (!midihdr->data) {
552 ERROR();
553 kfree(midihdr);
554 return -EINVAL;
555 }
556
557 *(midihdr->data) = midi_byte;
558
559 spin_lock_irqsave(&midi_spinlock, flags);
560
561 if (emu10k1_mpuout_add_buffer(card, midihdr) < 0) {
562 ERROR();
563 kfree(midihdr->data);
564 kfree(midihdr);
565 spin_unlock_irqrestore(&midi_spinlock, flags);
566 return -EINVAL;
567 }
568
569 spin_unlock_irqrestore(&midi_spinlock, flags);
570
571 return 1;
572}
573
574int emu10k1_seq_midi_start_read(int dev)
575{
576 return 0;
577}
578
579int emu10k1_seq_midi_end_read(int dev)
580{
581 return 0;
582}
583
584void emu10k1_seq_midi_kick(int dev)
585{
586}
587
588int emu10k1_seq_midi_buffer_status(int dev)
589{
590 int count;
591 struct midi_queue *queue;
592 struct emu10k1_card *card;
593
594 if (midi_devs[dev] == NULL || midi_devs[dev]->devc == NULL)
595 return -EINVAL;
596
597 count = 0;
598
599 card = midi_devs[dev]->devc;
600 queue = card->mpuout->firstmidiq;
601
602 while (queue != NULL) {
603 count++;
604 if (queue == card->mpuout->lastmidiq)
605 break;
606
607 queue = queue->next;
608 }
609
610 return count;
611}
612
613#endif
614
diff --git a/sound/oss/emu10k1/midi.h b/sound/oss/emu10k1/midi.h
deleted file mode 100644
index 2459ec929e8d..000000000000
--- a/sound/oss/emu10k1/midi.h
+++ /dev/null
@@ -1,78 +0,0 @@
1/*
2 **********************************************************************
3 * midi.h
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#ifndef _MIDI_H
33#define _MIDI_H
34
35#define FMODE_MIDI_SHIFT 3
36#define FMODE_MIDI_READ (FMODE_READ << FMODE_MIDI_SHIFT)
37#define FMODE_MIDI_WRITE (FMODE_WRITE << FMODE_MIDI_SHIFT)
38
39#define MIDIIN_STATE_STARTED 0x00000001
40#define MIDIIN_STATE_STOPPED 0x00000002
41
42#define MIDIIN_BUFLEN 1024
43
44struct emu10k1_mididevice
45{
46 struct emu10k1_card *card;
47 u32 mistate;
48 wait_queue_head_t oWait;
49 wait_queue_head_t iWait;
50 s8 iBuf[MIDIIN_BUFLEN];
51 u16 ird, iwr, icnt;
52 struct list_head mid_hdrs;
53};
54
55/* uncomment next line to use midi port on Audigy drive */
56//#define USE_AUDIGY_DRIVE_MIDI
57
58#ifdef USE_AUDIGY_DRIVE_MIDI
59#define A_MUDATA A_MUDATA2
60#define A_MUCMD A_MUCMD2
61#define A_MUSTAT A_MUCMD2
62#define A_IPR_MIDITRANSBUFEMPTY A_IPR_MIDITRANSBUFEMPTY2
63#define A_IPR_MIDIRECVBUFEMPTY A_IPR_MIDIRECVBUFEMPTY2
64#define A_INTE_MIDITXENABLE A_INTE_MIDITXENABLE2
65#define A_INTE_MIDIRXENABLE A_INTE_MIDIRXENABLE2
66#else
67#define A_MUDATA A_MUDATA1
68#define A_MUCMD A_MUCMD1
69#define A_MUSTAT A_MUCMD1
70#define A_IPR_MIDITRANSBUFEMPTY A_IPR_MIDITRANSBUFEMPTY1
71#define A_IPR_MIDIRECVBUFEMPTY A_IPR_MIDIRECVBUFEMPTY1
72#define A_INTE_MIDITXENABLE A_INTE_MIDITXENABLE1
73#define A_INTE_MIDIRXENABLE A_INTE_MIDIRXENABLE1
74#endif
75
76
77#endif /* _MIDI_H */
78
diff --git a/sound/oss/emu10k1/mixer.c b/sound/oss/emu10k1/mixer.c
deleted file mode 100644
index bc3805fb0701..000000000000
--- a/sound/oss/emu10k1/mixer.c
+++ /dev/null
@@ -1,690 +0,0 @@
1/*
2 **********************************************************************
3 * mixer.c - /dev/mixer interface for emu10k1 driver
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 * November 2, 1999 Alan Cox cleaned up stuff
12 *
13 **********************************************************************
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this program; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
28 * USA.
29 *
30 **********************************************************************
31 */
32
33#include <linux/module.h>
34#include <asm/uaccess.h>
35#include <linux/fs.h>
36
37#include "hwaccess.h"
38#include "8010.h"
39#include "recmgr.h"
40
41
42static const u32 bass_table[41][5] = {
43 { 0x3e4f844f, 0x84ed4cc3, 0x3cc69927, 0x7b03553a, 0xc4da8486 },
44 { 0x3e69a17a, 0x84c280fb, 0x3cd77cd4, 0x7b2f2a6f, 0xc4b08d1d },
45 { 0x3e82ff42, 0x849991d5, 0x3ce7466b, 0x7b5917c6, 0xc48863ee },
46 { 0x3e9bab3c, 0x847267f0, 0x3cf5ffe8, 0x7b813560, 0xc461f22c },
47 { 0x3eb3b275, 0x844ced29, 0x3d03b295, 0x7ba79a1c, 0xc43d223b },
48 { 0x3ecb2174, 0x84290c8b, 0x3d106714, 0x7bcc5ba3, 0xc419dfa5 },
49 { 0x3ee2044b, 0x8406b244, 0x3d1c2561, 0x7bef8e77, 0xc3f8170f },
50 { 0x3ef86698, 0x83e5cb96, 0x3d26f4d8, 0x7c114600, 0xc3d7b625 },
51 { 0x3f0e5390, 0x83c646c9, 0x3d30dc39, 0x7c319498, 0xc3b8ab97 },
52 { 0x3f23d60b, 0x83a81321, 0x3d39e1af, 0x7c508b9c, 0xc39ae704 },
53 { 0x3f38f884, 0x838b20d2, 0x3d420ad2, 0x7c6e3b75, 0xc37e58f1 },
54 { 0x3f4dc52c, 0x836f60ef, 0x3d495cab, 0x7c8ab3a6, 0xc362f2be },
55 { 0x3f6245e8, 0x8354c565, 0x3d4fdbb8, 0x7ca602d6, 0xc348a69b },
56 { 0x3f76845f, 0x833b40ec, 0x3d558bf0, 0x7cc036df, 0xc32f677c },
57 { 0x3f8a8a03, 0x8322c6fb, 0x3d5a70c4, 0x7cd95cd7, 0xc317290b },
58 { 0x3f9e6014, 0x830b4bc3, 0x3d5e8d25, 0x7cf1811a, 0xc2ffdfa5 },
59 { 0x3fb20fae, 0x82f4c420, 0x3d61e37f, 0x7d08af56, 0xc2e9804a },
60 { 0x3fc5a1cc, 0x82df2592, 0x3d6475c3, 0x7d1ef294, 0xc2d40096 },
61 { 0x3fd91f55, 0x82ca6632, 0x3d664564, 0x7d345541, 0xc2bf56b9 },
62 { 0x3fec9120, 0x82b67cac, 0x3d675356, 0x7d48e138, 0xc2ab796e },
63 { 0x40000000, 0x82a36037, 0x3d67a012, 0x7d5c9fc9, 0xc2985fee },
64 { 0x401374c7, 0x8291088a, 0x3d672b93, 0x7d6f99c3, 0xc28601f2 },
65 { 0x4026f857, 0x827f6dd7, 0x3d65f559, 0x7d81d77c, 0xc27457a3 },
66 { 0x403a939f, 0x826e88c5, 0x3d63fc63, 0x7d9360d4, 0xc2635996 },
67 { 0x404e4faf, 0x825e5266, 0x3d613f32, 0x7da43d42, 0xc25300c6 },
68 { 0x406235ba, 0x824ec434, 0x3d5dbbc3, 0x7db473d7, 0xc243468e },
69 { 0x40764f1f, 0x823fd80c, 0x3d596f8f, 0x7dc40b44, 0xc23424a2 },
70 { 0x408aa576, 0x82318824, 0x3d545787, 0x7dd309e2, 0xc2259509 },
71 { 0x409f4296, 0x8223cf0b, 0x3d4e7012, 0x7de175b5, 0xc2179218 },
72 { 0x40b430a0, 0x8216a7a1, 0x3d47b505, 0x7def5475, 0xc20a1670 },
73 { 0x40c97a0a, 0x820a0d12, 0x3d4021a1, 0x7dfcab8d, 0xc1fd1cf5 },
74 { 0x40df29a6, 0x81fdfad6, 0x3d37b08d, 0x7e098028, 0xc1f0a0ca },
75 { 0x40f54ab1, 0x81f26ca9, 0x3d2e5bd1, 0x7e15d72b, 0xc1e49d52 },
76 { 0x410be8da, 0x81e75e89, 0x3d241cce, 0x7e21b544, 0xc1d90e24 },
77 { 0x41231051, 0x81dcccb3, 0x3d18ec37, 0x7e2d1ee6, 0xc1cdef10 },
78 { 0x413acdd0, 0x81d2b39e, 0x3d0cc20a, 0x7e38184e, 0xc1c33c13 },
79 { 0x41532ea7, 0x81c90ffb, 0x3cff9585, 0x7e42a58b, 0xc1b8f15a },
80 { 0x416c40cd, 0x81bfdeb2, 0x3cf15d21, 0x7e4cca7c, 0xc1af0b3f },
81 { 0x418612ea, 0x81b71cdc, 0x3ce20e85, 0x7e568ad3, 0xc1a58640 },
82 { 0x41a0b465, 0x81aec7c5, 0x3cd19e7c, 0x7e5fea1e, 0xc19c5f03 },
83 { 0x41bc3573, 0x81a6dcea, 0x3cc000e9, 0x7e68ebc2, 0xc1939250 }
84};
85
86static const u32 treble_table[41][5] = {
87 { 0x0125cba9, 0xfed5debd, 0x00599b6c, 0x0d2506da, 0xfa85b354 },
88 { 0x0142f67e, 0xfeb03163, 0x0066cd0f, 0x0d14c69d, 0xfa914473 },
89 { 0x016328bd, 0xfe860158, 0x0075b7f2, 0x0d03eb27, 0xfa9d32d2 },
90 { 0x0186b438, 0xfe56c982, 0x00869234, 0x0cf27048, 0xfaa97fca },
91 { 0x01adf358, 0xfe21f5fe, 0x00999842, 0x0ce051c2, 0xfab62ca5 },
92 { 0x01d949fa, 0xfde6e287, 0x00af0d8d, 0x0ccd8b4a, 0xfac33aa7 },
93 { 0x02092669, 0xfda4d8bf, 0x00c73d4c, 0x0cba1884, 0xfad0ab07 },
94 { 0x023e0268, 0xfd5b0e4a, 0x00e27b54, 0x0ca5f509, 0xfade7ef2 },
95 { 0x0278645c, 0xfd08a2b0, 0x01012509, 0x0c911c63, 0xfaecb788 },
96 { 0x02b8e091, 0xfcac9d1a, 0x0123a262, 0x0c7b8a14, 0xfafb55df },
97 { 0x03001a9a, 0xfc45e9ce, 0x014a6709, 0x0c65398f, 0xfb0a5aff },
98 { 0x034ec6d7, 0xfbd3576b, 0x0175f397, 0x0c4e2643, 0xfb19c7e4 },
99 { 0x03a5ac15, 0xfb5393ee, 0x01a6d6ed, 0x0c364b94, 0xfb299d7c },
100 { 0x0405a562, 0xfac52968, 0x01ddafae, 0x0c1da4e2, 0xfb39dca5 },
101 { 0x046fa3fe, 0xfa267a66, 0x021b2ddd, 0x0c042d8d, 0xfb4a8631 },
102 { 0x04e4b17f, 0xf975be0f, 0x0260149f, 0x0be9e0f2, 0xfb5b9ae0 },
103 { 0x0565f220, 0xf8b0fbe5, 0x02ad3c29, 0x0bceba73, 0xfb6d1b60 },
104 { 0x05f4a745, 0xf7d60722, 0x030393d4, 0x0bb2b578, 0xfb7f084d },
105 { 0x06923236, 0xf6e279bd, 0x03642465, 0x0b95cd75, 0xfb916233 },
106 { 0x07401713, 0xf5d3aef9, 0x03d01283, 0x0b77fded, 0xfba42984 },
107 { 0x08000000, 0xf4a6bd88, 0x0448a161, 0x0b594278, 0xfbb75e9f },
108 { 0x08d3c097, 0xf3587131, 0x04cf35a4, 0x0b3996c9, 0xfbcb01cb },
109 { 0x09bd59a2, 0xf1e543f9, 0x05655880, 0x0b18f6b2, 0xfbdf1333 },
110 { 0x0abefd0f, 0xf04956ca, 0x060cbb12, 0x0af75e2c, 0xfbf392e8 },
111 { 0x0bdb123e, 0xee806984, 0x06c739fe, 0x0ad4c962, 0xfc0880dd },
112 { 0x0d143a94, 0xec85d287, 0x0796e150, 0x0ab134b0, 0xfc1ddce5 },
113 { 0x0e6d5664, 0xea547598, 0x087df0a0, 0x0a8c9cb6, 0xfc33a6ad },
114 { 0x0fe98a2a, 0xe7e6ba35, 0x097edf83, 0x0a66fe5b, 0xfc49ddc2 },
115 { 0x118c4421, 0xe536813a, 0x0a9c6248, 0x0a4056d7, 0xfc608185 },
116 { 0x1359422e, 0xe23d19eb, 0x0bd96efb, 0x0a18a3bf, 0xfc77912c },
117 { 0x1554982b, 0xdef33645, 0x0d3942bd, 0x09efe312, 0xfc8f0bc1 },
118 { 0x1782b68a, 0xdb50deb1, 0x0ebf676d, 0x09c6133f, 0xfca6f019 },
119 { 0x19e8715d, 0xd74d64fd, 0x106fb999, 0x099b3337, 0xfcbf3cd6 },
120 { 0x1c8b07b8, 0xd2df56ab, 0x124e6ec8, 0x096f4274, 0xfcd7f060 },
121 { 0x1f702b6d, 0xcdfc6e92, 0x14601c10, 0x0942410b, 0xfcf108e5 },
122 { 0x229e0933, 0xc89985cd, 0x16a9bcfa, 0x09142fb5, 0xfd0a8451 },
123 { 0x261b5118, 0xc2aa8409, 0x1930bab6, 0x08e50fdc, 0xfd24604d },
124 { 0x29ef3f5d, 0xbc224f28, 0x1bfaf396, 0x08b4e3aa, 0xfd3e9a3b },
125 { 0x2e21a59b, 0xb4f2ba46, 0x1f0ec2d6, 0x0883ae15, 0xfd592f33 },
126 { 0x32baf44b, 0xad0c7429, 0x227308a3, 0x085172eb, 0xfd741bfd },
127 { 0x37c4448b, 0xa45ef51d, 0x262f3267, 0x081e36dc, 0xfd8f5d14 }
128};
129
130
131static void set_bass(struct emu10k1_card *card, int l, int r)
132{
133 int i;
134
135 l = (l * 40 + 50) / 100;
136 r = (r * 40 + 50) / 100;
137
138 for (i = 0; i < 5; i++)
139 sblive_writeptr(card, (card->is_audigy ? A_GPR_BASE : GPR_BASE) + card->mgr.ctrl_gpr[SOUND_MIXER_BASS][0] + i, 0, bass_table[l][i]);
140}
141
142static void set_treble(struct emu10k1_card *card, int l, int r)
143{
144 int i;
145
146 l = (l * 40 + 50) / 100;
147 r = (r * 40 + 50) / 100;
148
149 for (i = 0; i < 5; i++)
150 sblive_writeptr(card, (card->is_audigy ? A_GPR_BASE : GPR_BASE) + card->mgr.ctrl_gpr[SOUND_MIXER_TREBLE][0] + i , 0, treble_table[l][i]);
151}
152
153const char volume_params[SOUND_MIXER_NRDEVICES]= {
154/* Used by the ac97 driver */
155 [SOUND_MIXER_VOLUME] = VOL_6BIT,
156 [SOUND_MIXER_BASS] = VOL_4BIT,
157 [SOUND_MIXER_TREBLE] = VOL_4BIT,
158 [SOUND_MIXER_PCM] = VOL_5BIT,
159 [SOUND_MIXER_SPEAKER] = VOL_4BIT,
160 [SOUND_MIXER_LINE] = VOL_5BIT,
161 [SOUND_MIXER_MIC] = VOL_5BIT,
162 [SOUND_MIXER_CD] = VOL_5BIT,
163 [SOUND_MIXER_ALTPCM] = VOL_6BIT,
164 [SOUND_MIXER_IGAIN] = VOL_4BIT,
165 [SOUND_MIXER_LINE1] = VOL_5BIT,
166 [SOUND_MIXER_PHONEIN] = VOL_5BIT,
167 [SOUND_MIXER_PHONEOUT] = VOL_6BIT,
168 [SOUND_MIXER_VIDEO] = VOL_5BIT,
169/* Not used by the ac97 driver */
170 [SOUND_MIXER_SYNTH] = VOL_5BIT,
171 [SOUND_MIXER_IMIX] = VOL_5BIT,
172 [SOUND_MIXER_RECLEV] = VOL_5BIT,
173 [SOUND_MIXER_OGAIN] = VOL_5BIT,
174 [SOUND_MIXER_LINE2] = VOL_5BIT,
175 [SOUND_MIXER_LINE3] = VOL_5BIT,
176 [SOUND_MIXER_DIGITAL1] = VOL_5BIT,
177 [SOUND_MIXER_DIGITAL2] = VOL_5BIT,
178 [SOUND_MIXER_DIGITAL3] = VOL_5BIT,
179 [SOUND_MIXER_RADIO] = VOL_5BIT,
180 [SOUND_MIXER_MONITOR] = VOL_5BIT
181};
182
183/* Mixer file operations */
184static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, unsigned long arg)
185{
186 struct mixer_private_ioctl *ctl;
187 struct dsp_patch *patch;
188 u32 size, page;
189 int addr, size_reg, i, ret;
190 unsigned int id, ch;
191 void __user *argp = (void __user *)arg;
192
193 switch (cmd) {
194
195 case SOUND_MIXER_PRIVATE3:
196
197 ctl = kmalloc(sizeof(struct mixer_private_ioctl), GFP_KERNEL);
198 if (ctl == NULL)
199 return -ENOMEM;
200
201 if (copy_from_user(ctl, argp, sizeof(struct mixer_private_ioctl))) {
202 kfree(ctl);
203 return -EFAULT;
204 }
205
206 ret = 0;
207 switch (ctl->cmd) {
208#ifdef DBGEMU
209 case CMD_WRITEFN0:
210 emu10k1_writefn0_2(card, ctl->val[0], ctl->val[1], ctl->val[2]);
211 break;
212#endif
213 case CMD_WRITEPTR:
214#ifdef DBGEMU
215 if (ctl->val[1] >= 0x40 || ctl->val[0] >= 0x1000) {
216#else
217 if (ctl->val[1] >= 0x40 || ctl->val[0] >= 0x1000 || ((ctl->val[0] < 0x100 ) &&
218 //Any register allowed raw access goes here:
219 (ctl->val[0] != A_SPDIF_SAMPLERATE) && (ctl->val[0] != A_DBG)
220 )
221 ) {
222#endif
223 ret = -EINVAL;
224 break;
225 }
226 sblive_writeptr(card, ctl->val[0], ctl->val[1], ctl->val[2]);
227 break;
228
229 case CMD_READFN0:
230 ctl->val[2] = emu10k1_readfn0(card, ctl->val[0]);
231
232 if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl)))
233 ret = -EFAULT;
234
235 break;
236
237 case CMD_READPTR:
238 if (ctl->val[1] >= 0x40 || (ctl->val[0] & 0x7ff) > 0xff) {
239 ret = -EINVAL;
240 break;
241 }
242
243 if ((ctl->val[0] & 0x7ff) > 0x3f)
244 ctl->val[1] = 0x00;
245
246 ctl->val[2] = sblive_readptr(card, ctl->val[0], ctl->val[1]);
247
248 if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl)))
249 ret = -EFAULT;
250
251 break;
252
253 case CMD_SETRECSRC:
254 switch (ctl->val[0]) {
255 case WAVERECORD_AC97:
256 if (card->is_aps) {
257 ret = -EINVAL;
258 break;
259 }
260
261 card->wavein.recsrc = WAVERECORD_AC97;
262 break;
263
264 case WAVERECORD_MIC:
265 card->wavein.recsrc = WAVERECORD_MIC;
266 break;
267
268 case WAVERECORD_FX:
269 card->wavein.recsrc = WAVERECORD_FX;
270 card->wavein.fxwc = ctl->val[1] & 0xffff;
271
272 if (!card->wavein.fxwc)
273 ret = -EINVAL;
274
275 break;
276
277 default:
278 ret = -EINVAL;
279 break;
280 }
281 break;
282
283 case CMD_GETRECSRC:
284 ctl->val[0] = card->wavein.recsrc;
285 ctl->val[1] = card->wavein.fxwc;
286 if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl)))
287 ret = -EFAULT;
288
289 break;
290
291 case CMD_GETVOICEPARAM:
292 ctl->val[0] = card->waveout.send_routing[0];
293 ctl->val[1] = card->waveout.send_dcba[0];
294
295 ctl->val[2] = card->waveout.send_routing[1];
296 ctl->val[3] = card->waveout.send_dcba[1];
297
298 ctl->val[4] = card->waveout.send_routing[2];
299 ctl->val[5] = card->waveout.send_dcba[2];
300
301 if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl)))
302 ret = -EFAULT;
303
304 break;
305
306 case CMD_SETVOICEPARAM:
307 card->waveout.send_routing[0] = ctl->val[0];
308 card->waveout.send_dcba[0] = ctl->val[1];
309
310 card->waveout.send_routing[1] = ctl->val[2];
311 card->waveout.send_dcba[1] = ctl->val[3];
312
313 card->waveout.send_routing[2] = ctl->val[4];
314 card->waveout.send_dcba[2] = ctl->val[5];
315
316 break;
317
318 case CMD_SETMCH_FX:
319 card->mchannel_fx = ctl->val[0] & 0x000f;
320 break;
321
322 case CMD_GETPATCH:
323 if (ctl->val[0] == 0) {
324 if (copy_to_user(argp, &card->mgr.rpatch, sizeof(struct dsp_rpatch)))
325 ret = -EFAULT;
326 } else {
327 if ((ctl->val[0] - 1) / PATCHES_PER_PAGE >= card->mgr.current_pages) {
328 ret = -EINVAL;
329 break;
330 }
331
332 if (copy_to_user(argp, PATCH(&card->mgr, ctl->val[0] - 1), sizeof(struct dsp_patch)))
333 ret = -EFAULT;
334 }
335
336 break;
337
338 case CMD_GETGPR:
339 id = ctl->val[0];
340
341 if (id > NUM_GPRS) {
342 ret = -EINVAL;
343 break;
344 }
345
346 if (copy_to_user(argp, &card->mgr.gpr[id], sizeof(struct dsp_gpr)))
347 ret = -EFAULT;
348
349 break;
350
351 case CMD_GETCTLGPR:
352 addr = emu10k1_find_control_gpr(&card->mgr, (char *) ctl->val, &((char *) ctl->val)[PATCH_NAME_SIZE]);
353 ctl->val[0] = sblive_readptr(card, addr, 0);
354
355 if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl)))
356 ret = -EFAULT;
357
358 break;
359
360 case CMD_SETPATCH:
361 if (ctl->val[0] == 0)
362 memcpy(&card->mgr.rpatch, &ctl->val[1], sizeof(struct dsp_rpatch));
363 else {
364 page = (ctl->val[0] - 1) / PATCHES_PER_PAGE;
365 if (page > MAX_PATCHES_PAGES) {
366 ret = -EINVAL;
367 break;
368 }
369
370 if (page >= card->mgr.current_pages) {
371 for (i = card->mgr.current_pages; i < page + 1; i++) {
372 card->mgr.patch[i] = (void *)__get_free_page(GFP_KERNEL);
373 if(card->mgr.patch[i] == NULL) {
374 card->mgr.current_pages = i;
375 ret = -ENOMEM;
376 break;
377 }
378 memset(card->mgr.patch[i], 0, PAGE_SIZE);
379 }
380 card->mgr.current_pages = page + 1;
381 }
382
383 patch = PATCH(&card->mgr, ctl->val[0] - 1);
384
385 memcpy(patch, &ctl->val[1], sizeof(struct dsp_patch));
386
387 if (patch->code_size == 0) {
388 for(i = page + 1; i < card->mgr.current_pages; i++)
389 free_page((unsigned long) card->mgr.patch[i]);
390
391 card->mgr.current_pages = page + 1;
392 }
393 }
394 break;
395
396 case CMD_SETGPR:
397 if (ctl->val[0] > NUM_GPRS) {
398 ret = -EINVAL;
399 break;
400 }
401
402 memcpy(&card->mgr.gpr[ctl->val[0]], &ctl->val[1], sizeof(struct dsp_gpr));
403 break;
404
405 case CMD_SETCTLGPR:
406 addr = emu10k1_find_control_gpr(&card->mgr, (char *) ctl->val, (char *) ctl->val + PATCH_NAME_SIZE);
407 emu10k1_set_control_gpr(card, addr, *((s32 *)((char *) ctl->val + 2 * PATCH_NAME_SIZE)), 0);
408 break;
409
410 case CMD_SETGPOUT:
411 if ( ((ctl->val[0] > 2) && (!card->is_audigy))
412 || (ctl->val[0] > 15) || ctl->val[1] > 1) {
413 ret= -EINVAL;
414 break;
415 }
416
417 if (card->is_audigy)
418 emu10k1_writefn0(card, (1 << 24) | ((ctl->val[0]) << 16) | A_IOCFG, ctl->val[1]);
419 else
420 emu10k1_writefn0(card, (1 << 24) | (((ctl->val[0]) + 10) << 16) | HCFG, ctl->val[1]);
421 break;
422
423 case CMD_GETGPR2OSS:
424 id = ctl->val[0];
425 ch = ctl->val[1];
426
427 if (id >= SOUND_MIXER_NRDEVICES || ch >= 2) {
428 ret = -EINVAL;
429 break;
430 }
431
432 ctl->val[2] = card->mgr.ctrl_gpr[id][ch];
433
434 if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl)))
435 ret = -EFAULT;
436
437 break;
438
439 case CMD_SETGPR2OSS:
440 id = ctl->val[0];
441 /* 0 == left, 1 == right */
442 ch = ctl->val[1];
443 addr = ctl->val[2];
444
445 if (id >= SOUND_MIXER_NRDEVICES || ch >= 2) {
446 ret = -EINVAL;
447 break;
448 }
449
450 card->mgr.ctrl_gpr[id][ch] = addr;
451
452 if (card->is_aps)
453 break;
454
455 if (addr >= 0) {
456 unsigned int state = card->ac97->mixer_state[id];
457
458 if (ch == 1) {
459 state >>= 8;
460 card->ac97->stereo_mixers |= (1 << id);
461 }
462
463 card->ac97->supported_mixers |= (1 << id);
464
465 if (id == SOUND_MIXER_TREBLE) {
466 set_treble(card, card->ac97->mixer_state[id] & 0xff, (card->ac97->mixer_state[id] >> 8) & 0xff);
467 } else if (id == SOUND_MIXER_BASS) {
468 set_bass(card, card->ac97->mixer_state[id] & 0xff, (card->ac97->mixer_state[id] >> 8) & 0xff);
469 } else
470 emu10k1_set_volume_gpr(card, addr, state & 0xff,
471 volume_params[id]);
472 } else {
473 card->ac97->stereo_mixers &= ~(1 << id);
474 card->ac97->stereo_mixers |= card->ac97_stereo_mixers;
475
476 if (ch == 0) {
477 card->ac97->supported_mixers &= ~(1 << id);
478 card->ac97->supported_mixers |= card->ac97_supported_mixers;
479 }
480 }
481 break;
482
483 case CMD_SETPASSTHROUGH:
484 card->pt.selected = ctl->val[0] ? 1 : 0;
485 if (card->pt.state != PT_STATE_INACTIVE)
486 break;
487
488 card->pt.spcs_to_use = ctl->val[0] & 0x07;
489 break;
490
491 case CMD_PRIVATE3_VERSION:
492 ctl->val[0] = PRIVATE3_VERSION; //private3 version
493 ctl->val[1] = MAJOR_VER; //major driver version
494 ctl->val[2] = MINOR_VER; //minor driver version
495 ctl->val[3] = card->is_audigy; //1=card is audigy
496
497 if (card->is_audigy)
498 ctl->val[4]=emu10k1_readfn0(card, 0x18);
499
500 if (copy_to_user(argp, ctl, sizeof(struct mixer_private_ioctl)))
501 ret = -EFAULT;
502 break;
503
504 case CMD_AC97_BOOST:
505 if (ctl->val[0])
506 emu10k1_ac97_write(card->ac97, 0x18, 0x0);
507 else
508 emu10k1_ac97_write(card->ac97, 0x18, 0x0808);
509 break;
510 default:
511 ret = -EINVAL;
512 break;
513 }
514
515 kfree(ctl);
516 return ret;
517 break;
518
519 case SOUND_MIXER_PRIVATE4:
520
521 if (copy_from_user(&size, argp, sizeof(size)))
522 return -EFAULT;
523
524 DPD(2, "External tram size %#x\n", size);
525
526 if (size > 0x1fffff)
527 return -EINVAL;
528
529 size_reg = 0;
530
531 if (size != 0) {
532 size = (size - 1) >> 14;
533
534 while (size) {
535 size >>= 1;
536 size_reg++;
537 }
538
539 size = 0x4000 << size_reg;
540 }
541
542 DPD(2, "External tram size %#x %#x\n", size, size_reg);
543
544 if (size != card->tankmem.size) {
545 if (card->tankmem.size > 0) {
546 emu10k1_writefn0(card, HCFG_LOCKTANKCACHE, 1);
547
548 sblive_writeptr_tag(card, 0, TCB, 0, TCBS, 0, TAGLIST_END);
549
550 pci_free_consistent(card->pci_dev, card->tankmem.size, card->tankmem.addr, card->tankmem.dma_handle);
551
552 card->tankmem.size = 0;
553 }
554
555 if (size != 0) {
556 card->tankmem.addr = pci_alloc_consistent(card->pci_dev, size, &card->tankmem.dma_handle);
557 if (card->tankmem.addr == NULL)
558 return -ENOMEM;
559
560 card->tankmem.size = size;
561
562 sblive_writeptr_tag(card, 0, TCB, (u32) card->tankmem.dma_handle, TCBS,(u32) size_reg, TAGLIST_END);
563
564 emu10k1_writefn0(card, HCFG_LOCKTANKCACHE, 0);
565 }
566 }
567 return 0;
568 break;
569
570 default:
571 break;
572 }
573
574 return -EINVAL;
575}
576
577static int emu10k1_dsp_mixer(struct emu10k1_card *card, unsigned int oss_mixer, unsigned long arg)
578{
579 unsigned int left, right;
580 int val;
581 int scale;
582
583 card->ac97->modcnt++;
584
585 if (get_user(val, (int __user *)arg))
586 return -EFAULT;
587
588 /* cleanse input a little */
589 right = ((val >> 8) & 0xff);
590 left = (val & 0xff);
591
592 if (right > 100) right = 100;
593 if (left > 100) left = 100;
594
595 card->ac97->mixer_state[oss_mixer] = (right << 8) | left;
596 if (oss_mixer == SOUND_MIXER_TREBLE) {
597 set_treble(card, left, right);
598 return 0;
599 } if (oss_mixer == SOUND_MIXER_BASS) {
600 set_bass(card, left, right);
601 return 0;
602 }
603
604 if (oss_mixer == SOUND_MIXER_VOLUME)
605 scale = 1 << card->ac97->bit_resolution;
606 else
607 scale = volume_params[oss_mixer];
608
609 emu10k1_set_volume_gpr(card, card->mgr.ctrl_gpr[oss_mixer][0], left, scale);
610 emu10k1_set_volume_gpr(card, card->mgr.ctrl_gpr[oss_mixer][1], right, scale);
611
612 if (card->ac97_supported_mixers & (1 << oss_mixer))
613 card->ac97->write_mixer(card->ac97, oss_mixer, left, right);
614
615 return 0;
616}
617
618static int emu10k1_mixer_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
619{
620 int ret;
621 struct emu10k1_card *card = file->private_data;
622 unsigned int oss_mixer = _IOC_NR(cmd);
623
624 ret = -EINVAL;
625 if (!card->is_aps) {
626 if (cmd == SOUND_MIXER_INFO) {
627 mixer_info info;
628
629 strlcpy(info.id, card->ac97->name, sizeof(info.id));
630
631 if (card->is_audigy)
632 strlcpy(info.name, "Audigy - Emu10k1", sizeof(info.name));
633 else
634 strlcpy(info.name, "Creative SBLive - Emu10k1", sizeof(info.name));
635
636 info.modify_counter = card->ac97->modcnt;
637
638 if (copy_to_user((void __user *)arg, &info, sizeof(info)))
639 return -EFAULT;
640
641 return 0;
642 }
643
644 if ((_SIOC_DIR(cmd) == (_SIOC_WRITE|_SIOC_READ)) && oss_mixer <= SOUND_MIXER_NRDEVICES)
645 ret = emu10k1_dsp_mixer(card, oss_mixer, arg);
646 else
647 ret = card->ac97->mixer_ioctl(card->ac97, cmd, arg);
648 }
649
650 if (ret < 0)
651 ret = emu10k1_private_mixer(card, cmd, arg);
652
653 return ret;
654}
655
656static int emu10k1_mixer_open(struct inode *inode, struct file *file)
657{
658 int minor = iminor(inode);
659 struct emu10k1_card *card = NULL;
660 struct list_head *entry;
661
662 DPF(4, "emu10k1_mixer_open()\n");
663
664 list_for_each(entry, &emu10k1_devs) {
665 card = list_entry(entry, struct emu10k1_card, list);
666
667 if (card->ac97->dev_mixer == minor)
668 goto match;
669 }
670
671 return -ENODEV;
672
673 match:
674 file->private_data = card;
675 return 0;
676}
677
678static int emu10k1_mixer_release(struct inode *inode, struct file *file)
679{
680 DPF(4, "emu10k1_mixer_release()\n");
681 return 0;
682}
683
684const struct file_operations emu10k1_mixer_fops = {
685 .owner = THIS_MODULE,
686 .llseek = no_llseek,
687 .ioctl = emu10k1_mixer_ioctl,
688 .open = emu10k1_mixer_open,
689 .release = emu10k1_mixer_release,
690};
diff --git a/sound/oss/emu10k1/passthrough.c b/sound/oss/emu10k1/passthrough.c
deleted file mode 100644
index 6d21d4368dec..000000000000
--- a/sound/oss/emu10k1/passthrough.c
+++ /dev/null
@@ -1,240 +0,0 @@
1/*
2 **********************************************************************
3 * passthrough.c -- Emu10k1 digital passthrough
4 * Copyright (C) 2001 Juha Yrjölä <jyrjola@cc.hut.fi>
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * May 15, 2001 Juha Yrjölä base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#include <linux/module.h>
33#include <linux/poll.h>
34#include <linux/slab.h>
35#include <linux/bitops.h>
36#include <asm/io.h>
37#include <linux/sched.h>
38#include <linux/smp_lock.h>
39
40#include "hwaccess.h"
41#include "cardwo.h"
42#include "cardwi.h"
43#include "recmgr.h"
44#include "irqmgr.h"
45#include "audio.h"
46#include "8010.h"
47
48static void pt_putsamples(struct pt_data *pt, u16 *ptr, u16 left, u16 right)
49{
50 unsigned int idx;
51
52 ptr[pt->copyptr] = left;
53 idx = pt->copyptr + PT_SAMPLES/2;
54 idx %= PT_SAMPLES;
55 ptr[idx] = right;
56}
57
58static inline int pt_can_write(struct pt_data *pt)
59{
60 return pt->blocks_copied < pt->blocks_played + 8;
61}
62
63static int pt_wait_for_write(struct emu10k1_wavedevice *wavedev, int nonblock)
64{
65 struct emu10k1_card *card = wavedev->card;
66 struct pt_data *pt = &card->pt;
67
68 if (nonblock && !pt_can_write(pt))
69 return -EAGAIN;
70 while (!pt_can_write(pt) && pt->state != PT_STATE_INACTIVE) {
71 interruptible_sleep_on(&pt->wait);
72 if (signal_pending(current))
73 return -ERESTARTSYS;
74 }
75 if (pt->state == PT_STATE_INACTIVE)
76 return -EAGAIN;
77
78 return 0;
79}
80
81static int pt_putblock(struct emu10k1_wavedevice *wave_dev, u16 *block, int nonblock)
82{
83 struct woinst *woinst = wave_dev->woinst;
84 struct emu10k1_card *card = wave_dev->card;
85 struct pt_data *pt = &card->pt;
86 u16 *ptr = (u16 *) card->tankmem.addr;
87 int i = 0, r;
88 unsigned long flags;
89
90 r = pt_wait_for_write(wave_dev, nonblock);
91 if (r < 0)
92 return r;
93 spin_lock_irqsave(&card->pt.lock, flags);
94 while (i < PT_BLOCKSAMPLES) {
95 pt_putsamples(pt, ptr, block[2*i], block[2*i+1]);
96 if (pt->copyptr == 0)
97 pt->copyptr = PT_SAMPLES;
98 pt->copyptr--;
99 i++;
100 }
101 woinst->total_copied += PT_BLOCKSIZE;
102 pt->blocks_copied++;
103 if (pt->blocks_copied >= 4 && pt->state != PT_STATE_PLAYING) {
104 DPF(2, "activating digital pass-through playback\n");
105 sblive_writeptr(card, GPR_BASE + pt->enable_gpr, 0, 1);
106 pt->state = PT_STATE_PLAYING;
107 }
108 spin_unlock_irqrestore(&card->pt.lock, flags);
109 return 0;
110}
111
112int emu10k1_pt_setup(struct emu10k1_wavedevice *wave_dev)
113{
114 u32 bits;
115 struct emu10k1_card *card = wave_dev->card;
116 struct pt_data *pt = &card->pt;
117 int i;
118
119 for (i = 0; i < 3; i++) {
120 pt->old_spcs[i] = sblive_readptr(card, SPCS0 + i, 0);
121 if (pt->spcs_to_use & (1 << i)) {
122 DPD(2, "using S/PDIF port %d\n", i);
123 bits = SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
124 SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC | SPCS_GENERATIONSTATUS |
125 0x00001200 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT;
126 if (pt->ac3data)
127 bits |= SPCS_NOTAUDIODATA;
128 sblive_writeptr(card, SPCS0 + i, 0, bits);
129 }
130 }
131 return 0;
132}
133
134ssize_t emu10k1_pt_write(struct file *file, const char __user *buffer, size_t count)
135{
136 struct emu10k1_wavedevice *wave_dev = (struct emu10k1_wavedevice *) file->private_data;
137 struct emu10k1_card *card = wave_dev->card;
138 struct pt_data *pt = &card->pt;
139 int nonblock, i, r, blocks, blocks_copied, bytes_copied = 0;
140
141 DPD(3, "emu10k1_pt_write(): %d bytes\n", count);
142
143 nonblock = file->f_flags & O_NONBLOCK;
144
145 if (card->tankmem.size < PT_SAMPLES*2)
146 return -EFAULT;
147 if (pt->state == PT_STATE_INACTIVE) {
148 DPF(2, "bufptr init\n");
149 pt->playptr = PT_SAMPLES-1;
150 pt->copyptr = PT_INITPTR;
151 pt->blocks_played = pt->blocks_copied = 0;
152 memset(card->tankmem.addr, 0, card->tankmem.size);
153 pt->state = PT_STATE_ACTIVATED;
154 pt->buf = kmalloc(PT_BLOCKSIZE, GFP_KERNEL);
155 pt->prepend_size = 0;
156 if (pt->buf == NULL)
157 return -ENOMEM;
158 emu10k1_pt_setup(wave_dev);
159 }
160 if (pt->prepend_size) {
161 int needed = PT_BLOCKSIZE - pt->prepend_size;
162
163 DPD(3, "prepend size %d, prepending %d bytes\n", pt->prepend_size, needed);
164 if (count < needed) {
165 if (copy_from_user(pt->buf + pt->prepend_size,
166 buffer, count))
167 return -EFAULT;
168 pt->prepend_size += count;
169 DPD(3, "prepend size now %d\n", pt->prepend_size);
170 return count;
171 }
172 if (copy_from_user(pt->buf + pt->prepend_size, buffer, needed))
173 return -EFAULT;
174 r = pt_putblock(wave_dev, (u16 *) pt->buf, nonblock);
175 if (r)
176 return r;
177 bytes_copied += needed;
178 pt->prepend_size = 0;
179 }
180 blocks = (count-bytes_copied)/PT_BLOCKSIZE;
181 blocks_copied = 0;
182 while (blocks > 0) {
183 u16 __user *bufptr = (u16 __user *) buffer + (bytes_copied/2);
184 if (copy_from_user(pt->buf, bufptr, PT_BLOCKSIZE))
185 return -EFAULT;
186 r = pt_putblock(wave_dev, (u16 *)pt->buf, nonblock);
187 if (r) {
188 if (bytes_copied)
189 return bytes_copied;
190 else
191 return r;
192 }
193 bytes_copied += PT_BLOCKSIZE;
194 blocks--;
195 blocks_copied++;
196 }
197 i = count - bytes_copied;
198 if (i) {
199 pt->prepend_size = i;
200 if (copy_from_user(pt->buf, buffer + bytes_copied, i))
201 return -EFAULT;
202 bytes_copied += i;
203 DPD(3, "filling prepend buffer with %d bytes", i);
204 }
205 return bytes_copied;
206}
207
208void emu10k1_pt_stop(struct emu10k1_card *card)
209{
210 struct pt_data *pt = &card->pt;
211 int i;
212
213 if (pt->state != PT_STATE_INACTIVE) {
214 DPF(2, "digital pass-through stopped\n");
215 sblive_writeptr(card, (card->is_audigy ? A_GPR_BASE : GPR_BASE) + pt->enable_gpr, 0, 0);
216 for (i = 0; i < 3; i++) {
217 if (pt->spcs_to_use & (1 << i))
218 sblive_writeptr(card, SPCS0 + i, 0, pt->old_spcs[i]);
219 }
220 pt->state = PT_STATE_INACTIVE;
221 kfree(pt->buf);
222 }
223}
224
225void emu10k1_pt_waveout_update(struct emu10k1_wavedevice *wave_dev)
226{
227 struct woinst *woinst = wave_dev->woinst;
228 struct pt_data *pt = &wave_dev->card->pt;
229 u32 pos;
230
231 if (pt->state == PT_STATE_PLAYING && pt->pos_gpr >= 0) {
232 pos = sblive_readptr(wave_dev->card, GPR_BASE + pt->pos_gpr, 0);
233 if (pos > PT_BLOCKSAMPLES)
234 pos = PT_BLOCKSAMPLES;
235 pos = 4 * (PT_BLOCKSAMPLES - pos);
236 } else
237 pos = 0;
238 woinst->total_played = pt->blocks_played * woinst->buffer.fragment_size + pos;
239 woinst->buffer.hw_pos = pos;
240}
diff --git a/sound/oss/emu10k1/passthrough.h b/sound/oss/emu10k1/passthrough.h
deleted file mode 100644
index 420cc9784251..000000000000
--- a/sound/oss/emu10k1/passthrough.h
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 **********************************************************************
3 * passthrough.h -- Emu10k1 digital passthrough header file
4 * Copyright (C) 2001 Juha Yrjölä <jyrjola@cc.hut.fi>
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * May 15, 2001 Juha Yrjölä base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#ifndef _PASSTHROUGH_H
33#define _PASSTHROUGH_H
34
35#include "audio.h"
36
37/* number of 16-bit stereo samples in XTRAM buffer */
38#define PT_SAMPLES 0x8000
39#define PT_BLOCKSAMPLES 0x400
40#define PT_BLOCKSIZE (PT_BLOCKSAMPLES*4)
41#define PT_BLOCKSIZE_LOG2 12
42#define PT_BLOCKCOUNT (PT_SAMPLES/PT_BLOCKSAMPLES)
43#define PT_INITPTR (PT_SAMPLES/2-1)
44
45#define PT_STATE_INACTIVE 0
46#define PT_STATE_ACTIVATED 1
47#define PT_STATE_PLAYING 2
48
49/* passthrough struct */
50struct pt_data
51{
52 u8 selected, state, spcs_to_use;
53 int intr_gpr, enable_gpr, pos_gpr;
54 u32 blocks_played, blocks_copied, old_spcs[3];
55 u32 playptr, copyptr;
56 u32 prepend_size;
57 u8 *buf;
58 u8 ac3data;
59
60 char *patch_name, *intr_gpr_name, *enable_gpr_name, *pos_gpr_name;
61
62 wait_queue_head_t wait;
63 spinlock_t lock;
64};
65
66/*
67 Passthrough can be done in two methods:
68
69 Method 1 : tram
70 In original emu10k1, we couldn't bypass the sample rate converters. Even at 48kHz
71 (the internal sample rate of the emu10k1) the samples would get messed up.
72 To over come this, samples are copied into the tram and a special dsp patch copies
73 the samples out and generates interrupts when a block has finnished playing.
74
75 Method 2 : Interpolator bypass
76
77 Creative fixed the sample rate convert problem in emu10k1 rev 7 and higher
78 (including the emu10k2 (audigy)). This allows us to use the regular, and much simpler
79 playback method.
80
81
82 In both methods, dsp code is used to mux audio and passthrough. This ensures that the spdif
83 doesn't receive audio and pasthrough data at the same time. The spdif flag SPCS_NOTAUDIODATA
84 is set to tell
85
86 */
87
88// emu10k1 revs greater than or equal to 7 can use method2
89
90#define USE_PT_METHOD2 (card->is_audigy)
91#define USE_PT_METHOD1 !USE_PT_METHOD2
92
93ssize_t emu10k1_pt_write(struct file *file, const char __user *buf, size_t count);
94
95int emu10k1_pt_setup(struct emu10k1_wavedevice *wave_dev);
96void emu10k1_pt_stop(struct emu10k1_card *card);
97void emu10k1_pt_waveout_update(struct emu10k1_wavedevice *wave_dev);
98
99#endif /* _PASSTHROUGH_H */
diff --git a/sound/oss/emu10k1/recmgr.c b/sound/oss/emu10k1/recmgr.c
deleted file mode 100644
index 2ce56180e7d4..000000000000
--- a/sound/oss/emu10k1/recmgr.c
+++ /dev/null
@@ -1,147 +0,0 @@
1/*
2 **********************************************************************
3 * recmgr.c -- Recording manager for emu10k1 driver
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#include <linux/delay.h>
33#include "8010.h"
34#include "recmgr.h"
35
36void emu10k1_reset_record(struct emu10k1_card *card, struct wavein_buffer *buffer)
37{
38 DPF(2, "emu10k1_reset_record()\n");
39
40 sblive_writeptr(card, buffer->sizereg, 0, ADCBS_BUFSIZE_NONE);
41
42 sblive_writeptr(card, buffer->sizereg, 0, buffer->sizeregval);
43
44 while (sblive_readptr(card, buffer->idxreg, 0))
45 udelay(5);
46}
47
48void emu10k1_start_record(struct emu10k1_card *card, struct wavein_buffer *buffer)
49{
50 DPF(2, "emu10k1_start_record()\n");
51
52 if (buffer->adcctl)
53 sblive_writeptr(card, ADCCR, 0, buffer->adcctl);
54}
55
56void emu10k1_stop_record(struct emu10k1_card *card, struct wavein_buffer *buffer)
57{
58 DPF(2, "emu10k1_stop_record()\n");
59
60 /* Disable record transfer */
61 if (buffer->adcctl)
62 sblive_writeptr(card, ADCCR, 0, 0);
63}
64
65void emu10k1_set_record_src(struct emu10k1_card *card, struct wiinst *wiinst)
66{
67 struct wavein_buffer *buffer = &wiinst->buffer;
68
69 DPF(2, "emu10k1_set_record_src()\n");
70
71 switch (wiinst->recsrc) {
72
73 case WAVERECORD_AC97:
74 DPF(2, "recording source: AC97\n");
75 buffer->sizereg = ADCBS;
76 buffer->addrreg = ADCBA;
77 buffer->idxreg = card->is_audigy ? A_ADCIDX_IDX : ADCIDX_IDX;
78
79 switch (wiinst->format.samplingrate) {
80 case 0xBB80:
81 buffer->adcctl = ADCCR_SAMPLERATE_48;
82 break;
83 case 0xAC44:
84 buffer->adcctl = ADCCR_SAMPLERATE_44;
85 break;
86 case 0x7D00:
87 buffer->adcctl = ADCCR_SAMPLERATE_32;
88 break;
89 case 0x5DC0:
90 buffer->adcctl = ADCCR_SAMPLERATE_24;
91 break;
92 case 0x5622:
93 buffer->adcctl = ADCCR_SAMPLERATE_22;
94 break;
95 case 0x3E80:
96 buffer->adcctl = ADCCR_SAMPLERATE_16;
97 break;
98 // FIXME: audigy supports 12kHz recording
99 /*
100 case ????:
101 buffer->adcctl = A_ADCCR_SAMPLERATE_12;
102 break;
103 */
104 case 0x2B11:
105 buffer->adcctl = card->is_audigy ? A_ADCCR_SAMPLERATE_11 : ADCCR_SAMPLERATE_11;
106 break;
107 case 0x1F40:
108 buffer->adcctl = card->is_audigy ? A_ADCCR_SAMPLERATE_8 : ADCCR_SAMPLERATE_8;
109 break;
110 default:
111 BUG();
112 break;
113 }
114
115 buffer->adcctl |= card->is_audigy ? A_ADCCR_LCHANENABLE : ADCCR_LCHANENABLE;
116
117 if (wiinst->format.channels == 2)
118 buffer->adcctl |= card->is_audigy ? A_ADCCR_RCHANENABLE : ADCCR_RCHANENABLE;
119
120 break;
121
122 case WAVERECORD_MIC:
123 DPF(2, "recording source: MIC\n");
124 buffer->sizereg = MICBS;
125 buffer->addrreg = MICBA;
126 buffer->idxreg = MICIDX_IDX;
127 buffer->adcctl = 0;
128 break;
129
130 case WAVERECORD_FX:
131 DPF(2, "recording source: FX\n");
132 buffer->sizereg = FXBS;
133 buffer->addrreg = FXBA;
134 buffer->idxreg = FXIDX_IDX;
135 buffer->adcctl = 0;
136
137 sblive_writeptr(card, FXWC, 0, wiinst->fxwc);
138 break;
139 default:
140 BUG();
141 break;
142 }
143
144 DPD(2, "bus addx: %#lx\n", (unsigned long) buffer->dma_handle);
145
146 sblive_writeptr(card, buffer->addrreg, 0, (u32)buffer->dma_handle);
147}
diff --git a/sound/oss/emu10k1/recmgr.h b/sound/oss/emu10k1/recmgr.h
deleted file mode 100644
index a68766ac4fd5..000000000000
--- a/sound/oss/emu10k1/recmgr.h
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 **********************************************************************
3 * recmgr.h
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#ifndef _RECORDMGR_H
33#define _RECORDMGR_H
34
35#include "hwaccess.h"
36#include "cardwi.h"
37
38/* Recording resources */
39#define WAVERECORD_AC97 0x01
40#define WAVERECORD_MIC 0x02
41#define WAVERECORD_FX 0x03
42
43void emu10k1_reset_record(struct emu10k1_card *card, struct wavein_buffer *buffer);
44void emu10k1_start_record(struct emu10k1_card *, struct wavein_buffer *);
45void emu10k1_stop_record(struct emu10k1_card *, struct wavein_buffer *);
46void emu10k1_set_record_src(struct emu10k1_card *, struct wiinst *wiinst);
47
48#endif /* _RECORDMGR_H */
diff --git a/sound/oss/emu10k1/timer.c b/sound/oss/emu10k1/timer.c
deleted file mode 100644
index d10d30739f41..000000000000
--- a/sound/oss/emu10k1/timer.c
+++ /dev/null
@@ -1,176 +0,0 @@
1
2/*
3 **********************************************************************
4 * timer.c
5 * Copyright (C) 1999, 2000 Creative Labs, inc.
6 *
7 **********************************************************************
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public
20 * License along with this program; if not, write to the Free
21 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
22 * USA.
23 *
24 **********************************************************************
25 */
26
27/* 3/6/2000 Improved support for different timer delays Rui Sousa */
28
29/* 4/3/2000 Implemented timer list using list.h Rui Sousa */
30
31#include "hwaccess.h"
32#include "8010.h"
33#include "irqmgr.h"
34#include "timer.h"
35
36/* Try to schedule only once per fragment */
37
38void emu10k1_timer_irqhandler(struct emu10k1_card *card)
39{
40 struct emu_timer *t;
41 struct list_head *entry;
42
43 spin_lock(&card->timer_lock);
44
45 list_for_each(entry, &card->timers) {
46 t = list_entry(entry, struct emu_timer, list);
47
48 if (t->state & TIMER_STATE_ACTIVE) {
49 t->count++;
50 if (t->count == t->count_max) {
51 t->count = 0;
52 tasklet_hi_schedule(&t->tasklet);
53 }
54 }
55 }
56
57 spin_unlock(&card->timer_lock);
58
59 return;
60}
61
62void emu10k1_timer_install(struct emu10k1_card *card, struct emu_timer *timer, u16 delay)
63{
64 struct emu_timer *t;
65 struct list_head *entry;
66 unsigned long flags;
67
68 if (delay < 5)
69 delay = 5;
70
71 timer->delay = delay;
72 timer->state = TIMER_STATE_INSTALLED;
73
74 spin_lock_irqsave(&card->timer_lock, flags);
75
76 timer->count_max = timer->delay / (card->timer_delay < 1024 ? card->timer_delay : 1024);
77 timer->count = timer->count_max - 1;
78
79 list_add(&timer->list, &card->timers);
80
81 if (card->timer_delay > delay) {
82 if (card->timer_delay == TIMER_STOPPED)
83 emu10k1_irq_enable(card, INTE_INTERVALTIMERENB);
84
85 card->timer_delay = delay;
86 delay = (delay < 1024 ? delay : 1024);
87
88 emu10k1_timer_set(card, delay);
89
90 list_for_each(entry, &card->timers) {
91 t = list_entry(entry, struct emu_timer, list);
92
93 t->count_max = t->delay / delay;
94 /* don't want to think much, just force scheduling
95 on the next interrupt */
96 t->count = t->count_max - 1;
97 }
98
99 DPD(2, "timer rate --> %u\n", delay);
100 }
101
102 spin_unlock_irqrestore(&card->timer_lock, flags);
103
104 return;
105}
106
107void emu10k1_timer_uninstall(struct emu10k1_card *card, struct emu_timer *timer)
108{
109 struct emu_timer *t;
110 struct list_head *entry;
111 u16 delay = TIMER_STOPPED;
112 unsigned long flags;
113
114 if (timer->state == TIMER_STATE_UNINSTALLED)
115 return;
116
117 spin_lock_irqsave(&card->timer_lock, flags);
118
119 list_del(&timer->list);
120
121 list_for_each(entry, &card->timers) {
122 t = list_entry(entry, struct emu_timer, list);
123
124 if (t->delay < delay)
125 delay = t->delay;
126 }
127
128 if (card->timer_delay != delay) {
129 card->timer_delay = delay;
130
131 if (delay == TIMER_STOPPED)
132 emu10k1_irq_disable(card, INTE_INTERVALTIMERENB);
133 else {
134 delay = (delay < 1024 ? delay : 1024);
135
136 emu10k1_timer_set(card, delay);
137
138 list_for_each(entry, &card->timers) {
139 t = list_entry(entry, struct emu_timer, list);
140
141 t->count_max = t->delay / delay;
142 t->count = t->count_max - 1;
143 }
144 }
145
146 DPD(2, "timer rate --> %u\n", delay);
147 }
148
149 spin_unlock_irqrestore(&card->timer_lock, flags);
150
151 timer->state = TIMER_STATE_UNINSTALLED;
152
153 return;
154}
155
156void emu10k1_timer_enable(struct emu10k1_card *card, struct emu_timer *timer)
157{
158 unsigned long flags;
159
160 spin_lock_irqsave(&card->timer_lock, flags);
161 timer->state |= TIMER_STATE_ACTIVE;
162 spin_unlock_irqrestore(&card->timer_lock, flags);
163
164 return;
165}
166
167void emu10k1_timer_disable(struct emu10k1_card *card, struct emu_timer *timer)
168{
169 unsigned long flags;
170
171 spin_lock_irqsave(&card->timer_lock, flags);
172 timer->state &= ~TIMER_STATE_ACTIVE;
173 spin_unlock_irqrestore(&card->timer_lock, flags);
174
175 return;
176}
diff --git a/sound/oss/emu10k1/timer.h b/sound/oss/emu10k1/timer.h
deleted file mode 100644
index b2543b4d53a8..000000000000
--- a/sound/oss/emu10k1/timer.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 **********************************************************************
3 * timer.h
4 * Copyright (C) 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
21 * USA.
22 *
23 **********************************************************************
24 */
25
26
27#ifndef _TIMER_H
28#define _TIMER_H
29
30#include <linux/sched.h>
31#include <linux/interrupt.h>
32#include "hwaccess.h"
33
34struct emu_timer
35{
36 struct list_head list;
37 struct tasklet_struct tasklet;
38 u8 state;
39 u16 count; /* current number of interrupts */
40 u16 count_max; /* number of interrupts needed to schedule the bh */
41 u16 delay; /* timer delay */
42};
43
44void emu10k1_timer_install(struct emu10k1_card *, struct emu_timer *, u16);
45void emu10k1_timer_uninstall(struct emu10k1_card *, struct emu_timer *);
46void emu10k1_timer_enable(struct emu10k1_card *, struct emu_timer *);
47void emu10k1_timer_disable(struct emu10k1_card *, struct emu_timer *);
48
49#define TIMER_STOPPED 0xffff
50#define TIMER_STATE_INSTALLED 0x01
51#define TIMER_STATE_ACTIVE 0x02
52#define TIMER_STATE_UNINSTALLED 0x04
53
54#endif /* _TIMER_H */
diff --git a/sound/oss/emu10k1/voicemgr.c b/sound/oss/emu10k1/voicemgr.c
deleted file mode 100644
index d88b602c07c2..000000000000
--- a/sound/oss/emu10k1/voicemgr.c
+++ /dev/null
@@ -1,398 +0,0 @@
1/*
2 **********************************************************************
3 * voicemgr.c - Voice manager for emu10k1 driver
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#include "voicemgr.h"
33#include "8010.h"
34
35#define PITCH_48000 0x00004000
36#define PITCH_96000 0x00008000
37#define PITCH_85000 0x00007155
38#define PITCH_80726 0x00006ba2
39#define PITCH_67882 0x00005a82
40#define PITCH_57081 0x00004c1c
41
42static u32 emu10k1_select_interprom(struct emu10k1_card *card,
43 struct emu_voice *voice)
44{
45 if(voice->pitch_target==PITCH_48000)
46 return CCCA_INTERPROM_0;
47 else if(voice->pitch_target<PITCH_48000)
48 return CCCA_INTERPROM_1;
49 else if(voice->pitch_target>=PITCH_96000)
50 return CCCA_INTERPROM_0;
51 else if(voice->pitch_target>=PITCH_85000)
52 return CCCA_INTERPROM_6;
53 else if(voice->pitch_target>=PITCH_80726)
54 return CCCA_INTERPROM_5;
55 else if(voice->pitch_target>=PITCH_67882)
56 return CCCA_INTERPROM_4;
57 else if(voice->pitch_target>=PITCH_57081)
58 return CCCA_INTERPROM_3;
59 else
60 return CCCA_INTERPROM_2;
61}
62
63
64/**
65 * emu10k1_voice_alloc_buffer -
66 *
67 * allocates the memory buffer for a voice. Two page tables are kept for each buffer.
68 * One (dma_handle) keeps track of the host memory pages used and the other (virtualpagetable)
69 * is passed to the device so that it can do DMA to host memory.
70 *
71 */
72int emu10k1_voice_alloc_buffer(struct emu10k1_card *card, struct voice_mem *mem, u32 pages)
73{
74 u32 pageindex, pagecount;
75 u32 busaddx;
76 int i;
77
78 DPD(2, "requested pages is: %d\n", pages);
79
80 if ((mem->emupageindex = emu10k1_addxmgr_alloc(pages * PAGE_SIZE, card)) < 0)
81 {
82 DPF(1, "couldn't allocate emu10k1 address space\n");
83 return -1;
84 }
85
86 /* Fill in virtual memory table */
87 for (pagecount = 0; pagecount < pages; pagecount++) {
88 if ((mem->addr[pagecount] = pci_alloc_consistent(card->pci_dev, PAGE_SIZE, &mem->dma_handle[pagecount]))
89 == NULL) {
90 mem->pages = pagecount;
91 DPF(1, "couldn't allocate dma memory\n");
92 return -1;
93 }
94
95 DPD(2, "Virtual Addx: %p\n", mem->addr[pagecount]);
96
97 for (i = 0; i < PAGE_SIZE / EMUPAGESIZE; i++) {
98 busaddx = (u32) mem->dma_handle[pagecount] + i * EMUPAGESIZE;
99
100 DPD(3, "Bus Addx: %#x\n", busaddx);
101
102 pageindex = mem->emupageindex + pagecount * PAGE_SIZE / EMUPAGESIZE + i;
103
104 ((u32 *) card->virtualpagetable.addr)[pageindex] = cpu_to_le32((busaddx * 2) | pageindex);
105 }
106 }
107
108 mem->pages = pagecount;
109
110 return 0;
111}
112
113/**
114 * emu10k1_voice_free_buffer -
115 *
116 * frees the memory buffer for a voice.
117 */
118void emu10k1_voice_free_buffer(struct emu10k1_card *card, struct voice_mem *mem)
119{
120 u32 pagecount, pageindex;
121 int i;
122
123 if (mem->emupageindex < 0)
124 return;
125
126 for (pagecount = 0; pagecount < mem->pages; pagecount++) {
127 pci_free_consistent(card->pci_dev, PAGE_SIZE,
128 mem->addr[pagecount],
129 mem->dma_handle[pagecount]);
130
131 for (i = 0; i < PAGE_SIZE / EMUPAGESIZE; i++) {
132 pageindex = mem->emupageindex + pagecount * PAGE_SIZE / EMUPAGESIZE + i;
133 ((u32 *) card->virtualpagetable.addr)[pageindex] =
134 cpu_to_le32(((u32) card->silentpage.dma_handle * 2) | pageindex);
135 }
136 }
137
138 emu10k1_addxmgr_free(card, mem->emupageindex);
139 mem->emupageindex = -1;
140}
141
142int emu10k1_voice_alloc(struct emu10k1_card *card, struct emu_voice *voice)
143{
144 u8 *voicetable = card->voicetable;
145 int i;
146 unsigned long flags;
147
148 DPF(2, "emu10k1_voice_alloc()\n");
149
150 spin_lock_irqsave(&card->lock, flags);
151
152 if (voice->flags & VOICE_FLAGS_STEREO) {
153 for (i = 0; i < NUM_G; i += 2)
154 if ((voicetable[i] == VOICE_USAGE_FREE) && (voicetable[i + 1] == VOICE_USAGE_FREE)) {
155 voicetable[i] = voice->usage;
156 voicetable[i + 1] = voice->usage;
157 break;
158 }
159 } else {
160 for (i = 0; i < NUM_G; i++)
161 if (voicetable[i] == VOICE_USAGE_FREE) {
162 voicetable[i] = voice->usage;
163 break;
164 }
165 }
166
167 spin_unlock_irqrestore(&card->lock, flags);
168
169 if (i >= NUM_G)
170 return -1;
171
172 voice->card = card;
173 voice->num = i;
174
175 for (i = 0; i < (voice->flags & VOICE_FLAGS_STEREO ? 2 : 1); i++) {
176 DPD(2, " voice allocated -> %d\n", voice->num + i);
177
178 sblive_writeptr_tag(card, voice->num + i, IFATN, 0xffff,
179 DCYSUSV, 0,
180 VTFT, 0x0000ffff,
181 PTRX, 0,
182 TAGLIST_END);
183 }
184
185 return 0;
186}
187
188void emu10k1_voice_free(struct emu_voice *voice)
189{
190 struct emu10k1_card *card = voice->card;
191 int i;
192 unsigned long flags;
193
194 DPF(2, "emu10k1_voice_free()\n");
195
196 if (voice->usage == VOICE_USAGE_FREE)
197 return;
198
199 for (i = 0; i < (voice->flags & VOICE_FLAGS_STEREO ? 2 : 1); i++) {
200 DPD(2, " voice released -> %d\n", voice->num + i);
201
202 sblive_writeptr_tag(card, voice->num + i, DCYSUSV, 0,
203 VTFT, 0x0000ffff,
204 PTRX_PITCHTARGET, 0,
205 CVCF, 0x0000ffff,
206 //CPF, 0,
207 TAGLIST_END);
208
209 sblive_writeptr(card, CPF, voice->num + i, 0);
210 }
211
212 voice->usage = VOICE_USAGE_FREE;
213
214 spin_lock_irqsave(&card->lock, flags);
215
216 card->voicetable[voice->num] = VOICE_USAGE_FREE;
217
218 if (voice->flags & VOICE_FLAGS_STEREO)
219 card->voicetable[voice->num + 1] = VOICE_USAGE_FREE;
220
221 spin_unlock_irqrestore(&card->lock, flags);
222}
223
224void emu10k1_voice_playback_setup(struct emu_voice *voice)
225{
226 struct emu10k1_card *card = voice->card;
227 u32 start;
228 int i;
229
230 DPF(2, "emu10k1_voice_playback_setup()\n");
231
232 if (voice->flags & VOICE_FLAGS_STEREO) {
233 /* Set stereo bit */
234 start = 28;
235 sblive_writeptr(card, CPF, voice->num, CPF_STEREO_MASK);
236 sblive_writeptr(card, CPF, voice->num + 1, CPF_STEREO_MASK);
237 } else {
238 start = 30;
239 sblive_writeptr(card, CPF, voice->num, 0);
240 }
241
242 if(!(voice->flags & VOICE_FLAGS_16BIT))
243 start *= 2;
244
245 voice->start += start;
246
247 for (i = 0; i < (voice->flags & VOICE_FLAGS_STEREO ? 2 : 1); i++) {
248 if (card->is_audigy) {
249 sblive_writeptr(card, A_FXRT1, voice->num + i, voice->params[i].send_routing);
250 sblive_writeptr(card, A_FXRT2, voice->num + i, voice->params[i].send_routing2);
251 sblive_writeptr(card, A_SENDAMOUNTS, voice->num + i, voice->params[i].send_hgfe);
252 } else {
253 sblive_writeptr(card, FXRT, voice->num + i, voice->params[i].send_routing << 16);
254 }
255
256 /* Stop CA */
257 /* Assumption that PT is already 0 so no harm overwriting */
258 sblive_writeptr(card, PTRX, voice->num + i, ((voice->params[i].send_dcba & 0xff) << 8)
259 | ((voice->params[i].send_dcba & 0xff00) >> 8));
260
261 sblive_writeptr_tag(card, voice->num + i,
262 /* CSL, ST, CA */
263 DSL, voice->endloop | (voice->params[i].send_dcba & 0xff000000),
264 PSST, voice->startloop | ((voice->params[i].send_dcba & 0x00ff0000) << 8),
265 CCCA, (voice->start) | emu10k1_select_interprom(card,voice) |
266 ((voice->flags & VOICE_FLAGS_16BIT) ? 0 : CCCA_8BITSELECT),
267 /* Clear filter delay memory */
268 Z1, 0,
269 Z2, 0,
270 /* Invalidate maps */
271 MAPA, MAP_PTI_MASK | ((u32) card->silentpage.dma_handle * 2),
272 MAPB, MAP_PTI_MASK | ((u32) card->silentpage.dma_handle * 2),
273 /* modulation envelope */
274 CVCF, 0x0000ffff,
275 VTFT, 0x0000ffff,
276 ATKHLDM, 0,
277 DCYSUSM, 0x007f,
278 LFOVAL1, 0x8000,
279 LFOVAL2, 0x8000,
280 FMMOD, 0,
281 TREMFRQ, 0,
282 FM2FRQ2, 0,
283 ENVVAL, 0x8000,
284 /* volume envelope */
285 ATKHLDV, 0x7f7f,
286 ENVVOL, 0x8000,
287 /* filter envelope */
288 PEFE_FILTERAMOUNT, 0x7f,
289 /* pitch envelope */
290 PEFE_PITCHAMOUNT, 0, TAGLIST_END);
291
292 voice->params[i].fc_target = 0xffff;
293 }
294}
295
296void emu10k1_voices_start(struct emu_voice *first_voice, unsigned int num_voices, int set)
297{
298 struct emu10k1_card *card = first_voice->card;
299 struct emu_voice *voice;
300 unsigned int voicenum;
301 int j;
302
303 DPF(2, "emu10k1_voices_start()\n");
304
305 for (voicenum = 0; voicenum < num_voices; voicenum++)
306 {
307 voice = first_voice + voicenum;
308
309 if (!set) {
310 u32 cra, ccis, cs, sample;
311 if (voice->flags & VOICE_FLAGS_STEREO) {
312 cra = 64;
313 ccis = 28;
314 cs = 4;
315 } else {
316 cra = 64;
317 ccis = 30;
318 cs = 2;
319 }
320
321 if(voice->flags & VOICE_FLAGS_16BIT) {
322 sample = 0x00000000;
323 } else {
324 sample = 0x80808080;
325 ccis *= 2;
326 }
327
328 for(j = 0; j < cs; j++)
329 sblive_writeptr(card, CD0 + j, voice->num, sample);
330
331 /* Reset cache */
332 sblive_writeptr(card, CCR_CACHEINVALIDSIZE, voice->num, 0);
333 if (voice->flags & VOICE_FLAGS_STEREO)
334 sblive_writeptr(card, CCR_CACHEINVALIDSIZE, voice->num + 1, 0);
335
336 sblive_writeptr(card, CCR_READADDRESS, voice->num, cra);
337
338 if (voice->flags & VOICE_FLAGS_STEREO)
339 sblive_writeptr(card, CCR_READADDRESS, voice->num + 1, cra);
340
341 /* Fill cache */
342 sblive_writeptr(card, CCR_CACHEINVALIDSIZE, voice->num, ccis);
343 }
344
345 for (j = 0; j < (voice->flags & VOICE_FLAGS_STEREO ? 2 : 1); j++) {
346 sblive_writeptr_tag(card, voice->num + j,
347 IFATN, (voice->params[j].initial_fc << 8) | voice->params[j].initial_attn,
348 VTFT, (voice->params[j].volume_target << 16) | voice->params[j].fc_target,
349 CVCF, (voice->params[j].volume_target << 16) | voice->params[j].fc_target,
350 DCYSUSV, (voice->params[j].byampl_env_sustain << 8) | voice->params[j].byampl_env_decay,
351 TAGLIST_END);
352
353 emu10k1_clear_stop_on_loop(card, voice->num + j);
354 }
355 }
356
357
358 for (voicenum = 0; voicenum < num_voices; voicenum++)
359 {
360 voice = first_voice + voicenum;
361
362 for (j = 0; j < (voice->flags & VOICE_FLAGS_STEREO ? 2 : 1); j++) {
363 sblive_writeptr(card, PTRX_PITCHTARGET, voice->num + j, voice->pitch_target);
364
365 if (j == 0)
366 sblive_writeptr(card, CPF_CURRENTPITCH, voice->num, voice->pitch_target);
367
368 sblive_writeptr(card, IP, voice->num + j, voice->initial_pitch);
369 }
370 }
371}
372
373void emu10k1_voices_stop(struct emu_voice *first_voice, int num_voices)
374{
375 struct emu10k1_card *card = first_voice->card;
376 struct emu_voice *voice;
377 unsigned int voice_num;
378 int j;
379
380 DPF(2, "emu10k1_voice_stop()\n");
381
382 for (voice_num = 0; voice_num < num_voices; voice_num++)
383 {
384 voice = first_voice + voice_num;
385
386 for (j = 0; j < (voice->flags & VOICE_FLAGS_STEREO ? 2 : 1); j++) {
387 sblive_writeptr_tag(card, voice->num + j,
388 PTRX_PITCHTARGET, 0,
389 CPF_CURRENTPITCH, 0,
390 IFATN, 0xffff,
391 VTFT, 0x0000ffff,
392 CVCF, 0x0000ffff,
393 IP, 0,
394 TAGLIST_END);
395 }
396 }
397}
398
diff --git a/sound/oss/emu10k1/voicemgr.h b/sound/oss/emu10k1/voicemgr.h
deleted file mode 100644
index 099a8cb7f2c5..000000000000
--- a/sound/oss/emu10k1/voicemgr.h
+++ /dev/null
@@ -1,103 +0,0 @@
1/*
2 **********************************************************************
3 * sblive_voice.h -- EMU Voice Resource Manager header file
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#ifndef _VOICEMGR_H
33#define _VOICEMGR_H
34
35#include "hwaccess.h"
36
37/* struct emu_voice.usage flags */
38#define VOICE_USAGE_FREE 0x01
39#define VOICE_USAGE_MIDI 0x02
40#define VOICE_USAGE_PLAYBACK 0x04
41
42/* struct emu_voice.flags flags */
43#define VOICE_FLAGS_STEREO 0x02
44#define VOICE_FLAGS_16BIT 0x04
45
46struct voice_param
47{
48 /* FX bus amount send */
49
50 u32 send_routing;
51 // audigy only:
52 u32 send_routing2;
53
54 u32 send_dcba;
55 // audigy only:
56 u32 send_hgfe;
57
58
59 u32 initial_fc;
60 u32 fc_target;
61
62 u32 initial_attn;
63 u32 volume_target;
64
65 u32 byampl_env_sustain;
66 u32 byampl_env_decay;
67};
68
69struct voice_mem {
70 int emupageindex;
71 void *addr[BUFMAXPAGES];
72 dma_addr_t dma_handle[BUFMAXPAGES];
73 u32 pages;
74};
75
76struct emu_voice
77{
78 struct emu10k1_card *card;
79 u8 usage; /* Free, MIDI, playback */
80 u8 num; /* Voice ID */
81 u8 flags; /* Stereo/mono, 8/16 bit */
82
83 u32 startloop;
84 u32 endloop;
85 u32 start;
86
87 u32 initial_pitch;
88 u32 pitch_target;
89
90 struct voice_param params[2];
91
92 struct voice_mem mem;
93};
94
95int emu10k1_voice_alloc_buffer(struct emu10k1_card *, struct voice_mem *, u32);
96void emu10k1_voice_free_buffer(struct emu10k1_card *, struct voice_mem *);
97int emu10k1_voice_alloc(struct emu10k1_card *, struct emu_voice *);
98void emu10k1_voice_free(struct emu_voice *);
99void emu10k1_voice_playback_setup(struct emu_voice *);
100void emu10k1_voices_start(struct emu_voice *, unsigned int, int);
101void emu10k1_voices_stop(struct emu_voice *, int);
102
103#endif /* _VOICEMGR_H */
diff --git a/sound/oss/mpu401.c b/sound/oss/mpu401.c
index 2796c0ef985f..a690ca57adb5 100644
--- a/sound/oss/mpu401.c
+++ b/sound/oss/mpu401.c
@@ -1003,7 +1003,8 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner)
1003 } 1003 }
1004 if (!devc->shared_irq) 1004 if (!devc->shared_irq)
1005 { 1005 {
1006 if (request_irq(devc->irq, mpuintr, 0, "mpu401", (void *)m) < 0) 1006 if (request_irq(devc->irq, mpuintr, 0, "mpu401",
1007 hw_config) < 0)
1007 { 1008 {
1008 printk(KERN_WARNING "mpu401: Failed to allocate IRQ%d\n", devc->irq); 1009 printk(KERN_WARNING "mpu401: Failed to allocate IRQ%d\n", devc->irq);
1009 ret = -ENOMEM; 1010 ret = -ENOMEM;
@@ -1112,7 +1113,7 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner)
1112 return 0; 1113 return 0;
1113 1114
1114out_irq: 1115out_irq:
1115 free_irq(devc->irq, (void *)m); 1116 free_irq(devc->irq, hw_config);
1116out_mididev: 1117out_mididev:
1117 sound_unload_mididev(m); 1118 sound_unload_mididev(m);
1118out_err: 1119out_err:
@@ -1227,7 +1228,7 @@ void unload_mpu401(struct address_info *hw_config)
1227 if (n != -1) { 1228 if (n != -1) {
1228 release_region(hw_config->io_base, 2); 1229 release_region(hw_config->io_base, 2);
1229 if (hw_config->always_detect == 0 && hw_config->irq > 0) 1230 if (hw_config->always_detect == 0 && hw_config->irq > 0)
1230 free_irq(hw_config->irq, (void *)n); 1231 free_irq(hw_config->irq, hw_config);
1231 p=mpu401_synth_operations[n]; 1232 p=mpu401_synth_operations[n];
1232 sound_unload_mididev(n); 1233 sound_unload_mididev(n);
1233 sound_unload_timerdev(hw_config->slots[2]); 1234 sound_unload_timerdev(hw_config->slots[2]);
diff --git a/sound/oss/nm256.h b/sound/oss/nm256.h
deleted file mode 100644
index 1dade9033995..000000000000
--- a/sound/oss/nm256.h
+++ /dev/null
@@ -1,292 +0,0 @@
1#ifndef _NM256_H_
2#define _NM256_H_
3
4#include <linux/spinlock.h>
5#include <linux/interrupt.h>
6
7#include "ac97.h"
8
9/* The revisions that we currently handle. */
10enum nm256rev {
11 REV_NM256AV, REV_NM256ZX
12};
13
14/* Per-card structure. */
15struct nm256_info
16{
17 /* Magic number used to verify that this struct is valid. */
18#define NM_MAGIC_SIG 0x55aa00ff
19 int magsig;
20
21 /* Revision number */
22 enum nm256rev rev;
23
24 struct ac97_hwint mdev;
25
26 /* Our audio device numbers. */
27 int dev[2];
28
29 /* The # of times each device has been opened. (Should only be
30 0 or 1). */
31 int opencnt[2];
32
33 /* We use two devices, because we can do simultaneous play and record.
34 This keeps track of which device is being used for what purpose;
35 these are the actual device numbers. */
36 int dev_for_play;
37 int dev_for_record;
38
39 spinlock_t lock;
40
41 /* The mixer device. */
42 int mixer_oss_dev;
43
44 /*
45 * Can only be opened once for each operation. These aren't set
46 * until an actual I/O operation is performed; this allows one
47 * device to be open for read/write without inhibiting I/O to
48 * the other device.
49 */
50 int is_open_play;
51 int is_open_record;
52
53 /* Non-zero if we're currently playing a sample. */
54 int playing;
55 /* Ditto for recording a sample. */
56 int recording;
57
58 /* The two memory ports. */
59 struct nm256_ports {
60 /* Physical address of the port. */
61 u32 physaddr;
62 /* Our mapped-in pointer. */
63 char __iomem *ptr;
64 /* PTR's offset within the physical port. */
65 u32 start_offset;
66 /* And the offset of the end of the buffer. */
67 u32 end_offset;
68 } port[2];
69
70 /* The following are offsets within memory port 1. */
71 u32 coeffBuf;
72 u32 allCoeffBuf;
73
74 /* Record and playback buffers. */
75 u32 abuf1, abuf2;
76
77 /* Offset of the AC97 mixer in memory port 2. */
78 u32 mixer;
79
80 /* Offset of the mixer status register in memory port 2. */
81 u32 mixer_status_offset;
82
83 /* Non-zero if we have written initial values to the mixer. */
84 u8 mixer_values_init;
85
86 /*
87 * Status mask bit; (*mixer_status_loc & mixer_status_mask) == 0 means
88 * it's ready.
89 */
90 u16 mixer_status_mask;
91
92 /* The sizes of the playback and record ring buffers. */
93 u32 playbackBufferSize;
94 u32 recordBufferSize;
95
96 /* Are the coefficient values in the memory cache current? */
97 u8 coeffsCurrent;
98
99 /* For writes, the amount we last wrote. */
100 u32 requested_amt;
101 /* The start of the block currently playing. */
102 u32 curPlayPos;
103
104 /* The amount of data we were requested to record. */
105 u32 requestedRecAmt;
106 /* The offset of the currently-recording block. */
107 u32 curRecPos;
108 /* The destination buffer. */
109 char *recBuf;
110
111 /* Our IRQ number. */
112 int irq;
113
114 /* A flag indicating how many times we've grabbed the IRQ. */
115 int has_irq;
116
117 /* The card interrupt service routine. */
118 irq_handler_t introutine;
119
120 /* Current audio config, cached. */
121 struct sinfo {
122 u32 samplerate;
123 u8 bits;
124 u8 stereo;
125 } sinfo[2]; /* goes with each device */
126
127 /* The cards are stored in a chain; this is the next card. */
128 struct nm256_info *next_card;
129};
130
131/* The BIOS signature. */
132#define NM_SIGNATURE 0x4e4d0000
133/* Signature mask. */
134#define NM_SIG_MASK 0xffff0000
135
136/* Size of the second memory area. */
137#define NM_PORT2_SIZE 4096
138
139/* The base offset of the mixer in the second memory area. */
140#define NM_MIXER_OFFSET 0x600
141
142/* The maximum size of a coefficient entry. */
143#define NM_MAX_COEFFICIENT 0x5000
144
145/* The interrupt register. */
146#define NM_INT_REG 0xa04
147/* And its bits. */
148#define NM_PLAYBACK_INT 0x40
149#define NM_RECORD_INT 0x100
150#define NM_MISC_INT_1 0x4000
151#define NM_MISC_INT_2 0x1
152#define NM_ACK_INT(CARD, X) nm256_writePort16((CARD), 2, NM_INT_REG, (X) << 1)
153
154/* The AV's "mixer ready" status bit and location. */
155#define NM_MIXER_STATUS_OFFSET 0xa04
156#define NM_MIXER_READY_MASK 0x0800
157#define NM_MIXER_PRESENCE 0xa06
158#define NM_PRESENCE_MASK 0x0050
159#define NM_PRESENCE_VALUE 0x0040
160
161/*
162 * For the ZX. It uses the same interrupt register, but it holds 32
163 * bits instead of 16.
164 */
165#define NM2_PLAYBACK_INT 0x10000
166#define NM2_RECORD_INT 0x80000
167#define NM2_MISC_INT_1 0x8
168#define NM2_MISC_INT_2 0x2
169#define NM2_ACK_INT(CARD, X) nm256_writePort32((CARD), 2, NM_INT_REG, (X))
170
171/* The ZX's "mixer ready" status bit and location. */
172#define NM2_MIXER_STATUS_OFFSET 0xa06
173#define NM2_MIXER_READY_MASK 0x0800
174
175/* The playback registers start from here. */
176#define NM_PLAYBACK_REG_OFFSET 0x0
177/* The record registers start from here. */
178#define NM_RECORD_REG_OFFSET 0x200
179
180/* The rate register is located 2 bytes from the start of the register area. */
181#define NM_RATE_REG_OFFSET 2
182
183/* Mono/stereo flag, number of bits on playback, and rate mask. */
184#define NM_RATE_STEREO 1
185#define NM_RATE_BITS_16 2
186#define NM_RATE_MASK 0xf0
187
188/* Playback enable register. */
189#define NM_PLAYBACK_ENABLE_REG (NM_PLAYBACK_REG_OFFSET + 0x1)
190#define NM_PLAYBACK_ENABLE_FLAG 1
191#define NM_PLAYBACK_ONESHOT 2
192#define NM_PLAYBACK_FREERUN 4
193
194/* Mutes the audio output. */
195#define NM_AUDIO_MUTE_REG (NM_PLAYBACK_REG_OFFSET + 0x18)
196#define NM_AUDIO_MUTE_LEFT 0x8000
197#define NM_AUDIO_MUTE_RIGHT 0x0080
198
199/* Recording enable register. */
200#define NM_RECORD_ENABLE_REG (NM_RECORD_REG_OFFSET + 0)
201#define NM_RECORD_ENABLE_FLAG 1
202#define NM_RECORD_FREERUN 2
203
204#define NM_RBUFFER_START (NM_RECORD_REG_OFFSET + 0x4)
205#define NM_RBUFFER_END (NM_RECORD_REG_OFFSET + 0x10)
206#define NM_RBUFFER_WMARK (NM_RECORD_REG_OFFSET + 0xc)
207#define NM_RBUFFER_CURRP (NM_RECORD_REG_OFFSET + 0x8)
208
209#define NM_PBUFFER_START (NM_PLAYBACK_REG_OFFSET + 0x4)
210#define NM_PBUFFER_END (NM_PLAYBACK_REG_OFFSET + 0x14)
211#define NM_PBUFFER_WMARK (NM_PLAYBACK_REG_OFFSET + 0xc)
212#define NM_PBUFFER_CURRP (NM_PLAYBACK_REG_OFFSET + 0x8)
213
214/* A few trivial routines to make it easier to work with the registers
215 on the chip. */
216
217/* This is a common code portion used to fix up the port offsets. */
218#define NM_FIX_PORT \
219 if (port < 1 || port > 2 || card == NULL) \
220 return -1; \
221\
222 if (offset < card->port[port - 1].start_offset \
223 || offset >= card->port[port - 1].end_offset) { \
224 printk (KERN_ERR "Bad access: port %d, offset 0x%x\n", port, offset); \
225 return -1; \
226 } \
227 offset -= card->port[port - 1].start_offset;
228
229#define DEFwritePortX(X, func) \
230static inline int nm256_writePort##X (struct nm256_info *card,\
231 int port, int offset, int value)\
232{\
233 u##X __iomem *addr;\
234\
235 if (nm256_debug > 1)\
236 printk (KERN_DEBUG "Writing 0x%x to %d:0x%x\n", value, port, offset);\
237\
238 NM_FIX_PORT;\
239\
240 addr = (u##X __iomem *)(card->port[port - 1].ptr + offset);\
241 func (value, addr);\
242 return 0;\
243}
244
245DEFwritePortX (8, writeb)
246DEFwritePortX (16, writew)
247DEFwritePortX (32, writel)
248
249#define DEFreadPortX(X, func) \
250static inline u##X nm256_readPort##X (struct nm256_info *card,\
251 int port, int offset)\
252{\
253 u##X __iomem *addr;\
254\
255 NM_FIX_PORT\
256\
257 addr = (u##X __iomem *)(card->port[port - 1].ptr + offset);\
258 return func(addr);\
259}
260
261DEFreadPortX (8, readb)
262DEFreadPortX (16, readw)
263DEFreadPortX (32, readl)
264
265static inline int
266nm256_writeBuffer8 (struct nm256_info *card, u8 *src, int port, int offset,
267 int amt)
268{
269 NM_FIX_PORT;
270 memcpy_toio (card->port[port - 1].ptr + offset, src, amt);
271 return 0;
272}
273
274static inline int
275nm256_readBuffer8 (struct nm256_info *card, u8 *dst, int port, int offset,
276 int amt)
277{
278 NM_FIX_PORT;
279 memcpy_fromio (dst, card->port[port - 1].ptr + offset, amt);
280 return 0;
281}
282
283/* Returns a non-zero value if we should use the coefficient cache. */
284static int nm256_cachedCoefficients (struct nm256_info *card);
285
286#endif
287
288/*
289 * Local variables:
290 * c-basic-offset: 4
291 * End:
292 */
diff --git a/sound/oss/nm256_audio.c b/sound/oss/nm256_audio.c
deleted file mode 100644
index 44cd15505001..000000000000
--- a/sound/oss/nm256_audio.c
+++ /dev/null
@@ -1,1662 +0,0 @@
1/*
2 * Audio driver for the NeoMagic 256AV and 256ZX chipsets in native
3 * mode, with AC97 mixer support.
4 *
5 * Overall design and parts of this code stolen from vidc_*.c and
6 * skeleton.c.
7 *
8 * Yeah, there are a lot of magic constants in here. You tell ME what
9 * they are. I just get this stuff psychically, remember?
10 *
11 * This driver was written by someone who wishes to remain anonymous.
12 * It is in the public domain, so share and enjoy. Try to make a profit
13 * off of it; go on, I dare you.
14 *
15 * Changes:
16 * 11-10-2000 Bartlomiej Zolnierkiewicz <bkz@linux-ide.org>
17 * Added some __init
18 * 19-04-2001 Marcus Meissner <mm@caldera.de>
19 * Ported to 2.4 PCI API.
20 */
21
22#include <linux/pci.h>
23#include <linux/init.h>
24#include <linux/interrupt.h>
25#include <linux/kernel.h>
26#include <linux/module.h>
27#include <linux/delay.h>
28#include <linux/spinlock.h>
29#include "sound_config.h"
30
31static int nm256_debug;
32static int force_load;
33
34#include "nm256.h"
35#include "nm256_coeff.h"
36
37/*
38 * The size of the playback reserve. When the playback buffer has less
39 * than NM256_PLAY_WMARK_SIZE bytes to output, we request a new
40 * buffer.
41 */
42#define NM256_PLAY_WMARK_SIZE 512
43
44static struct audio_driver nm256_audio_driver;
45
46static int nm256_grabInterrupt (struct nm256_info *card);
47static int nm256_releaseInterrupt (struct nm256_info *card);
48static irqreturn_t nm256_interrupt (int irq, void *dev_id);
49static irqreturn_t nm256_interrupt_zx (int irq, void *dev_id);
50
51/* These belong in linux/pci.h. */
52#define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005
53#define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006
54#define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016
55
56/* List of cards. */
57static struct nm256_info *nmcard_list;
58
59/* Release the mapped-in memory for CARD. */
60static void
61nm256_release_ports (struct nm256_info *card)
62{
63 int x;
64
65 for (x = 0; x < 2; x++) {
66 if (card->port[x].ptr != NULL) {
67 iounmap (card->port[x].ptr);
68 card->port[x].ptr = NULL;
69 }
70 }
71}
72
73/*
74 * Map in the memory ports for CARD, if they aren't already mapped in
75 * and have been configured. If successful, a zero value is returned;
76 * otherwise any previously mapped-in areas are released and a non-zero
77 * value is returned.
78 *
79 * This is invoked twice, once for each port. Ideally it would only be
80 * called once, but we now need to map in the second port in order to
81 * check how much memory the card has on the 256ZX.
82 */
83static int
84nm256_remap_ports (struct nm256_info *card)
85{
86 int x;
87
88 for (x = 0; x < 2; x++) {
89 if (card->port[x].ptr == NULL && card->port[x].end_offset > 0) {
90 u32 physaddr
91 = card->port[x].physaddr + card->port[x].start_offset;
92 u32 size
93 = card->port[x].end_offset - card->port[x].start_offset;
94
95 card->port[x].ptr = ioremap_nocache (physaddr, size);
96
97 if (card->port[x].ptr == NULL) {
98 printk (KERN_ERR "NM256: Unable to remap port %d\n", x + 1);
99 nm256_release_ports (card);
100 return -1;
101 }
102 }
103 }
104 return 0;
105}
106
107/* Locate the card in our list. */
108static struct nm256_info *
109nm256_find_card (int dev)
110{
111 struct nm256_info *card;
112
113 for (card = nmcard_list; card != NULL; card = card->next_card)
114 if (card->dev[0] == dev || card->dev[1] == dev)
115 return card;
116
117 return NULL;
118}
119
120/*
121 * Ditto, but find the card struct corresponding to the mixer device DEV
122 * instead.
123 */
124static struct nm256_info *
125nm256_find_card_for_mixer (int dev)
126{
127 struct nm256_info *card;
128
129 for (card = nmcard_list; card != NULL; card = card->next_card)
130 if (card->mixer_oss_dev == dev)
131 return card;
132
133 return NULL;
134}
135
136static int usecache;
137static int buffertop;
138
139/* Check to see if we're using the bank of cached coefficients. */
140static int
141nm256_cachedCoefficients (struct nm256_info *card)
142{
143 return usecache;
144}
145
146/* The actual rates supported by the card. */
147static int samplerates[9] = {
148 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 99999999
149};
150
151/*
152 * Set the card samplerate, word size and stereo mode to correspond to
153 * the settings in the CARD struct for the specified device in DEV.
154 * We keep two separate sets of information, one for each device; the
155 * hardware is not actually configured until a read or write is
156 * attempted.
157 */
158
159static int
160nm256_setInfo (int dev, struct nm256_info *card)
161{
162 int x;
163 int w;
164 int targetrate;
165
166 if (card->dev[0] == dev)
167 w = 0;
168 else if (card->dev[1] == dev)
169 w = 1;
170 else
171 return -ENODEV;
172
173 targetrate = card->sinfo[w].samplerate;
174
175 if ((card->sinfo[w].bits != 8 && card->sinfo[w].bits != 16)
176 || targetrate < samplerates[0]
177 || targetrate > samplerates[7])
178 return -EINVAL;
179
180 for (x = 0; x < 8; x++)
181 if (targetrate < ((samplerates[x] + samplerates[x + 1]) / 2))
182 break;
183
184 if (x < 8) {
185 u8 ratebits = ((x << 4) & NM_RATE_MASK);
186 if (card->sinfo[w].bits == 16)
187 ratebits |= NM_RATE_BITS_16;
188 if (card->sinfo[w].stereo)
189 ratebits |= NM_RATE_STEREO;
190
191 card->sinfo[w].samplerate = samplerates[x];
192
193
194 if (card->dev_for_play == dev && card->playing) {
195 if (nm256_debug)
196 printk (KERN_DEBUG "Setting play ratebits to 0x%x\n",
197 ratebits);
198 nm256_loadCoefficient (card, 0, x);
199 nm256_writePort8 (card, 2,
200 NM_PLAYBACK_REG_OFFSET + NM_RATE_REG_OFFSET,
201 ratebits);
202 }
203
204 if (card->dev_for_record == dev && card->recording) {
205 if (nm256_debug)
206 printk (KERN_DEBUG "Setting record ratebits to 0x%x\n",
207 ratebits);
208 nm256_loadCoefficient (card, 1, x);
209 nm256_writePort8 (card, 2,
210 NM_RECORD_REG_OFFSET + NM_RATE_REG_OFFSET,
211 ratebits);
212 }
213 return 0;
214 }
215 else
216 return -EINVAL;
217}
218
219/* Start the play process going. */
220static void
221startPlay (struct nm256_info *card)
222{
223 if (! card->playing) {
224 card->playing = 1;
225 if (nm256_grabInterrupt (card) == 0) {
226 nm256_setInfo (card->dev_for_play, card);
227
228 /* Enable playback engine and interrupts. */
229 nm256_writePort8 (card, 2, NM_PLAYBACK_ENABLE_REG,
230 NM_PLAYBACK_ENABLE_FLAG | NM_PLAYBACK_FREERUN);
231
232 /* Enable both channels. */
233 nm256_writePort16 (card, 2, NM_AUDIO_MUTE_REG, 0x0);
234 }
235 }
236}
237
238/*
239 * Request one chunk of AMT bytes from the recording device. When the
240 * operation is complete, the data will be copied into BUFFER and the
241 * function DMAbuf_inputintr will be invoked.
242 */
243
244static void
245nm256_startRecording (struct nm256_info *card, char *buffer, u32 amt)
246{
247 u32 endpos;
248 int enableEngine = 0;
249 u32 ringsize = card->recordBufferSize;
250 unsigned long flags;
251
252 if (amt > (ringsize / 2)) {
253 /*
254 * Of course this won't actually work right, because the
255 * caller is going to assume we will give what we got asked
256 * for.
257 */
258 printk (KERN_ERR "NM256: Read request too large: %d\n", amt);
259 amt = ringsize / 2;
260 }
261
262 if (amt < 8) {
263 printk (KERN_ERR "NM256: Read request too small; %d\n", amt);
264 return;
265 }
266
267 spin_lock_irqsave(&card->lock,flags);
268 /*
269 * If we're not currently recording, set up the start and end registers
270 * for the recording engine.
271 */
272 if (! card->recording) {
273 card->recording = 1;
274 if (nm256_grabInterrupt (card) == 0) {
275 card->curRecPos = 0;
276 nm256_setInfo (card->dev_for_record, card);
277 nm256_writePort32 (card, 2, NM_RBUFFER_START, card->abuf2);
278 nm256_writePort32 (card, 2, NM_RBUFFER_END,
279 card->abuf2 + ringsize);
280
281 nm256_writePort32 (card, 2, NM_RBUFFER_CURRP,
282 card->abuf2 + card->curRecPos);
283 enableEngine = 1;
284 }
285 else {
286 /* Not sure what else to do here. */
287 spin_unlock_irqrestore(&card->lock,flags);
288 return;
289 }
290 }
291
292 /*
293 * If we happen to go past the end of the buffer a bit (due to a
294 * delayed interrupt) it's OK. So might as well set the watermark
295 * right at the end of the data we want.
296 */
297 endpos = card->abuf2 + ((card->curRecPos + amt) % ringsize);
298
299 card->recBuf = buffer;
300 card->requestedRecAmt = amt;
301 nm256_writePort32 (card, 2, NM_RBUFFER_WMARK, endpos);
302 /* Enable recording engine and interrupts. */
303 if (enableEngine)
304 nm256_writePort8 (card, 2, NM_RECORD_ENABLE_REG,
305 NM_RECORD_ENABLE_FLAG | NM_RECORD_FREERUN);
306
307 spin_unlock_irqrestore(&card->lock,flags);
308}
309
310/* Stop the play engine. */
311static void
312stopPlay (struct nm256_info *card)
313{
314 /* Shut off sound from both channels. */
315 nm256_writePort16 (card, 2, NM_AUDIO_MUTE_REG,
316 NM_AUDIO_MUTE_LEFT | NM_AUDIO_MUTE_RIGHT);
317 /* Disable play engine. */
318 nm256_writePort8 (card, 2, NM_PLAYBACK_ENABLE_REG, 0);
319 if (card->playing) {
320 nm256_releaseInterrupt (card);
321
322 /* Reset the relevant state bits. */
323 card->playing = 0;
324 card->curPlayPos = 0;
325 }
326}
327
328/* Stop recording. */
329static void
330stopRecord (struct nm256_info *card)
331{
332 /* Disable recording engine. */
333 nm256_writePort8 (card, 2, NM_RECORD_ENABLE_REG, 0);
334
335 if (card->recording) {
336 nm256_releaseInterrupt (card);
337
338 card->recording = 0;
339 card->curRecPos = 0;
340 }
341}
342
343/*
344 * Ring buffers, man. That's where the hip-hop, wild-n-wooly action's at.
345 * 1972? (Well, I suppose it was cheep-n-easy to implement.)
346 *
347 * Write AMT bytes of BUFFER to the playback ring buffer, and start the
348 * playback engine running. It will only accept up to 1/2 of the total
349 * size of the ring buffer. No check is made that we're about to overwrite
350 * the currently-playing sample.
351 */
352
353static void
354nm256_write_block (struct nm256_info *card, char *buffer, u32 amt)
355{
356 u32 ringsize = card->playbackBufferSize;
357 u32 endstop;
358 unsigned long flags;
359
360 if (amt > (ringsize / 2)) {
361 printk (KERN_ERR "NM256: Write request too large: %d\n", amt);
362 amt = (ringsize / 2);
363 }
364
365 if (amt < NM256_PLAY_WMARK_SIZE) {
366 printk (KERN_ERR "NM256: Write request too small: %d\n", amt);
367 return;
368 }
369
370 card->curPlayPos %= ringsize;
371
372 card->requested_amt = amt;
373
374 spin_lock_irqsave(&card->lock,flags);
375
376 if ((card->curPlayPos + amt) >= ringsize) {
377 u32 rem = ringsize - card->curPlayPos;
378
379 nm256_writeBuffer8 (card, buffer, 1,
380 card->abuf1 + card->curPlayPos,
381 rem);
382 if (amt > rem)
383 nm256_writeBuffer8 (card, buffer + rem, 1, card->abuf1,
384 amt - rem);
385 }
386 else
387 nm256_writeBuffer8 (card, buffer, 1,
388 card->abuf1 + card->curPlayPos,
389 amt);
390
391 /*
392 * Setup the start-n-stop-n-limit registers, and start that engine
393 * goin'.
394 *
395 * Normally we just let it wrap around to avoid the click-click
396 * action scene.
397 */
398 if (! card->playing) {
399 /* The PBUFFER_END register in this case points to one sample
400 before the end of the buffer. */
401 int w = (card->dev_for_play == card->dev[0] ? 0 : 1);
402 int sampsize = (card->sinfo[w].bits == 16 ? 2 : 1);
403
404 if (card->sinfo[w].stereo)
405 sampsize *= 2;
406
407 /* Need to set the not-normally-changing-registers up. */
408 nm256_writePort32 (card, 2, NM_PBUFFER_START,
409 card->abuf1 + card->curPlayPos);
410 nm256_writePort32 (card, 2, NM_PBUFFER_END,
411 card->abuf1 + ringsize - sampsize);
412 nm256_writePort32 (card, 2, NM_PBUFFER_CURRP,
413 card->abuf1 + card->curPlayPos);
414 }
415 endstop = (card->curPlayPos + amt - NM256_PLAY_WMARK_SIZE) % ringsize;
416 nm256_writePort32 (card, 2, NM_PBUFFER_WMARK, card->abuf1 + endstop);
417
418 if (! card->playing)
419 startPlay (card);
420
421 spin_unlock_irqrestore(&card->lock,flags);
422}
423
424/* We just got a card playback interrupt; process it. */
425static void
426nm256_get_new_block (struct nm256_info *card)
427{
428 /* Check to see how much got played so far. */
429 u32 amt = nm256_readPort32 (card, 2, NM_PBUFFER_CURRP) - card->abuf1;
430
431 if (amt >= card->playbackBufferSize) {
432 printk (KERN_ERR "NM256: Sound playback pointer invalid!\n");
433 amt = 0;
434 }
435
436 if (amt < card->curPlayPos)
437 amt = (card->playbackBufferSize - card->curPlayPos) + amt;
438 else
439 amt -= card->curPlayPos;
440
441 if (card->requested_amt > (amt + NM256_PLAY_WMARK_SIZE)) {
442 u32 endstop =
443 card->curPlayPos + card->requested_amt - NM256_PLAY_WMARK_SIZE;
444 nm256_writePort32 (card, 2, NM_PBUFFER_WMARK, card->abuf1 + endstop);
445 }
446 else {
447 card->curPlayPos += card->requested_amt;
448 /* Get a new block to write. This will eventually invoke
449 nm256_write_block () or stopPlay (). */
450 DMAbuf_outputintr (card->dev_for_play, 1);
451 }
452}
453
454/*
455 * Read the last-recorded block from the ring buffer, copy it into the
456 * saved buffer pointer, and invoke DMAuf_inputintr() with the recording
457 * device.
458 */
459
460static void
461nm256_read_block (struct nm256_info *card)
462{
463 /* Grab the current position of the recording pointer. */
464 u32 currptr = nm256_readPort32 (card, 2, NM_RBUFFER_CURRP) - card->abuf2;
465 u32 amtToRead = card->requestedRecAmt;
466 u32 ringsize = card->recordBufferSize;
467
468 if (currptr >= card->recordBufferSize) {
469 printk (KERN_ERR "NM256: Sound buffer record pointer invalid!\n");
470 currptr = 0;
471 }
472
473 /*
474 * This test is probably redundant; we shouldn't be here unless
475 * it's true.
476 */
477 if (card->recording) {
478 /* If we wrapped around, copy everything from the start of our
479 recording buffer to the end of the buffer. */
480 if (currptr < card->curRecPos) {
481 u32 amt = min (ringsize - card->curRecPos, amtToRead);
482
483 nm256_readBuffer8 (card, card->recBuf, 1,
484 card->abuf2 + card->curRecPos,
485 amt);
486 amtToRead -= amt;
487 card->curRecPos += amt;
488 card->recBuf += amt;
489 if (card->curRecPos == ringsize)
490 card->curRecPos = 0;
491 }
492
493 if ((card->curRecPos < currptr) && (amtToRead > 0)) {
494 u32 amt = min (currptr - card->curRecPos, amtToRead);
495 nm256_readBuffer8 (card, card->recBuf, 1,
496 card->abuf2 + card->curRecPos, amt);
497 card->curRecPos = ((card->curRecPos + amt) % ringsize);
498 }
499 card->recBuf = NULL;
500 card->requestedRecAmt = 0;
501 DMAbuf_inputintr (card->dev_for_record);
502 }
503}
504
505/*
506 * Initialize the hardware.
507 */
508static void
509nm256_initHw (struct nm256_info *card)
510{
511 /* Reset everything. */
512 nm256_writePort8 (card, 2, 0x0, 0x11);
513 nm256_writePort16 (card, 2, 0x214, 0);
514
515 stopRecord (card);
516 stopPlay (card);
517}
518
519/*
520 * Handle a potential interrupt for the device referred to by DEV_ID.
521 *
522 * I don't like the cut-n-paste job here either between the two routines,
523 * but there are sufficient differences between the two interrupt handlers
524 * that parameterizing it isn't all that great either. (Could use a macro,
525 * I suppose...yucky bleah.)
526 */
527
528static irqreturn_t
529nm256_interrupt (int irq, void *dev_id)
530{
531 struct nm256_info *card = (struct nm256_info *)dev_id;
532 u16 status;
533 static int badintrcount;
534 int handled = 0;
535
536 if ((card == NULL) || (card->magsig != NM_MAGIC_SIG)) {
537 printk (KERN_ERR "NM256: Bad card pointer\n");
538 return IRQ_NONE;
539 }
540
541 status = nm256_readPort16 (card, 2, NM_INT_REG);
542
543 /* Not ours. */
544 if (status == 0) {
545 if (badintrcount++ > 1000) {
546 /*
547 * I'm not sure if the best thing is to stop the card from
548 * playing or just release the interrupt (after all, we're in
549 * a bad situation, so doing fancy stuff may not be such a good
550 * idea).
551 *
552 * I worry about the card engine continuing to play noise
553 * over and over, however--that could become a very
554 * obnoxious problem. And we know that when this usually
555 * happens things are fairly safe, it just means the user's
556 * inserted a PCMCIA card and someone's spamming us with IRQ 9s.
557 */
558
559 handled = 1;
560 if (card->playing)
561 stopPlay (card);
562 if (card->recording)
563 stopRecord (card);
564 badintrcount = 0;
565 }
566 return IRQ_RETVAL(handled);
567 }
568
569 badintrcount = 0;
570
571 /* Rather boring; check for individual interrupts and process them. */
572
573 if (status & NM_PLAYBACK_INT) {
574 handled = 1;
575 status &= ~NM_PLAYBACK_INT;
576 NM_ACK_INT (card, NM_PLAYBACK_INT);
577
578 if (card->playing)
579 nm256_get_new_block (card);
580 }
581
582 if (status & NM_RECORD_INT) {
583 handled = 1;
584 status &= ~NM_RECORD_INT;
585 NM_ACK_INT (card, NM_RECORD_INT);
586
587 if (card->recording)
588 nm256_read_block (card);
589 }
590
591 if (status & NM_MISC_INT_1) {
592 u8 cbyte;
593
594 handled = 1;
595 status &= ~NM_MISC_INT_1;
596 printk (KERN_ERR "NM256: Got misc interrupt #1\n");
597 NM_ACK_INT (card, NM_MISC_INT_1);
598 nm256_writePort16 (card, 2, NM_INT_REG, 0x8000);
599 cbyte = nm256_readPort8 (card, 2, 0x400);
600 nm256_writePort8 (card, 2, 0x400, cbyte | 2);
601 }
602
603 if (status & NM_MISC_INT_2) {
604 u8 cbyte;
605
606 handled = 1;
607 status &= ~NM_MISC_INT_2;
608 printk (KERN_ERR "NM256: Got misc interrupt #2\n");
609 NM_ACK_INT (card, NM_MISC_INT_2);
610 cbyte = nm256_readPort8 (card, 2, 0x400);
611 nm256_writePort8 (card, 2, 0x400, cbyte & ~2);
612 }
613
614 /* Unknown interrupt. */
615 if (status) {
616 handled = 1;
617 printk (KERN_ERR "NM256: Fire in the hole! Unknown status 0x%x\n",
618 status);
619 /* Pray. */
620 NM_ACK_INT (card, status);
621 }
622 return IRQ_RETVAL(handled);
623}
624
625/*
626 * Handle a potential interrupt for the device referred to by DEV_ID.
627 * This handler is for the 256ZX, and is very similar to the non-ZX
628 * routine.
629 */
630
631static irqreturn_t
632nm256_interrupt_zx (int irq, void *dev_id)
633{
634 struct nm256_info *card = (struct nm256_info *)dev_id;
635 u32 status;
636 static int badintrcount;
637 int handled = 0;
638
639 if ((card == NULL) || (card->magsig != NM_MAGIC_SIG)) {
640 printk (KERN_ERR "NM256: Bad card pointer\n");
641 return IRQ_NONE;
642 }
643
644 status = nm256_readPort32 (card, 2, NM_INT_REG);
645
646 /* Not ours. */
647 if (status == 0) {
648 if (badintrcount++ > 1000) {
649 printk (KERN_ERR "NM256: Releasing interrupt, over 1000 invalid interrupts\n");
650 /*
651 * I'm not sure if the best thing is to stop the card from
652 * playing or just release the interrupt (after all, we're in
653 * a bad situation, so doing fancy stuff may not be such a good
654 * idea).
655 *
656 * I worry about the card engine continuing to play noise
657 * over and over, however--that could become a very
658 * obnoxious problem. And we know that when this usually
659 * happens things are fairly safe, it just means the user's
660 * inserted a PCMCIA card and someone's spamming us with
661 * IRQ 9s.
662 */
663
664 handled = 1;
665 if (card->playing)
666 stopPlay (card);
667 if (card->recording)
668 stopRecord (card);
669 badintrcount = 0;
670 }
671 return IRQ_RETVAL(handled);
672 }
673
674 badintrcount = 0;
675
676 /* Rather boring; check for individual interrupts and process them. */
677
678 if (status & NM2_PLAYBACK_INT) {
679 handled = 1;
680 status &= ~NM2_PLAYBACK_INT;
681 NM2_ACK_INT (card, NM2_PLAYBACK_INT);
682
683 if (card->playing)
684 nm256_get_new_block (card);
685 }
686
687 if (status & NM2_RECORD_INT) {
688 handled = 1;
689 status &= ~NM2_RECORD_INT;
690 NM2_ACK_INT (card, NM2_RECORD_INT);
691
692 if (card->recording)
693 nm256_read_block (card);
694 }
695
696 if (status & NM2_MISC_INT_1) {
697 u8 cbyte;
698
699 handled = 1;
700 status &= ~NM2_MISC_INT_1;
701 printk (KERN_ERR "NM256: Got misc interrupt #1\n");
702 NM2_ACK_INT (card, NM2_MISC_INT_1);
703 cbyte = nm256_readPort8 (card, 2, 0x400);
704 nm256_writePort8 (card, 2, 0x400, cbyte | 2);
705 }
706
707 if (status & NM2_MISC_INT_2) {
708 u8 cbyte;
709
710 handled = 1;
711 status &= ~NM2_MISC_INT_2;
712 printk (KERN_ERR "NM256: Got misc interrupt #2\n");
713 NM2_ACK_INT (card, NM2_MISC_INT_2);
714 cbyte = nm256_readPort8 (card, 2, 0x400);
715 nm256_writePort8 (card, 2, 0x400, cbyte & ~2);
716 }
717
718 /* Unknown interrupt. */
719 if (status) {
720 handled = 1;
721 printk (KERN_ERR "NM256: Fire in the hole! Unknown status 0x%x\n",
722 status);
723 /* Pray. */
724 NM2_ACK_INT (card, status);
725 }
726 return IRQ_RETVAL(handled);
727}
728
729/*
730 * Request our interrupt.
731 */
732static int
733nm256_grabInterrupt (struct nm256_info *card)
734{
735 if (card->has_irq++ == 0) {
736 if (request_irq (card->irq, card->introutine, IRQF_SHARED,
737 "NM256_audio", card) < 0) {
738 printk (KERN_ERR "NM256: can't obtain IRQ %d\n", card->irq);
739 return -1;
740 }
741 }
742 return 0;
743}
744
745/*
746 * Release our interrupt.
747 */
748static int
749nm256_releaseInterrupt (struct nm256_info *card)
750{
751 if (card->has_irq <= 0) {
752 printk (KERN_ERR "nm256: too many calls to releaseInterrupt\n");
753 return -1;
754 }
755 card->has_irq--;
756 if (card->has_irq == 0) {
757 free_irq (card->irq, card);
758 }
759 return 0;
760}
761
762/*
763 * Waits for the mixer to become ready to be written; returns a zero value
764 * if it timed out.
765 */
766
767static int
768nm256_isReady (struct ac97_hwint *dev)
769{
770 struct nm256_info *card = (struct nm256_info *)dev->driver_private;
771 int t2 = 10;
772 u32 testaddr;
773 u16 testb;
774 int done = 0;
775
776 if (card->magsig != NM_MAGIC_SIG) {
777 printk (KERN_ERR "NM256: Bad magic signature in isReady!\n");
778 return 0;
779 }
780
781 testaddr = card->mixer_status_offset;
782 testb = card->mixer_status_mask;
783
784 /*
785 * Loop around waiting for the mixer to become ready.
786 */
787 while (! done && t2-- > 0) {
788 if ((nm256_readPort16 (card, 2, testaddr) & testb) == 0)
789 done = 1;
790 else
791 udelay (100);
792 }
793 return done;
794}
795
796/*
797 * Return the contents of the AC97 mixer register REG. Returns a positive
798 * value if successful, or a negative error code.
799 */
800static int
801nm256_readAC97Reg (struct ac97_hwint *dev, u8 reg)
802{
803 struct nm256_info *card = (struct nm256_info *)dev->driver_private;
804
805 if (card->magsig != NM_MAGIC_SIG) {
806 printk (KERN_ERR "NM256: Bad magic signature in readAC97Reg!\n");
807 return -EINVAL;
808 }
809
810 if (reg < 128) {
811 int res;
812
813 nm256_isReady (dev);
814 res = nm256_readPort16 (card, 2, card->mixer + reg);
815 /* Magic delay. Bleah yucky. */
816 udelay (1000);
817 return res;
818 }
819 else
820 return -EINVAL;
821}
822
823/*
824 * Writes VALUE to AC97 mixer register REG. Returns 0 if successful, or
825 * a negative error code.
826 */
827static int
828nm256_writeAC97Reg (struct ac97_hwint *dev, u8 reg, u16 value)
829{
830 unsigned long flags;
831 int tries = 2;
832 int done = 0;
833 u32 base;
834
835 struct nm256_info *card = (struct nm256_info *)dev->driver_private;
836
837 if (card->magsig != NM_MAGIC_SIG) {
838 printk (KERN_ERR "NM256: Bad magic signature in writeAC97Reg!\n");
839 return -EINVAL;
840 }
841
842 base = card->mixer;
843
844 spin_lock_irqsave(&card->lock,flags);
845
846 nm256_isReady (dev);
847
848 /* Wait for the write to take, too. */
849 while ((tries-- > 0) && !done) {
850 nm256_writePort16 (card, 2, base + reg, value);
851 if (nm256_isReady (dev)) {
852 done = 1;
853 break;
854 }
855
856 }
857
858 spin_unlock_irqrestore(&card->lock,flags);
859 udelay (1000);
860
861 return ! done;
862}
863
864/*
865 * Initial register values to be written to the AC97 mixer.
866 * While most of these are identical to the reset values, we do this
867 * so that we have most of the register contents cached--this avoids
868 * reading from the mixer directly (which seems to be problematic,
869 * probably due to ignorance).
870 */
871struct initialValues
872{
873 unsigned short port;
874 unsigned short value;
875};
876
877static struct initialValues nm256_ac97_initial_values[] =
878{
879 { AC97_MASTER_VOL_STEREO, 0x8000 },
880 { AC97_HEADPHONE_VOL, 0x8000 },
881 { AC97_MASTER_VOL_MONO, 0x0000 },
882 { AC97_PCBEEP_VOL, 0x0000 },
883 { AC97_PHONE_VOL, 0x0008 },
884 { AC97_MIC_VOL, 0x8000 },
885 { AC97_LINEIN_VOL, 0x8808 },
886 { AC97_CD_VOL, 0x8808 },
887 { AC97_VIDEO_VOL, 0x8808 },
888 { AC97_AUX_VOL, 0x8808 },
889 { AC97_PCMOUT_VOL, 0x0808 },
890 { AC97_RECORD_SELECT, 0x0000 },
891 { AC97_RECORD_GAIN, 0x0B0B },
892 { AC97_GENERAL_PURPOSE, 0x0000 },
893 { 0xffff, 0xffff }
894};
895
896/* Initialize the AC97 into a known state. */
897static int
898nm256_resetAC97 (struct ac97_hwint *dev)
899{
900 struct nm256_info *card = (struct nm256_info *)dev->driver_private;
901 int x;
902
903 if (card->magsig != NM_MAGIC_SIG) {
904 printk (KERN_ERR "NM256: Bad magic signature in resetAC97!\n");
905 return -EINVAL;
906 }
907
908 /* Reset the mixer. 'Tis magic! */
909 nm256_writePort8 (card, 2, 0x6c0, 1);
910// nm256_writePort8 (card, 2, 0x6cc, 0x87); /* This crashes Dell latitudes */
911 nm256_writePort8 (card, 2, 0x6cc, 0x80);
912 nm256_writePort8 (card, 2, 0x6cc, 0x0);
913
914 if (! card->mixer_values_init) {
915 for (x = 0; nm256_ac97_initial_values[x].port != 0xffff; x++) {
916 ac97_put_register (dev,
917 nm256_ac97_initial_values[x].port,
918 nm256_ac97_initial_values[x].value);
919 card->mixer_values_init = 1;
920 }
921 }
922
923 return 0;
924}
925
926/*
927 * We don't do anything particularly special here; it just passes the
928 * mixer ioctl to the AC97 driver.
929 */
930static int
931nm256_default_mixer_ioctl (int dev, unsigned int cmd, void __user *arg)
932{
933 struct nm256_info *card = nm256_find_card_for_mixer (dev);
934 if (card != NULL)
935 return ac97_mixer_ioctl (&(card->mdev), cmd, arg);
936 else
937 return -ENODEV;
938}
939
940static struct mixer_operations nm256_mixer_operations = {
941 .owner = THIS_MODULE,
942 .id = "NeoMagic",
943 .name = "NM256AC97Mixer",
944 .ioctl = nm256_default_mixer_ioctl
945};
946
947/*
948 * Default settings for the OSS mixer. These are set last, after the
949 * mixer is initialized.
950 *
951 * I "love" C sometimes. Got braces?
952 */
953static struct ac97_mixer_value_list mixer_defaults[] = {
954 { SOUND_MIXER_VOLUME, { { 85, 85 } } },
955 { SOUND_MIXER_SPEAKER, { { 100 } } },
956 { SOUND_MIXER_PCM, { { 65, 65 } } },
957 { SOUND_MIXER_CD, { { 65, 65 } } },
958 { -1, { { 0, 0 } } }
959};
960
961
962/* Installs the AC97 mixer into CARD. */
963static int __devinit
964nm256_install_mixer (struct nm256_info *card)
965{
966 int mixer;
967
968 card->mdev.reset_device = nm256_resetAC97;
969 card->mdev.read_reg = nm256_readAC97Reg;
970 card->mdev.write_reg = nm256_writeAC97Reg;
971 card->mdev.driver_private = (void *)card;
972
973 if (ac97_init (&(card->mdev)))
974 return -1;
975
976 mixer = sound_alloc_mixerdev();
977 if (num_mixers >= MAX_MIXER_DEV) {
978 printk ("NM256 mixer: Unable to alloc mixerdev\n");
979 return -1;
980 }
981
982 mixer_devs[mixer] = &nm256_mixer_operations;
983 card->mixer_oss_dev = mixer;
984
985 /* Some reasonable default values. */
986 ac97_set_values (&(card->mdev), mixer_defaults);
987
988 printk(KERN_INFO "Initialized AC97 mixer\n");
989 return 0;
990}
991
992/*
993 * See if the signature left by the NM256 BIOS is intact; if so, we use
994 * the associated address as the end of our audio buffer in the video
995 * RAM.
996 */
997
998static void __devinit
999nm256_peek_for_sig (struct nm256_info *card)
1000{
1001 u32 port1offset
1002 = card->port[0].physaddr + card->port[0].end_offset - 0x0400;
1003 /* The signature is located 1K below the end of video RAM. */
1004 char __iomem *temp = ioremap_nocache (port1offset, 16);
1005 /* Default buffer end is 5120 bytes below the top of RAM. */
1006 u32 default_value = card->port[0].end_offset - 0x1400;
1007 u32 sig;
1008
1009 /* Install the default value first, so we don't have to repeatedly
1010 do it if there is a problem. */
1011 card->port[0].end_offset = default_value;
1012
1013 if (temp == NULL) {
1014 printk (KERN_ERR "NM256: Unable to scan for card signature in video RAM\n");
1015 return;
1016 }
1017 sig = readl (temp);
1018 if ((sig & NM_SIG_MASK) == NM_SIGNATURE) {
1019 u32 pointer = readl (temp + 4);
1020
1021 /*
1022 * If it's obviously invalid, don't use it (the port already has a
1023 * suitable default value set).
1024 */
1025 if (pointer != 0xffffffff)
1026 card->port[0].end_offset = pointer;
1027
1028 printk (KERN_INFO "NM256: Found card signature in video RAM: 0x%x\n",
1029 pointer);
1030 }
1031
1032 iounmap (temp);
1033}
1034
1035/*
1036 * Install a driver for the PCI device referenced by PCIDEV.
1037 * VERSTR is a human-readable version string.
1038 */
1039
1040static int __devinit
1041nm256_install(struct pci_dev *pcidev, enum nm256rev rev, char *verstr)
1042{
1043 struct nm256_info *card;
1044 int x;
1045
1046 if (pci_enable_device(pcidev))
1047 return 0;
1048
1049 card = kmalloc (sizeof (struct nm256_info), GFP_KERNEL);
1050 if (card == NULL) {
1051 printk (KERN_ERR "NM256: out of memory!\n");
1052 return 0;
1053 }
1054
1055 card->magsig = NM_MAGIC_SIG;
1056 card->playing = 0;
1057 card->recording = 0;
1058 card->rev = rev;
1059 spin_lock_init(&card->lock);
1060
1061 /* Init the memory port info. */
1062 for (x = 0; x < 2; x++) {
1063 card->port[x].physaddr = pci_resource_start (pcidev, x);
1064 card->port[x].ptr = NULL;
1065 card->port[x].start_offset = 0;
1066 card->port[x].end_offset = 0;
1067 }
1068
1069 /* Port 2 is easy. */
1070 card->port[1].start_offset = 0;
1071 card->port[1].end_offset = NM_PORT2_SIZE;
1072
1073 /* Yuck. But we have to map in port 2 so we can check how much RAM the
1074 card has. */
1075 if (nm256_remap_ports (card)) {
1076 kfree (card);
1077 return 0;
1078 }
1079
1080 /*
1081 * The NM256 has two memory ports. The first port is nothing
1082 * more than a chunk of video RAM, which is used as the I/O ring
1083 * buffer. The second port has the actual juicy stuff (like the
1084 * mixer and the playback engine control registers).
1085 */
1086
1087 if (card->rev == REV_NM256AV) {
1088 /* Ok, try to see if this is a non-AC97 version of the hardware. */
1089 int pval = nm256_readPort16 (card, 2, NM_MIXER_PRESENCE);
1090 if ((pval & NM_PRESENCE_MASK) != NM_PRESENCE_VALUE) {
1091 if (! force_load) {
1092 printk (KERN_ERR "NM256: This doesn't look to me like the AC97-compatible version.\n");
1093 printk (KERN_ERR " You can force the driver to load by passing in the module\n");
1094 printk (KERN_ERR " parameter:\n");
1095 printk (KERN_ERR " force_load = 1\n");
1096 printk (KERN_ERR "\n");
1097 printk (KERN_ERR " More likely, you should be using the appropriate SB-16 or\n");
1098 printk (KERN_ERR " CS4232 driver instead. (If your BIOS has settings for\n");
1099 printk (KERN_ERR " IRQ and/or DMA for the sound card, this is *not* the correct\n");
1100 printk (KERN_ERR " driver to use.)\n");
1101 nm256_release_ports (card);
1102 kfree (card);
1103 return 0;
1104 }
1105 else {
1106 printk (KERN_INFO "NM256: Forcing driver load as per user request.\n");
1107 }
1108 }
1109 else {
1110 /* printk (KERN_INFO "NM256: Congratulations. You're not running Eunice.\n")*/;
1111 }
1112 card->port[0].end_offset = 2560 * 1024;
1113 card->introutine = nm256_interrupt;
1114 card->mixer_status_offset = NM_MIXER_STATUS_OFFSET;
1115 card->mixer_status_mask = NM_MIXER_READY_MASK;
1116 }
1117 else {
1118 /* Not sure if there is any relevant detect for the ZX or not. */
1119 if (nm256_readPort8 (card, 2, 0xa0b) != 0)
1120 card->port[0].end_offset = 6144 * 1024;
1121 else
1122 card->port[0].end_offset = 4096 * 1024;
1123
1124 card->introutine = nm256_interrupt_zx;
1125 card->mixer_status_offset = NM2_MIXER_STATUS_OFFSET;
1126 card->mixer_status_mask = NM2_MIXER_READY_MASK;
1127 }
1128
1129 if (buffertop >= 98304 && buffertop < card->port[0].end_offset)
1130 card->port[0].end_offset = buffertop;
1131 else
1132 nm256_peek_for_sig (card);
1133
1134 card->port[0].start_offset = card->port[0].end_offset - 98304;
1135
1136 printk (KERN_INFO "NM256: Mapping port 1 from 0x%x - 0x%x\n",
1137 card->port[0].start_offset, card->port[0].end_offset);
1138
1139 if (nm256_remap_ports (card)) {
1140 kfree (card);
1141 return 0;
1142 }
1143
1144 /* See if we can get the interrupt. */
1145
1146 card->irq = pcidev->irq;
1147 card->has_irq = 0;
1148
1149 if (nm256_grabInterrupt (card) != 0) {
1150 nm256_release_ports (card);
1151 kfree (card);
1152 return 0;
1153 }
1154
1155 nm256_releaseInterrupt (card);
1156
1157 /*
1158 * Init the board.
1159 */
1160
1161 card->playbackBufferSize = 16384;
1162 card->recordBufferSize = 16384;
1163
1164 card->coeffBuf = card->port[0].end_offset - NM_MAX_COEFFICIENT;
1165 card->abuf2 = card->coeffBuf - card->recordBufferSize;
1166 card->abuf1 = card->abuf2 - card->playbackBufferSize;
1167 card->allCoeffBuf = card->abuf2 - (NM_TOTAL_COEFF_COUNT * 4);
1168
1169 /* Fixed setting. */
1170 card->mixer = NM_MIXER_OFFSET;
1171 card->mixer_values_init = 0;
1172
1173 card->is_open_play = 0;
1174 card->is_open_record = 0;
1175
1176 card->coeffsCurrent = 0;
1177
1178 card->opencnt[0] = 0; card->opencnt[1] = 0;
1179
1180 /* Reasonable default settings, but largely unnecessary. */
1181 for (x = 0; x < 2; x++) {
1182 card->sinfo[x].bits = 8;
1183 card->sinfo[x].stereo = 0;
1184 card->sinfo[x].samplerate = 8000;
1185 }
1186
1187 nm256_initHw (card);
1188
1189 for (x = 0; x < 2; x++) {
1190 if ((card->dev[x] =
1191 sound_install_audiodrv(AUDIO_DRIVER_VERSION,
1192 "NM256", &nm256_audio_driver,
1193 sizeof(struct audio_driver),
1194 DMA_NODMA, AFMT_U8 | AFMT_S16_LE,
1195 NULL, -1, -1)) >= 0) {
1196 /* 1K minimum buffer size. */
1197 audio_devs[card->dev[x]]->min_fragment = 10;
1198 /* Maximum of 8K buffer size. */
1199 audio_devs[card->dev[x]]->max_fragment = 13;
1200 }
1201 else {
1202 printk(KERN_ERR "NM256: Too many PCM devices available\n");
1203 nm256_release_ports (card);
1204 kfree (card);
1205 return 0;
1206 }
1207 }
1208
1209 pci_set_drvdata(pcidev,card);
1210
1211 /* Insert the card in the list. */
1212 card->next_card = nmcard_list;
1213 nmcard_list = card;
1214
1215 printk(KERN_INFO "Initialized NeoMagic %s audio in PCI native mode\n",
1216 verstr);
1217
1218 /*
1219 * And our mixer. (We should allow support for other mixers, maybe.)
1220 */
1221
1222 nm256_install_mixer (card);
1223
1224 return 1;
1225}
1226
1227
1228static int __devinit
1229nm256_probe(struct pci_dev *pcidev,const struct pci_device_id *pciid)
1230{
1231 if (pcidev->device == PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO)
1232 return nm256_install(pcidev, REV_NM256AV, "256AV");
1233 if (pcidev->device == PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO)
1234 return nm256_install(pcidev, REV_NM256ZX, "256ZX");
1235 if (pcidev->device == PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO)
1236 return nm256_install(pcidev, REV_NM256ZX, "256XL+");
1237 return -1; /* should not come here ... */
1238}
1239
1240static void __devinit
1241nm256_remove(struct pci_dev *pcidev) {
1242 struct nm256_info *xcard = pci_get_drvdata(pcidev);
1243 struct nm256_info *card,*next_card = NULL;
1244
1245 for (card = nmcard_list; card != NULL; card = next_card) {
1246 next_card = card->next_card;
1247 if (card == xcard) {
1248 stopPlay (card);
1249 stopRecord (card);
1250 if (card->has_irq)
1251 free_irq (card->irq, card);
1252 nm256_release_ports (card);
1253 sound_unload_mixerdev (card->mixer_oss_dev);
1254 sound_unload_audiodev (card->dev[0]);
1255 sound_unload_audiodev (card->dev[1]);
1256 kfree (card);
1257 break;
1258 }
1259 }
1260 if (nmcard_list == card)
1261 nmcard_list = next_card;
1262}
1263
1264/*
1265 * Open the device
1266 *
1267 * DEV - device
1268 * MODE - mode to open device (logical OR of OPEN_READ and OPEN_WRITE)
1269 *
1270 * Called when opening the DMAbuf (dmabuf.c:259)
1271 */
1272static int
1273nm256_audio_open(int dev, int mode)
1274{
1275 struct nm256_info *card = nm256_find_card (dev);
1276 int w;
1277
1278 if (card == NULL)
1279 return -ENODEV;
1280
1281 if (card->dev[0] == dev)
1282 w = 0;
1283 else if (card->dev[1] == dev)
1284 w = 1;
1285 else
1286 return -ENODEV;
1287
1288 if (card->opencnt[w] > 0)
1289 return -EBUSY;
1290
1291 /* No bits set? Huh? */
1292 if (! ((mode & OPEN_READ) || (mode & OPEN_WRITE)))
1293 return -EIO;
1294
1295 /*
1296 * If it's open for both read and write, and the card's currently
1297 * being read or written to, then do the opposite of what has
1298 * already been done. Otherwise, don't specify any mode until the
1299 * user actually tries to do I/O. (Some programs open the device
1300 * for both read and write, but only actually do reading or writing.)
1301 */
1302
1303 if ((mode & OPEN_WRITE) && (mode & OPEN_READ)) {
1304 if (card->is_open_play)
1305 mode = OPEN_WRITE;
1306 else if (card->is_open_record)
1307 mode = OPEN_READ;
1308 else mode = 0;
1309 }
1310
1311 if (mode & OPEN_WRITE) {
1312 if (card->is_open_play == 0) {
1313 card->dev_for_play = dev;
1314 card->is_open_play = 1;
1315 }
1316 else
1317 return -EBUSY;
1318 }
1319
1320 if (mode & OPEN_READ) {
1321 if (card->is_open_record == 0) {
1322 card->dev_for_record = dev;
1323 card->is_open_record = 1;
1324 }
1325 else
1326 return -EBUSY;
1327 }
1328
1329 card->opencnt[w]++;
1330 return 0;
1331}
1332
1333/*
1334 * Close the device
1335 *
1336 * DEV - device
1337 *
1338 * Called when closing the DMAbuf (dmabuf.c:477)
1339 * after halt_xfer
1340 */
1341static void
1342nm256_audio_close(int dev)
1343{
1344 struct nm256_info *card = nm256_find_card (dev);
1345
1346 if (card != NULL) {
1347 int w;
1348
1349 if (card->dev[0] == dev)
1350 w = 0;
1351 else if (card->dev[1] == dev)
1352 w = 1;
1353 else
1354 return;
1355
1356 card->opencnt[w]--;
1357 if (card->opencnt[w] <= 0) {
1358 card->opencnt[w] = 0;
1359
1360 if (card->dev_for_play == dev) {
1361 stopPlay (card);
1362 card->is_open_play = 0;
1363 card->dev_for_play = -1;
1364 }
1365
1366 if (card->dev_for_record == dev) {
1367 stopRecord (card);
1368 card->is_open_record = 0;
1369 card->dev_for_record = -1;
1370 }
1371 }
1372 }
1373}
1374
1375/* Standard ioctl handler. */
1376static int
1377nm256_audio_ioctl(int dev, unsigned int cmd, void __user *arg)
1378{
1379 int ret;
1380 u32 oldinfo;
1381 int w;
1382
1383 struct nm256_info *card = nm256_find_card (dev);
1384
1385 if (card == NULL)
1386 return -ENODEV;
1387
1388 if (dev == card->dev[0])
1389 w = 0;
1390 else
1391 w = 1;
1392
1393 /*
1394 * The code here is messy. There are probably better ways to do
1395 * it. (It should be possible to handle it the same way the AC97 mixer
1396 * is done.)
1397 */
1398 switch (cmd)
1399 {
1400 case SOUND_PCM_WRITE_RATE:
1401 if (get_user(ret, (int __user *) arg))
1402 return -EFAULT;
1403
1404 if (ret != 0) {
1405 oldinfo = card->sinfo[w].samplerate;
1406 card->sinfo[w].samplerate = ret;
1407 ret = nm256_setInfo(dev, card);
1408 if (ret != 0)
1409 card->sinfo[w].samplerate = oldinfo;
1410 }
1411 if (ret == 0)
1412 ret = card->sinfo[w].samplerate;
1413 break;
1414
1415 case SOUND_PCM_READ_RATE:
1416 ret = card->sinfo[w].samplerate;
1417 break;
1418
1419 case SNDCTL_DSP_STEREO:
1420 if (get_user(ret, (int __user *) arg))
1421 return -EFAULT;
1422
1423 card->sinfo[w].stereo = ret ? 1 : 0;
1424 ret = nm256_setInfo (dev, card);
1425 if (ret == 0)
1426 ret = card->sinfo[w].stereo;
1427
1428 break;
1429
1430 case SOUND_PCM_WRITE_CHANNELS:
1431 if (get_user(ret, (int __user *) arg))
1432 return -EFAULT;
1433
1434 if (ret < 1 || ret > 3)
1435 ret = card->sinfo[w].stereo + 1;
1436 else {
1437 card->sinfo[w].stereo = ret - 1;
1438 ret = nm256_setInfo (dev, card);
1439 if (ret == 0)
1440 ret = card->sinfo[w].stereo + 1;
1441 }
1442 break;
1443
1444 case SOUND_PCM_READ_CHANNELS:
1445 ret = card->sinfo[w].stereo + 1;
1446 break;
1447
1448 case SNDCTL_DSP_SETFMT:
1449 if (get_user(ret, (int __user *) arg))
1450 return -EFAULT;
1451
1452 if (ret != 0) {
1453 oldinfo = card->sinfo[w].bits;
1454 card->sinfo[w].bits = ret;
1455 ret = nm256_setInfo (dev, card);
1456 if (ret != 0)
1457 card->sinfo[w].bits = oldinfo;
1458 }
1459 if (ret == 0)
1460 ret = card->sinfo[w].bits;
1461 break;
1462
1463 case SOUND_PCM_READ_BITS:
1464 ret = card->sinfo[w].bits;
1465 break;
1466
1467 default:
1468 return -EINVAL;
1469 }
1470 return put_user(ret, (int __user *) arg);
1471}
1472
1473/*
1474 * Given the sound device DEV and an associated physical buffer PHYSBUF,
1475 * return a pointer to the actual buffer in kernel space.
1476 *
1477 * This routine should exist as part of the soundcore routines.
1478 */
1479
1480static char *
1481nm256_getDMAbuffer (int dev, unsigned long physbuf)
1482{
1483 struct audio_operations *adev = audio_devs[dev];
1484 struct dma_buffparms *dmap = adev->dmap_out;
1485 char *dma_start =
1486 (char *)(physbuf - (unsigned long)dmap->raw_buf_phys
1487 + (unsigned long)dmap->raw_buf);
1488
1489 return dma_start;
1490}
1491
1492
1493/*
1494 * Output a block to sound device
1495 *
1496 * dev - device number
1497 * buf - physical address of buffer
1498 * total_count - total byte count in buffer
1499 * intrflag - set if this has been called from an interrupt
1500 * (via DMAbuf_outputintr)
1501 * restart_dma - set if engine needs to be re-initialised
1502 *
1503 * Called when:
1504 * 1. Starting output (dmabuf.c:1327)
1505 * 2. (dmabuf.c:1504)
1506 * 3. A new buffer needs to be sent to the device (dmabuf.c:1579)
1507 */
1508static void
1509nm256_audio_output_block(int dev, unsigned long physbuf,
1510 int total_count, int intrflag)
1511{
1512 struct nm256_info *card = nm256_find_card (dev);
1513
1514 if (card != NULL) {
1515 char *dma_buf = nm256_getDMAbuffer (dev, physbuf);
1516 card->is_open_play = 1;
1517 card->dev_for_play = dev;
1518 nm256_write_block (card, dma_buf, total_count);
1519 }
1520}
1521
1522/* Ditto, but do recording instead. */
1523static void
1524nm256_audio_start_input(int dev, unsigned long physbuf, int count,
1525 int intrflag)
1526{
1527 struct nm256_info *card = nm256_find_card (dev);
1528
1529 if (card != NULL) {
1530 char *dma_buf = nm256_getDMAbuffer (dev, physbuf);
1531 card->is_open_record = 1;
1532 card->dev_for_record = dev;
1533 nm256_startRecording (card, dma_buf, count);
1534 }
1535}
1536
1537/*
1538 * Prepare for inputting samples to DEV.
1539 * Each requested buffer will be BSIZE byes long, with a total of
1540 * BCOUNT buffers.
1541 */
1542
1543static int
1544nm256_audio_prepare_for_input(int dev, int bsize, int bcount)
1545{
1546 struct nm256_info *card = nm256_find_card (dev);
1547
1548 if (card == NULL)
1549 return -ENODEV;
1550
1551 if (card->is_open_record && card->dev_for_record != dev)
1552 return -EBUSY;
1553
1554 audio_devs[dev]->dmap_in->flags |= DMA_NODMA;
1555 return 0;
1556}
1557
1558/*
1559 * Prepare for outputting samples to `dev'
1560 *
1561 * Each buffer that will be passed will be `bsize' bytes long,
1562 * with a total of `bcount' buffers.
1563 *
1564 * Called when:
1565 * 1. A trigger enables audio output (dmabuf.c:978)
1566 * 2. We get a write buffer without dma_mode setup (dmabuf.c:1152)
1567 * 3. We restart a transfer (dmabuf.c:1324)
1568 */
1569
1570static int
1571nm256_audio_prepare_for_output(int dev, int bsize, int bcount)
1572{
1573 struct nm256_info *card = nm256_find_card (dev);
1574
1575 if (card == NULL)
1576 return -ENODEV;
1577
1578 if (card->is_open_play && card->dev_for_play != dev)
1579 return -EBUSY;
1580
1581 audio_devs[dev]->dmap_out->flags |= DMA_NODMA;
1582 return 0;
1583}
1584
1585/* Stop the current operations associated with DEV. */
1586static void
1587nm256_audio_reset(int dev)
1588{
1589 struct nm256_info *card = nm256_find_card (dev);
1590
1591 if (card != NULL) {
1592 if (card->dev_for_play == dev)
1593 stopPlay (card);
1594 if (card->dev_for_record == dev)
1595 stopRecord (card);
1596 }
1597}
1598
1599static int
1600nm256_audio_local_qlen(int dev)
1601{
1602 return 0;
1603}
1604
1605static struct audio_driver nm256_audio_driver =
1606{
1607 .owner = THIS_MODULE,
1608 .open = nm256_audio_open,
1609 .close = nm256_audio_close,
1610 .output_block = nm256_audio_output_block,
1611 .start_input = nm256_audio_start_input,
1612 .ioctl = nm256_audio_ioctl,
1613 .prepare_for_input = nm256_audio_prepare_for_input,
1614 .prepare_for_output = nm256_audio_prepare_for_output,
1615 .halt_io = nm256_audio_reset,
1616 .local_qlen = nm256_audio_local_qlen,
1617};
1618
1619static struct pci_device_id nm256_pci_tbl[] = {
1620 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO,
1621 PCI_ANY_ID, PCI_ANY_ID, 0, 0},
1622 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO,
1623 PCI_ANY_ID, PCI_ANY_ID, 0, 0},
1624 {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO,
1625 PCI_ANY_ID, PCI_ANY_ID, 0, 0},
1626 {0,}
1627};
1628MODULE_DEVICE_TABLE(pci, nm256_pci_tbl);
1629MODULE_LICENSE("GPL");
1630
1631
1632static struct pci_driver nm256_pci_driver = {
1633 .name = "nm256_audio",
1634 .id_table = nm256_pci_tbl,
1635 .probe = nm256_probe,
1636 .remove = nm256_remove,
1637};
1638
1639module_param(usecache, bool, 0);
1640module_param(buffertop, int, 0);
1641module_param(nm256_debug, bool, 0644);
1642module_param(force_load, bool, 0);
1643
1644static int __init do_init_nm256(void)
1645{
1646 printk (KERN_INFO "NeoMagic 256AV/256ZX audio driver, version 1.1p\n");
1647 return pci_register_driver(&nm256_pci_driver);
1648}
1649
1650static void __exit cleanup_nm256 (void)
1651{
1652 pci_unregister_driver(&nm256_pci_driver);
1653}
1654
1655module_init(do_init_nm256);
1656module_exit(cleanup_nm256);
1657
1658/*
1659 * Local variables:
1660 * c-basic-offset: 4
1661 * End:
1662 */
diff --git a/sound/oss/nm256_coeff.h b/sound/oss/nm256_coeff.h
deleted file mode 100644
index 6fc07f3cb33b..000000000000
--- a/sound/oss/nm256_coeff.h
+++ /dev/null
@@ -1,4697 +0,0 @@
1#ifndef NM256_COEFF_H
2#define NM256_COEFF_H
3
4#define NM_TOTAL_COEFF_COUNT 0x3158
5
6static char coefficients[NM_TOTAL_COEFF_COUNT * 4] = {
7 0xFF, 0xFF, 0x2F, 0x00, 0x4B, 0xFF, 0xA5, 0x01, 0xEF, 0xFC, 0x21,
8 0x05, 0x87, 0xF7, 0x62, 0x11, 0xE9, 0x45, 0x5E, 0xF9, 0xB5, 0x01,
9 0xDE, 0xFF, 0xA4, 0xFF, 0x60, 0x00, 0xCA, 0xFF, 0x0D, 0x00, 0xFD,
10 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3D, 0xFC, 0xD6, 0x06,
11 0x4C, 0xF3, 0xED, 0x20, 0x3D, 0x3D, 0x4A, 0xF3, 0x4E, 0x05, 0xB1,
12 0xFD, 0xE1, 0x00, 0xC3, 0xFF, 0x05, 0x00, 0x02, 0x00, 0xFD, 0xFF,
13 0x2A, 0x00, 0x5C, 0xFF, 0xAA, 0x01, 0x71, 0xFC, 0x07, 0x07, 0x7E,
14 0xF1, 0x44, 0x30, 0x44, 0x30, 0x7E, 0xF1, 0x07, 0x07, 0x71, 0xFC,
15 0xAA, 0x01, 0x5C, 0xFF, 0x2A, 0x00, 0xFD, 0xFF, 0x02, 0x00, 0x05,
16 0x00, 0xC3, 0xFF, 0xE1, 0x00, 0xB1, 0xFD, 0x4E, 0x05, 0x4A, 0xF3,
17 0x3D, 0x3D, 0xED, 0x20, 0x4C, 0xF3, 0xD6, 0x06, 0x3D, 0xFC, 0xE6,
18 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x0D, 0x00, 0xCA, 0xFF,
19 0x60, 0x00, 0xA4, 0xFF, 0xDE, 0xFF, 0xB5, 0x01, 0x5E, 0xF9, 0xE9,
20 0x45, 0x62, 0x11, 0x87, 0xF7, 0x21, 0x05, 0xEF, 0xFC, 0xA5, 0x01,
21 0x4B, 0xFF, 0x2F, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x1E, 0x00, 0x84,
22 0xFF, 0x11, 0x01, 0x34, 0xFE, 0x8F, 0x02, 0xC7, 0xFC, 0xAE, 0x03,
23 0xF7, 0x48, 0xAE, 0x03, 0xC7, 0xFC, 0x8F, 0x02, 0x34, 0xFE, 0x11,
24 0x01, 0x84, 0xFF, 0x1E, 0x00, 0xFE, 0xFF, 0x34, 0x00, 0x3D, 0xFF,
25 0xCA, 0x01, 0x95, 0xFC, 0xEA, 0x05, 0xBB, 0xF5, 0x25, 0x17, 0x3C,
26 0x43, 0x8D, 0xF6, 0x43, 0x03, 0xF5, 0xFE, 0x26, 0x00, 0x20, 0x00,
27 0xE2, 0xFF, 0x08, 0x00, 0xFD, 0xFF, 0x30, 0x00, 0x4D, 0xFF, 0xC5,
28 0x01, 0x4C, 0xFC, 0x26, 0x07, 0xA3, 0xF1, 0xAB, 0x2C, 0xBB, 0x33,
29 0x8F, 0xF1, 0xCA, 0x06, 0xA6, 0xFC, 0x85, 0x01, 0x6F, 0xFF, 0x24,
30 0x00, 0xFD, 0xFF, 0x03, 0x00, 0xFE, 0xFF, 0xD5, 0xFF, 0xBC, 0x00,
31 0xF0, 0xFD, 0xEC, 0x04, 0xD9, 0xF3, 0xB1, 0x3E, 0xCD, 0x1E, 0xC1,
32 0xF3, 0xAF, 0x06, 0x49, 0xFC, 0xE4, 0x01, 0x36, 0xFF, 0x36, 0x00,
33 0xFE, 0xFF, 0x16, 0x00, 0xA6, 0xFF, 0xBB, 0x00, 0xE9, 0xFE, 0x38,
34 0x01, 0x4B, 0xFF, 0x28, 0xFE, 0x3A, 0x48, 0x04, 0x0A, 0x2E, 0xFA,
35 0xDF, 0x03, 0x8A, 0xFD, 0x60, 0x01, 0x65, 0xFF, 0x27, 0x00, 0x00,
36 0x00, 0xFF, 0xFF, 0x2E, 0x00, 0x50, 0xFF, 0x98, 0x01, 0x0D, 0xFD,
37 0xE0, 0x04, 0x14, 0xF8, 0xC3, 0x0F, 0x89, 0x46, 0x4C, 0xFA, 0x38,
38 0x01, 0x25, 0x00, 0x7D, 0xFF, 0x73, 0x00, 0xC2, 0xFF, 0x0F, 0x00,
39 0xFD, 0xFF, 0x35, 0x00, 0x3A, 0xFF, 0xE3, 0x01, 0x31, 0xFC, 0x0F,
40 0x07, 0x84, 0xF2, 0x29, 0x25, 0x1A, 0x3A, 0x67, 0xF2, 0xF6, 0x05,
41 0x41, 0xFD, 0x24, 0x01, 0xA1, 0xFF, 0x12, 0x00, 0x00, 0x00, 0xFF,
42 0xFF, 0x15, 0x00, 0x97, 0xFF, 0x37, 0x01, 0x22, 0xFD, 0x23, 0x06,
43 0x2F, 0xF2, 0x11, 0x39, 0x7B, 0x26, 0x50, 0xF2, 0x1B, 0x07, 0x32,
44 0xFC, 0xE1, 0x01, 0x3C, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x0E, 0x00,
45 0xC8, 0xFF, 0x64, 0x00, 0x9B, 0xFF, 0xEE, 0xFF, 0x98, 0x01, 0x93,
46 0xF9, 0x10, 0x46, 0x03, 0x11, 0xA7, 0xF7, 0x12, 0x05, 0xF6, 0xFC,
47 0xA2, 0x01, 0x4C, 0xFF, 0x2F, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x26,
48 0x00, 0x6A, 0xFF, 0x53, 0x01, 0xA6, 0xFD, 0xA6, 0x03, 0xA1, 0xFA,
49 0xDE, 0x08, 0x76, 0x48, 0x0C, 0xFF, 0xDE, 0xFE, 0x73, 0x01, 0xC9,
50 0xFE, 0xCA, 0x00, 0xA0, 0xFF, 0x17, 0x00, 0xFE, 0xFF, 0x36, 0x00,
51 0x36, 0xFF, 0xE1, 0x01, 0x52, 0xFC, 0x93, 0x06, 0x10, 0xF4, 0x78,
52 0x1D, 0x90, 0x3F, 0x3E, 0xF4, 0xAA, 0x04, 0x19, 0xFE, 0xA4, 0x00,
53 0xE2, 0xFF, 0xFA, 0xFF, 0x03, 0x00, 0xFD, 0xFF, 0x26, 0x00, 0x68,
54 0xFF, 0x93, 0x01, 0x92, 0xFC, 0xE2, 0x06, 0x83, 0xF1, 0x8C, 0x32,
55 0xED, 0x2D, 0x90, 0xF1, 0x1E, 0x07, 0x57, 0xFC, 0xBD, 0x01, 0x51,
56 0xFF, 0x2E, 0x00, 0xFD, 0xFF, 0x07, 0x00, 0xE8, 0xFF, 0x12, 0x00,
57 0x42, 0x00, 0xC4, 0xFE, 0x94, 0x03, 0x02, 0xF6, 0x89, 0x42, 0x76,
58 0x18, 0x5C, 0xF5, 0x12, 0x06, 0x84, 0xFC, 0xD1, 0x01, 0x3B, 0xFF,
59 0x34, 0x00, 0xFE, 0xFF, 0x1D, 0x00, 0x8A, 0xFF, 0x03, 0x01, 0x53,
60 0xFE, 0x53, 0x02, 0x39, 0xFD, 0xA9, 0x02, 0xF2, 0x48, 0xB9, 0x04,
61 0x54, 0xFC, 0xCA, 0x02, 0x16, 0xFE, 0x20, 0x01, 0x7F, 0xFF, 0x20,
62 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x33, 0x00, 0x40, 0xFF, 0xC3, 0x01,
63 0xA7, 0xFC, 0xC0, 0x05, 0x1E, 0xF6, 0xD8, 0x15, 0xE7, 0x43, 0x20,
64 0xF7, 0xEF, 0x02, 0x27, 0xFF, 0x0A, 0x00, 0x2E, 0x00, 0xDD, 0xFF,
65 0x09, 0x00, 0xFD, 0xFF, 0x31, 0x00, 0x48, 0xFF, 0xCD, 0x01, 0x43,
66 0xFC, 0x2A, 0x07, 0xBC, 0xF1, 0x64, 0x2B, 0xE3, 0x34, 0xA3, 0xF1,
67 0xAE, 0x06, 0xBD, 0xFC, 0x77, 0x01, 0x77, 0xFF, 0x21, 0x00, 0xFE,
68 0xFF, 0x02, 0x00, 0x03, 0x00, 0xCA, 0xFF, 0xD4, 0x00, 0xC8, 0xFD,
69 0x2A, 0x05, 0x7D, 0xF3, 0xCA, 0x3D, 0x22, 0x20, 0x76, 0xF3, 0xC8,
70 0x06, 0x41, 0xFC, 0xE6, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF,
71 0x14, 0x00, 0xAC, 0xFF, 0xAC, 0x00, 0x08, 0xFF, 0xFD, 0x00, 0xB5,
72 0xFF, 0x4B, 0xFD, 0xF4, 0x47, 0x30, 0x0B, 0xBC, 0xF9, 0x17, 0x04,
73 0x6E, 0xFD, 0x6D, 0x01, 0x60, 0xFF, 0x29, 0x00, 0x00, 0x00, 0xFF,
74 0xFF, 0x2C, 0x00, 0x54, 0xFF, 0x8D, 0x01, 0x26, 0xFD, 0xAD, 0x04,
75 0x82, 0xF8, 0x87, 0x0E, 0xF9, 0x46, 0x0C, 0xFB, 0xD4, 0x00, 0x5D,
76 0x00, 0x5E, 0xFF, 0x82, 0x00, 0xBD, 0xFF, 0x10, 0x00, 0xFD, 0xFF,
77 0x36, 0x00, 0x38, 0xFF, 0xE5, 0x01, 0x33, 0xFC, 0x01, 0x07, 0xBE,
78 0xF2, 0xD6, 0x23, 0x1F, 0x3B, 0xA5, 0xF2, 0xC5, 0x05, 0x62, 0xFD,
79 0x10, 0x01, 0xAB, 0xFF, 0x0E, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x19,
80 0x00, 0x8E, 0xFF, 0x49, 0x01, 0x04, 0xFD, 0x4D, 0x06, 0x00, 0xF2,
81 0xFE, 0x37, 0xCB, 0x27, 0x21, 0xF2, 0x23, 0x07, 0x34, 0xFC, 0xDD,
82 0x01, 0x3F, 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0x0C, 0x00, 0xCE, 0xFF,
83 0x56, 0x00, 0xB9, 0xFF, 0xB8, 0xFF, 0xF7, 0x01, 0xE2, 0xF8, 0x8D,
84 0x45, 0x46, 0x12, 0x3C, 0xF7, 0x43, 0x05, 0xDF, 0xFC, 0xAC, 0x01,
85 0x48, 0xFF, 0x30, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x24, 0x00, 0x70,
86 0xFF, 0x46, 0x01, 0xC3, 0xFD, 0x6D, 0x03, 0x14, 0xFB, 0xBE, 0x07,
87 0xA6, 0x48, 0xF8, 0xFF, 0x70, 0xFE, 0xAE, 0x01, 0xAA, 0xFE, 0xD9,
88 0x00, 0x9A, 0xFF, 0x19, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x37, 0xFF,
89 0xDE, 0x01, 0x5D, 0xFC, 0x74, 0x06, 0x63, 0xF4, 0x23, 0x1C, 0x66,
90 0x40, 0xAA, 0xF4, 0x65, 0x04, 0x44, 0xFE, 0x8B, 0x00, 0xEE, 0xFF,
91 0xF5, 0xFF, 0x04, 0x00, 0xFD, 0xFF, 0x29, 0x00, 0x61, 0xFF, 0x9F,
92 0x01, 0x80, 0xFC, 0xF7, 0x06, 0x7D, 0xF1, 0x5A, 0x31, 0x2C, 0x2F,
93 0x83, 0xF1, 0x13, 0x07, 0x64, 0xFC, 0xB3, 0x01, 0x57, 0xFF, 0x2C,
94 0x00, 0xFD, 0xFF, 0x06, 0x00, 0xED, 0xFF, 0x05, 0x00, 0x5D, 0x00,
95 0x95, 0xFE, 0xE2, 0x03, 0x7F, 0xF5, 0xCC, 0x41, 0xC7, 0x19, 0xFF,
96 0xF4, 0x37, 0x06, 0x75, 0xFC, 0xD6, 0x01, 0x39, 0xFF, 0x35, 0x00,
97 0xFE, 0xFF, 0x1B, 0x00, 0x90, 0xFF, 0xF4, 0x00, 0x72, 0xFE, 0x18,
98 0x02, 0xAA, 0xFD, 0xAB, 0x01, 0xDF, 0x48, 0xCA, 0x05, 0xE1, 0xFB,
99 0x05, 0x03, 0xF7, 0xFD, 0x2E, 0x01, 0x79, 0xFF, 0x21, 0x00, 0x00,
100 0x00, 0xFF, 0xFF, 0x32, 0x00, 0x43, 0xFF, 0xBB, 0x01, 0xBA, 0xFC,
101 0x95, 0x05, 0x83, 0xF6, 0x8C, 0x14, 0x87, 0x44, 0xBB, 0xF7, 0x98,
102 0x02, 0x5A, 0xFF, 0xEE, 0xFF, 0x3C, 0x00, 0xD8, 0xFF, 0x0A, 0x00,
103 0xFD, 0xFF, 0x32, 0x00, 0x44, 0xFF, 0xD3, 0x01, 0x3C, 0xFC, 0x2A,
104 0x07, 0xDC, 0xF1, 0x1A, 0x2A, 0x06, 0x36, 0xBE, 0xF1, 0x8E, 0x06,
105 0xD5, 0xFC, 0x67, 0x01, 0x7F, 0xFF, 0x1E, 0x00, 0xFE, 0xFF, 0x01,
106 0x00, 0x07, 0x00, 0xBE, 0xFF, 0xEA, 0x00, 0xA2, 0xFD, 0x65, 0x05,
107 0x28, 0xF3, 0xDB, 0x3C, 0x78, 0x21, 0x30, 0xF3, 0xDF, 0x06, 0x3A,
108 0xFC, 0xE6, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x13, 0x00,
109 0xB2, 0xFF, 0x9D, 0x00, 0x27, 0xFF, 0xC3, 0x00, 0x1F, 0x00, 0x76,
110 0xFC, 0xA3, 0x47, 0x60, 0x0C, 0x4A, 0xF9, 0x4E, 0x04, 0x53, 0xFD,
111 0x79, 0x01, 0x5C, 0xFF, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B,
112 0x00, 0x58, 0xFF, 0x82, 0x01, 0x3F, 0xFD, 0x78, 0x04, 0xF2, 0xF8,
113 0x50, 0x0D, 0x5E, 0x47, 0xD5, 0xFB, 0x6F, 0x00, 0x96, 0x00, 0x40,
114 0xFF, 0x91, 0x00, 0xB7, 0xFF, 0x12, 0x00, 0xFD, 0xFF, 0x36, 0x00,
115 0x37, 0xFF, 0xE6, 0x01, 0x36, 0xFC, 0xEF, 0x06, 0xFC, 0xF2, 0x81,
116 0x22, 0x1C, 0x3C, 0xEC, 0xF2, 0x90, 0x05, 0x85, 0xFD, 0xFB, 0x00,
117 0xB6, 0xFF, 0x0A, 0x00, 0x01, 0x00, 0xFE, 0xFF, 0x1C, 0x00, 0x85,
118 0xFF, 0x5B, 0x01, 0xE9, 0xFC, 0x73, 0x06, 0xD8, 0xF1, 0xE5, 0x36,
119 0x19, 0x29, 0xF8, 0xF1, 0x29, 0x07, 0x37, 0xFC, 0xD8, 0x01, 0x42,
120 0xFF, 0x33, 0x00, 0xFD, 0xFF, 0x0B, 0x00, 0xD3, 0xFF, 0x47, 0x00,
121 0xD7, 0xFF, 0x82, 0xFF, 0x53, 0x02, 0x39, 0xF8, 0xFD, 0x44, 0x8D,
122 0x13, 0xD3, 0xF6, 0x72, 0x05, 0xCA, 0xFC, 0xB5, 0x01, 0x45, 0xFF,
123 0x31, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x23, 0x00, 0x75, 0xFF, 0x39,
124 0x01, 0xE0, 0xFD, 0x33, 0x03, 0x87, 0xFB, 0xA2, 0x06, 0xCB, 0x48,
125 0xEA, 0x00, 0x01, 0xFE, 0xE9, 0x01, 0x8A, 0xFE, 0xE8, 0x00, 0x95,
126 0xFF, 0x1A, 0x00, 0xFE, 0xFF, 0x35, 0x00, 0x38, 0xFF, 0xDA, 0x01,
127 0x6A, 0xFC, 0x53, 0x06, 0xBA, 0xF4, 0xCE, 0x1A, 0x32, 0x41, 0x1F,
128 0xF5, 0x1D, 0x04, 0x71, 0xFE, 0x71, 0x00, 0xFB, 0xFF, 0xF0, 0xFF,
129 0x05, 0x00, 0xFD, 0xFF, 0x2B, 0x00, 0x5B, 0xFF, 0xAB, 0x01, 0x6F,
130 0xFC, 0x08, 0x07, 0x7E, 0xF1, 0x21, 0x30, 0x67, 0x30, 0x7D, 0xF1,
131 0x05, 0x07, 0x73, 0xFC, 0xA8, 0x01, 0x5C, 0xFF, 0x2A, 0x00, 0xFD,
132 0xFF, 0x05, 0x00, 0xF2, 0xFF, 0xF8, 0xFF, 0x77, 0x00, 0x67, 0xFE,
133 0x2D, 0x04, 0x04, 0xF5, 0x07, 0x41, 0x1B, 0x1B, 0xA6, 0xF4, 0x5A,
134 0x06, 0x67, 0xFC, 0xDB, 0x01, 0x38, 0xFF, 0x36, 0x00, 0xFE, 0xFF,
135 0x1A, 0x00, 0x96, 0xFF, 0xE5, 0x00, 0x91, 0xFE, 0xDC, 0x01, 0x1A,
136 0xFE, 0xB3, 0x00, 0xC3, 0x48, 0xE1, 0x06, 0x6E, 0xFB, 0x40, 0x03,
137 0xDA, 0xFD, 0x3C, 0x01, 0x74, 0xFF, 0x23, 0x00, 0x00, 0x00, 0xFF,
138 0xFF, 0x31, 0x00, 0x46, 0xFF, 0xB3, 0x01, 0xCF, 0xFC, 0x67, 0x05,
139 0xEA, 0xF6, 0x44, 0x13, 0x1E, 0x45, 0x5E, 0xF8, 0x3F, 0x02, 0x8E,
140 0xFF, 0xD0, 0xFF, 0x4A, 0x00, 0xD2, 0xFF, 0x0B, 0x00, 0xFD, 0xFF,
141 0x33, 0x00, 0x41, 0xFF, 0xD9, 0x01, 0x36, 0xFC, 0x28, 0x07, 0x01,
142 0xF2, 0xCE, 0x28, 0x23, 0x37, 0xE0, 0xF1, 0x6B, 0x06, 0xEF, 0xFC,
143 0x57, 0x01, 0x87, 0xFF, 0x1B, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x0B,
144 0x00, 0xB4, 0xFF, 0x00, 0x01, 0x7E, 0xFD, 0x9C, 0x05, 0xDC, 0xF2,
145 0xE4, 0x3B, 0xCD, 0x22, 0xEE, 0xF2, 0xF3, 0x06, 0x35, 0xFC, 0xE6,
146 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x11, 0x00, 0xB8, 0xFF,
147 0x8E, 0x00, 0x46, 0xFF, 0x8A, 0x00, 0x86, 0x00, 0xA7, 0xFB, 0x48,
148 0x47, 0x95, 0x0D, 0xD9, 0xF8, 0x84, 0x04, 0x39, 0xFD, 0x85, 0x01,
149 0x57, 0xFF, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x5D,
150 0xFF, 0x76, 0x01, 0x59, 0xFD, 0x42, 0x04, 0x63, 0xF9, 0x1C, 0x0C,
151 0xB6, 0x47, 0xA4, 0xFC, 0x07, 0x00, 0xD0, 0x00, 0x20, 0xFF, 0xA0,
152 0x00, 0xB1, 0xFF, 0x13, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF,
153 0xE6, 0x01, 0x3B, 0xFC, 0xDA, 0x06, 0x3F, 0xF3, 0x2C, 0x21, 0x11,
154 0x3D, 0x3A, 0xF3, 0x58, 0x05, 0xAA, 0xFD, 0xE5, 0x00, 0xC1, 0xFF,
155 0x06, 0x00, 0x01, 0x00, 0xFE, 0xFF, 0x1F, 0x00, 0x7D, 0xFF, 0x6B,
156 0x01, 0xCF, 0xFC, 0x96, 0x06, 0xB7, 0xF1, 0xC6, 0x35, 0x64, 0x2A,
157 0xD4, 0xF1, 0x2B, 0x07, 0x3D, 0xFC, 0xD2, 0x01, 0x45, 0xFF, 0x32,
158 0x00, 0xFD, 0xFF, 0x0A, 0x00, 0xD9, 0xFF, 0x39, 0x00, 0xF4, 0xFF,
159 0x4E, 0xFF, 0xAC, 0x02, 0x98, 0xF7, 0x65, 0x44, 0xD6, 0x14, 0x6C,
160 0xF6, 0x9F, 0x05, 0xB6, 0xFC, 0xBD, 0x01, 0x42, 0xFF, 0x32, 0x00,
161 0xFF, 0xFF, 0x00, 0x00, 0x21, 0x00, 0x7A, 0xFF, 0x2B, 0x01, 0xFE,
162 0xFD, 0xF8, 0x02, 0xFB, 0xFB, 0x8D, 0x05, 0xE5, 0x48, 0xE3, 0x01,
163 0x91, 0xFD, 0x25, 0x02, 0x6B, 0xFE, 0xF7, 0x00, 0x8F, 0xFF, 0x1C,
164 0x00, 0xFE, 0xFF, 0x35, 0x00, 0x3A, 0xFF, 0xD5, 0x01, 0x78, 0xFC,
165 0x2F, 0x06, 0x13, 0xF5, 0x7C, 0x19, 0xF7, 0x41, 0x9B, 0xF5, 0xD1,
166 0x03, 0x9F, 0xFE, 0x57, 0x00, 0x08, 0x00, 0xEC, 0xFF, 0x06, 0x00,
167 0xFD, 0xFF, 0x2D, 0x00, 0x55, 0xFF, 0xB5, 0x01, 0x61, 0xFC, 0x16,
168 0x07, 0x85, 0xF1, 0xE6, 0x2E, 0x9E, 0x31, 0x7D, 0xF1, 0xF3, 0x06,
169 0x84, 0xFC, 0x9D, 0x01, 0x63, 0xFF, 0x28, 0x00, 0xFD, 0xFF, 0x04,
170 0x00, 0xF6, 0xFF, 0xEB, 0xFF, 0x91, 0x00, 0x3B, 0xFE, 0x75, 0x04,
171 0x92, 0xF4, 0x36, 0x40, 0x6E, 0x1C, 0x50, 0xF4, 0x7B, 0x06, 0x5B,
172 0xFC, 0xDF, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x18, 0x00,
173 0x9C, 0xFF, 0xD6, 0x00, 0xB1, 0xFE, 0xA1, 0x01, 0x89, 0xFE, 0xC3,
174 0xFF, 0x9C, 0x48, 0xFD, 0x07, 0xFA, 0xFA, 0x7A, 0x03, 0xBC, 0xFD,
175 0x49, 0x01, 0x6E, 0xFF, 0x24, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x30,
176 0x00, 0x49, 0xFF, 0xAA, 0x01, 0xE4, 0xFC, 0x38, 0x05, 0x54, 0xF7,
177 0xFE, 0x11, 0xAA, 0x45, 0x09, 0xF9, 0xE2, 0x01, 0xC4, 0xFF, 0xB3,
178 0xFF, 0x59, 0x00, 0xCD, 0xFF, 0x0D, 0x00, 0xFD, 0xFF, 0x34, 0x00,
179 0x3E, 0xFF, 0xDE, 0x01, 0x33, 0xFC, 0x22, 0x07, 0x2B, 0xF2, 0x80,
180 0x27, 0x3B, 0x38, 0x0A, 0xF2, 0x44, 0x06, 0x0B, 0xFD, 0x45, 0x01,
181 0x90, 0xFF, 0x18, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x0F, 0x00, 0xA9,
182 0xFF, 0x15, 0x01, 0x5B, 0xFD, 0xD0, 0x05, 0x97, 0xF2, 0xE6, 0x3A,
183 0x21, 0x24, 0xB1, 0xF2, 0x04, 0x07, 0x33, 0xFC, 0xE5, 0x01, 0x39,
184 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x10, 0x00, 0xBE, 0xFF, 0x7F, 0x00,
185 0x65, 0xFF, 0x51, 0x00, 0xEB, 0x00, 0xE1, 0xFA, 0xE1, 0x46, 0xCD,
186 0x0E, 0x6A, 0xF8, 0xB8, 0x04, 0x20, 0xFD, 0x90, 0x01, 0x53, 0xFF,
187 0x2D, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x28, 0x00, 0x62, 0xFF, 0x6A,
188 0x01, 0x74, 0xFD, 0x0A, 0x04, 0xD5, 0xF9, 0xED, 0x0A, 0x03, 0x48,
189 0x7C, 0xFD, 0x9E, 0xFF, 0x0A, 0x01, 0x01, 0xFF, 0xAF, 0x00, 0xAB,
190 0xFF, 0x14, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE5, 0x01,
191 0x42, 0xFC, 0xC3, 0x06, 0x87, 0xF3, 0xD7, 0x1F, 0xFE, 0x3D, 0x91,
192 0xF3, 0x1D, 0x05, 0xD1, 0xFD, 0xCE, 0x00, 0xCC, 0xFF, 0x02, 0x00,
193 0x02, 0x00, 0xFE, 0xFF, 0x22, 0x00, 0x75, 0xFF, 0x7A, 0x01, 0xB8,
194 0xFC, 0xB4, 0x06, 0x9E, 0xF1, 0xA2, 0x34, 0xAD, 0x2B, 0xB6, 0xF1,
195 0x29, 0x07, 0x45, 0xFC, 0xCB, 0x01, 0x49, 0xFF, 0x31, 0x00, 0xFD,
196 0xFF, 0x09, 0x00, 0xDE, 0xFF, 0x2B, 0x00, 0x11, 0x00, 0x1B, 0xFF,
197 0x02, 0x03, 0xFE, 0xF6, 0xC3, 0x43, 0x22, 0x16, 0x07, 0xF6, 0xCA,
198 0x05, 0xA3, 0xFC, 0xC5, 0x01, 0x3F, 0xFF, 0x33, 0x00, 0xFF, 0xFF,
199 0x00, 0x00, 0x20, 0x00, 0x80, 0xFF, 0x1C, 0x01, 0x1C, 0xFE, 0xBD,
200 0x02, 0x6E, 0xFC, 0x7D, 0x04, 0xF3, 0x48, 0xE2, 0x02, 0x1F, 0xFD,
201 0x60, 0x02, 0x4C, 0xFE, 0x06, 0x01, 0x89, 0xFF, 0x1D, 0x00, 0xFE,
202 0xFF, 0x34, 0x00, 0x3C, 0xFF, 0xCF, 0x01, 0x88, 0xFC, 0x09, 0x06,
203 0x71, 0xF5, 0x2B, 0x18, 0xB2, 0x42, 0x20, 0xF6, 0x83, 0x03, 0xCF,
204 0xFE, 0x3C, 0x00, 0x15, 0x00, 0xE6, 0xFF, 0x07, 0x00, 0xFD, 0xFF,
205 0x2E, 0x00, 0x50, 0xFF, 0xBF, 0x01, 0x54, 0xFC, 0x20, 0x07, 0x94,
206 0xF1, 0xA6, 0x2D, 0xD0, 0x32, 0x85, 0xF1, 0xDD, 0x06, 0x96, 0xFC,
207 0x90, 0x01, 0x69, 0xFF, 0x26, 0x00, 0xFD, 0xFF, 0x03, 0x00, 0xFB,
208 0xFF, 0xDF, 0xFF, 0xA9, 0x00, 0x10, 0xFE, 0xB9, 0x04, 0x27, 0xF4,
209 0x5E, 0x3F, 0xC3, 0x1D, 0xFE, 0xF3, 0x99, 0x06, 0x50, 0xFC, 0xE2,
210 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x17, 0x00, 0xA2, 0xFF,
211 0xC7, 0x00, 0xD0, 0xFE, 0x65, 0x01, 0xF6, 0xFE, 0xD9, 0xFE, 0x6A,
212 0x48, 0x1F, 0x09, 0x87, 0xFA, 0xB3, 0x03, 0xA0, 0xFD, 0x56, 0x01,
213 0x69, 0xFF, 0x26, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2F, 0x00, 0x4D,
214 0xFF, 0xA0, 0x01, 0xFB, 0xFC, 0x07, 0x05, 0xBF, 0xF7, 0xBB, 0x10,
215 0x2B, 0x46, 0xBB, 0xF9, 0x83, 0x01, 0xFA, 0xFF, 0x95, 0xFF, 0x68,
216 0x00, 0xC7, 0xFF, 0x0E, 0x00, 0xFD, 0xFF, 0x35, 0x00, 0x3C, 0xFF,
217 0xE1, 0x01, 0x31, 0xFC, 0x19, 0x07, 0x5B, 0xF2, 0x30, 0x26, 0x4B,
218 0x39, 0x3B, 0xF2, 0x1A, 0x06, 0x29, 0xFD, 0x33, 0x01, 0x99, 0xFF,
219 0x15, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x13, 0x00, 0x9F, 0xFF, 0x28,
220 0x01, 0x3A, 0xFD, 0x00, 0x06, 0x5A, 0xF2, 0xDF, 0x39, 0x73, 0x25,
221 0x79, 0xF2, 0x12, 0x07, 0x31, 0xFC, 0xE3, 0x01, 0x3B, 0xFF, 0x35,
222 0x00, 0xFD, 0xFF, 0x0F, 0x00, 0xC4, 0xFF, 0x70, 0x00, 0x84, 0xFF,
223 0x19, 0x00, 0x4D, 0x01, 0x22, 0xFA, 0x70, 0x46, 0x0A, 0x10, 0xFC,
224 0xF7, 0xEB, 0x04, 0x08, 0xFD, 0x9A, 0x01, 0x4F, 0xFF, 0x2E, 0x00,
225 0xFF, 0xFF, 0x00, 0x00, 0x27, 0x00, 0x66, 0xFF, 0x5E, 0x01, 0x90,
226 0xFD, 0xD2, 0x03, 0x47, 0xFA, 0xC3, 0x09, 0x48, 0x48, 0x5A, 0xFE,
227 0x33, 0xFF, 0x45, 0x01, 0xE2, 0xFE, 0xBE, 0x00, 0xA5, 0xFF, 0x16,
228 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE3, 0x01, 0x4B, 0xFC,
229 0xA9, 0x06, 0xD2, 0xF3, 0x81, 0x1E, 0xE4, 0x3E, 0xEF, 0xF3, 0xDE,
230 0x04, 0xF9, 0xFD, 0xB7, 0x00, 0xD8, 0xFF, 0xFD, 0xFF, 0x03, 0x00,
231 0xFD, 0xFF, 0x24, 0x00, 0x6D, 0xFF, 0x88, 0x01, 0xA2, 0xFC, 0xD0,
232 0x06, 0x8C, 0xF1, 0x78, 0x33, 0xF2, 0x2C, 0x9E, 0xF1, 0x24, 0x07,
233 0x4E, 0xFC, 0xC3, 0x01, 0x4E, 0xFF, 0x2F, 0x00, 0xFD, 0xFF, 0x08,
234 0x00, 0xE4, 0xFF, 0x1D, 0x00, 0x2D, 0x00, 0xEA, 0xFE, 0x56, 0x03,
235 0x6D, 0xF6, 0x17, 0x43, 0x70, 0x17, 0xA6, 0xF5, 0xF3, 0x05, 0x91,
236 0xFC, 0xCC, 0x01, 0x3D, 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0x1E, 0x00,
237 0x86, 0xFF, 0x0E, 0x01, 0x3B, 0xFE, 0x82, 0x02, 0xE0, 0xFC, 0x73,
238 0x03, 0xF6, 0x48, 0xE9, 0x03, 0xAD, 0xFC, 0x9C, 0x02, 0x2D, 0xFE,
239 0x14, 0x01, 0x83, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x33,
240 0x00, 0x3E, 0xFF, 0xC9, 0x01, 0x99, 0xFC, 0xE1, 0x05, 0xD1, 0xF5,
241 0xDC, 0x16, 0x65, 0x43, 0xAD, 0xF6, 0x31, 0x03, 0x00, 0xFF, 0x20,
242 0x00, 0x23, 0x00, 0xE1, 0xFF, 0x08, 0x00, 0xFD, 0xFF, 0x30, 0x00,
243 0x4C, 0xFF, 0xC7, 0x01, 0x4A, 0xFC, 0x27, 0x07, 0xA8, 0xF1, 0x62,
244 0x2C, 0xFD, 0x33, 0x93, 0xF1, 0xC4, 0x06, 0xAB, 0xFC, 0x82, 0x01,
245 0x71, 0xFF, 0x23, 0x00, 0xFE, 0xFF, 0x02, 0x00, 0xFF, 0xFF, 0xD3,
246 0xFF, 0xC1, 0x00, 0xE7, 0xFD, 0xFA, 0x04, 0xC4, 0xF3, 0x7E, 0x3E,
247 0x19, 0x1F, 0xB0, 0xF3, 0xB5, 0x06, 0x47, 0xFC, 0xE4, 0x01, 0x36,
248 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x15, 0x00, 0xA8, 0xFF, 0xB8, 0x00,
249 0xF0, 0xFE, 0x2B, 0x01, 0x63, 0xFF, 0xF6, 0xFD, 0x2C, 0x48, 0x47,
250 0x0A, 0x14, 0xFA, 0xEB, 0x03, 0x84, 0xFD, 0x63, 0x01, 0x64, 0xFF,
251 0x27, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2D, 0x00, 0x51, 0xFF, 0x96,
252 0x01, 0x13, 0xFD, 0xD5, 0x04, 0x2C, 0xF8, 0x7D, 0x0F, 0xA3, 0x46,
253 0x76, 0xFA, 0x22, 0x01, 0x32, 0x00, 0x76, 0xFF, 0x76, 0x00, 0xC1,
254 0xFF, 0x0F, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x3A, 0xFF, 0xE4, 0x01,
255 0x32, 0xFC, 0x0C, 0x07, 0x91, 0xF2, 0xDD, 0x24, 0x54, 0x3A, 0x74,
256 0xF2, 0xEB, 0x05, 0x49, 0xFD, 0x20, 0x01, 0xA3, 0xFF, 0x11, 0x00,
257 0x00, 0x00, 0xFF, 0xFF, 0x16, 0x00, 0x95, 0xFF, 0x3B, 0x01, 0x1B,
258 0xFD, 0x2D, 0x06, 0x24, 0xF2, 0xD3, 0x38, 0xC6, 0x26, 0x45, 0xF2,
259 0x1D, 0x07, 0x32, 0xFC, 0xE0, 0x01, 0x3D, 0xFF, 0x35, 0x00, 0xFD,
260 0xFF, 0x0D, 0x00, 0xC9, 0xFF, 0x61, 0x00, 0xA2, 0xFF, 0xE2, 0xFF,
261 0xAE, 0x01, 0x6B, 0xF9, 0xF2, 0x45, 0x4A, 0x11, 0x8F, 0xF7, 0x1D,
262 0x05, 0xF1, 0xFC, 0xA4, 0x01, 0x4B, 0xFF, 0x2F, 0x00, 0xFF, 0xFF,
263 0x00, 0x00, 0x25, 0x00, 0x6C, 0xFF, 0x51, 0x01, 0xAC, 0xFD, 0x9A,
264 0x03, 0xBA, 0xFA, 0x9E, 0x08, 0x81, 0x48, 0x40, 0xFF, 0xC6, 0xFE,
265 0x80, 0x01, 0xC2, 0xFE, 0xCE, 0x00, 0x9F, 0xFF, 0x17, 0x00, 0xFE,
266 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE1, 0x01, 0x55, 0xFC, 0x8C, 0x06,
267 0x22, 0xF4, 0x2C, 0x1D, 0xC0, 0x3F, 0x55, 0xF4, 0x9B, 0x04, 0x23,
268 0xFE, 0x9F, 0x00, 0xE4, 0xFF, 0xF9, 0xFF, 0x04, 0x00, 0xFD, 0xFF,
269 0x27, 0x00, 0x66, 0xFF, 0x96, 0x01, 0x8E, 0xFC, 0xE7, 0x06, 0x81,
270 0xF1, 0x48, 0x32, 0x34, 0x2E, 0x8D, 0xF1, 0x1C, 0x07, 0x5A, 0xFC,
271 0xBB, 0x01, 0x53, 0xFF, 0x2E, 0x00, 0xFD, 0xFF, 0x07, 0x00, 0xE9,
272 0xFF, 0x0F, 0x00, 0x48, 0x00, 0xB9, 0xFE, 0xA6, 0x03, 0xE4, 0xF5,
273 0x60, 0x42, 0xC1, 0x18, 0x47, 0xF5, 0x1A, 0x06, 0x81, 0xFC, 0xD2,
274 0x01, 0x3B, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x1C, 0x00, 0x8B, 0xFF,
275 0xFF, 0x00, 0x5A, 0xFE, 0x46, 0x02, 0x52, 0xFD, 0x70, 0x02, 0xED,
276 0x48, 0xF5, 0x04, 0x3B, 0xFC, 0xD7, 0x02, 0x0F, 0xFE, 0x23, 0x01,
277 0x7E, 0xFF, 0x20, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x33, 0x00, 0x40,
278 0xFF, 0xC1, 0x01, 0xAB, 0xFC, 0xB7, 0x05, 0x34, 0xF6, 0x8E, 0x15,
279 0x0B, 0x44, 0x42, 0xF7, 0xDC, 0x02, 0x32, 0xFF, 0x04, 0x00, 0x31,
280 0x00, 0xDC, 0xFF, 0x09, 0x00, 0xFD, 0xFF, 0x31, 0x00, 0x47, 0xFF,
281 0xCE, 0x01, 0x41, 0xFC, 0x2A, 0x07, 0xC2, 0xF1, 0x1B, 0x2B, 0x25,
282 0x35, 0xA8, 0xF1, 0xA7, 0x06, 0xC2, 0xFC, 0x74, 0x01, 0x78, 0xFF,
283 0x20, 0x00, 0xFE, 0xFF, 0x02, 0x00, 0x04, 0x00, 0xC7, 0xFF, 0xD9,
284 0x00, 0xBF, 0xFD, 0x38, 0x05, 0x69, 0xF3, 0x96, 0x3D, 0x6F, 0x20,
285 0x66, 0xF3, 0xCE, 0x06, 0x3F, 0xFC, 0xE6, 0x01, 0x36, 0xFF, 0x36,
286 0x00, 0xFD, 0xFF, 0x14, 0x00, 0xAE, 0xFF, 0xA9, 0x00, 0x0F, 0xFF,
287 0xF0, 0x00, 0xCD, 0xFF, 0x1B, 0xFD, 0xE4, 0x47, 0x73, 0x0B, 0xA2,
288 0xF9, 0x23, 0x04, 0x68, 0xFD, 0x70, 0x01, 0x5F, 0xFF, 0x29, 0x00,
289 0x00, 0x00, 0xFF, 0xFF, 0x2C, 0x00, 0x55, 0xFF, 0x8B, 0x01, 0x2B,
290 0xFD, 0xA1, 0x04, 0x9B, 0xF8, 0x42, 0x0E, 0x0F, 0x47, 0x38, 0xFB,
291 0xBE, 0x00, 0x6A, 0x00, 0x58, 0xFF, 0x85, 0x00, 0xBB, 0xFF, 0x10,
292 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x38, 0xFF, 0xE6, 0x01, 0x34, 0xFC,
293 0xFD, 0x06, 0xCB, 0xF2, 0x8A, 0x23, 0x58, 0x3B, 0xB4, 0xF2, 0xBA,
294 0x05, 0x6A, 0xFD, 0x0B, 0x01, 0xAE, 0xFF, 0x0D, 0x00, 0x00, 0x00,
295 0xFF, 0xFF, 0x19, 0x00, 0x8C, 0xFF, 0x4D, 0x01, 0xFE, 0xFC, 0x56,
296 0x06, 0xF7, 0xF1, 0xBF, 0x37, 0x15, 0x28, 0x18, 0xF2, 0x25, 0x07,
297 0x34, 0xFC, 0xDC, 0x01, 0x3F, 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0x0C,
298 0x00, 0xCF, 0xFF, 0x52, 0x00, 0xC0, 0xFF, 0xAC, 0xFF, 0x0C, 0x02,
299 0xBC, 0xF8, 0x6D, 0x45, 0x8E, 0x12, 0x24, 0xF7, 0x4D, 0x05, 0xDB,
300 0xFC, 0xAE, 0x01, 0x48, 0xFF, 0x30, 0x00, 0xFF, 0xFF, 0x00, 0x00,
301 0x24, 0x00, 0x71, 0xFF, 0x43, 0x01, 0xC9, 0xFD, 0x60, 0x03, 0x2E,
302 0xFB, 0x7E, 0x07, 0xAF, 0x48, 0x2D, 0x00, 0x58, 0xFE, 0xBB, 0x01,
303 0xA3, 0xFE, 0xDD, 0x00, 0x99, 0xFF, 0x19, 0x00, 0xFE, 0xFF, 0x36,
304 0x00, 0x37, 0xFF, 0xDD, 0x01, 0x60, 0xFC, 0x6D, 0x06, 0x76, 0xF4,
305 0xD8, 0x1B, 0x95, 0x40, 0xC3, 0xF4, 0x56, 0x04, 0x4E, 0xFE, 0x85,
306 0x00, 0xF1, 0xFF, 0xF4, 0xFF, 0x04, 0x00, 0xFD, 0xFF, 0x29, 0x00,
307 0x60, 0xFF, 0xA2, 0x01, 0x7C, 0xFC, 0xFB, 0x06, 0x7C, 0xF1, 0x15,
308 0x31, 0x73, 0x2F, 0x81, 0xF1, 0x10, 0x07, 0x67, 0xFC, 0xB1, 0x01,
309 0x58, 0xFF, 0x2C, 0x00, 0xFD, 0xFF, 0x06, 0x00, 0xEE, 0xFF, 0x02,
310 0x00, 0x63, 0x00, 0x8A, 0xFE, 0xF3, 0x03, 0x63, 0xF5, 0xA1, 0x41,
311 0x12, 0x1A, 0xEB, 0xF4, 0x3F, 0x06, 0x72, 0xFC, 0xD7, 0x01, 0x39,
312 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x1B, 0x00, 0x91, 0xFF, 0xF1, 0x00,
313 0x79, 0xFE, 0x0A, 0x02, 0xC3, 0xFD, 0x73, 0x01, 0xDB, 0x48, 0x07,
314 0x06, 0xC7, 0xFB, 0x12, 0x03, 0xF1, 0xFD, 0x31, 0x01, 0x78, 0xFF,
315 0x22, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x32, 0x00, 0x43, 0xFF, 0xBA,
316 0x01, 0xBF, 0xFC, 0x8B, 0x05, 0x99, 0xF6, 0x43, 0x14, 0xA9, 0x44,
317 0xDE, 0xF7, 0x85, 0x02, 0x65, 0xFF, 0xE7, 0xFF, 0x3F, 0x00, 0xD6,
318 0xFF, 0x0A, 0x00, 0xFD, 0xFF, 0x32, 0x00, 0x44, 0xFF, 0xD5, 0x01,
319 0x3A, 0xFC, 0x2A, 0x07, 0xE3, 0xF1, 0xD1, 0x29, 0x46, 0x36, 0xC5,
320 0xF1, 0x87, 0x06, 0xDA, 0xFC, 0x64, 0x01, 0x80, 0xFF, 0x1E, 0x00,
321 0xFE, 0xFF, 0x01, 0x00, 0x08, 0x00, 0xBC, 0xFF, 0xEF, 0x00, 0x9A,
322 0xFD, 0x72, 0x05, 0x16, 0xF3, 0xA5, 0x3C, 0xC4, 0x21, 0x21, 0xF3,
323 0xE4, 0x06, 0x39, 0xFC, 0xE6, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD,
324 0xFF, 0x12, 0x00, 0xB3, 0xFF, 0x99, 0x00, 0x2E, 0xFF, 0xB6, 0x00,
325 0x36, 0x00, 0x47, 0xFC, 0x90, 0x47, 0xA4, 0x0C, 0x31, 0xF9, 0x5A,
326 0x04, 0x4E, 0xFD, 0x7C, 0x01, 0x5B, 0xFF, 0x2A, 0x00, 0x00, 0x00,
327 0x00, 0x00, 0x2B, 0x00, 0x59, 0xFF, 0x80, 0x01, 0x45, 0xFD, 0x6C,
328 0x04, 0x0B, 0xF9, 0x0B, 0x0D, 0x73, 0x47, 0x02, 0xFC, 0x58, 0x00,
329 0xA3, 0x00, 0x39, 0xFF, 0x94, 0x00, 0xB5, 0xFF, 0x12, 0x00, 0xFD,
330 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x37, 0xFC, 0xEB, 0x06,
331 0x0B, 0xF3, 0x35, 0x22, 0x52, 0x3C, 0xFD, 0xF2, 0x84, 0x05, 0x8D,
332 0xFD, 0xF6, 0x00, 0xB8, 0xFF, 0x09, 0x00, 0x01, 0x00, 0xFE, 0xFF,
333 0x1D, 0x00, 0x83, 0xFF, 0x5E, 0x01, 0xE3, 0xFC, 0x7B, 0x06, 0xD0,
334 0xF1, 0xA5, 0x36, 0x62, 0x29, 0xEF, 0xF1, 0x29, 0x07, 0x39, 0xFC,
335 0xD7, 0x01, 0x42, 0xFF, 0x33, 0x00, 0xFD, 0xFF, 0x0B, 0x00, 0xD5,
336 0xFF, 0x44, 0x00, 0xDD, 0xFF, 0x77, 0xFF, 0x67, 0x02, 0x14, 0xF8,
337 0xDC, 0x44, 0xD5, 0x13, 0xBC, 0xF6, 0x7C, 0x05, 0xC5, 0xFC, 0xB7,
338 0x01, 0x44, 0xFF, 0x31, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x22, 0x00,
339 0x76, 0xFF, 0x35, 0x01, 0xE7, 0xFD, 0x26, 0x03, 0xA1, 0xFB, 0x64,
340 0x06, 0xD2, 0x48, 0x21, 0x01, 0xE8, 0xFD, 0xF7, 0x01, 0x83, 0xFE,
341 0xEC, 0x00, 0x93, 0xFF, 0x1A, 0x00, 0xFE, 0xFF, 0x35, 0x00, 0x39,
342 0xFF, 0xD9, 0x01, 0x6D, 0xFC, 0x4B, 0x06, 0xCD, 0xF4, 0x83, 0x1A,
343 0x5F, 0x41, 0x3A, 0xF5, 0x0C, 0x04, 0x7B, 0xFE, 0x6C, 0x00, 0xFE,
344 0xFF, 0xEF, 0xFF, 0x05, 0x00, 0xFD, 0xFF, 0x2B, 0x00, 0x5A, 0xFF,
345 0xAD, 0x01, 0x6C, 0xFC, 0x0C, 0x07, 0x7F, 0xF1, 0xDC, 0x2F, 0xAD,
346 0x30, 0x7D, 0xF1, 0x01, 0x07, 0x76, 0xFC, 0xA6, 0x01, 0x5E, 0xFF,
347 0x2A, 0x00, 0xFD, 0xFF, 0x05, 0x00, 0xF3, 0xFF, 0xF5, 0xFF, 0x7D,
348 0x00, 0x5D, 0xFE, 0x3E, 0x04, 0xEA, 0xF4, 0xD9, 0x40, 0x66, 0x1B,
349 0x93, 0xF4, 0x62, 0x06, 0x64, 0xFC, 0xDC, 0x01, 0x38, 0xFF, 0x36,
350 0x00, 0xFE, 0xFF, 0x19, 0x00, 0x97, 0xFF, 0xE2, 0x00, 0x98, 0xFE,
351 0xCF, 0x01, 0x33, 0xFE, 0x7D, 0x00, 0xBB, 0x48, 0x1F, 0x07, 0x54,
352 0xFB, 0x4C, 0x03, 0xD3, 0xFD, 0x3F, 0x01, 0x73, 0xFF, 0x23, 0x00,
353 0x00, 0x00, 0xFF, 0xFF, 0x31, 0x00, 0x46, 0xFF, 0xB1, 0x01, 0xD3,
354 0xFC, 0x5D, 0x05, 0x01, 0xF7, 0xFB, 0x12, 0x3F, 0x45, 0x83, 0xF8,
355 0x2A, 0x02, 0x9A, 0xFF, 0xCA, 0xFF, 0x4E, 0x00, 0xD1, 0xFF, 0x0C,
356 0x00, 0xFD, 0xFF, 0x34, 0x00, 0x40, 0xFF, 0xDA, 0x01, 0x35, 0xFC,
357 0x27, 0x07, 0x09, 0xF2, 0x85, 0x28, 0x63, 0x37, 0xE9, 0xF1, 0x63,
358 0x06, 0xF5, 0xFC, 0x53, 0x01, 0x89, 0xFF, 0x1A, 0x00, 0xFE, 0xFF,
359 0x00, 0x00, 0x0C, 0x00, 0xB1, 0xFF, 0x04, 0x01, 0x76, 0xFD, 0xA8,
360 0x05, 0xCC, 0xF2, 0xAB, 0x3B, 0x18, 0x23, 0xE0, 0xF2, 0xF7, 0x06,
361 0x35, 0xFC, 0xE6, 0x01, 0x38, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x11,
362 0x00, 0xB9, 0xFF, 0x8A, 0x00, 0x4D, 0xFF, 0x7D, 0x00, 0x9C, 0x00,
363 0x7B, 0xFB, 0x31, 0x47, 0xD9, 0x0D, 0xC0, 0xF8, 0x8F, 0x04, 0x34,
364 0xFD, 0x87, 0x01, 0x56, 0xFF, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00,
365 0x29, 0x00, 0x5E, 0xFF, 0x74, 0x01, 0x5F, 0xFD, 0x35, 0x04, 0x7C,
366 0xF9, 0xD8, 0x0B, 0xC9, 0x47, 0xD4, 0xFC, 0xF0, 0xFF, 0xDD, 0x00,
367 0x19, 0xFF, 0xA4, 0x00, 0xAF, 0xFF, 0x13, 0x00, 0xFD, 0xFF, 0x36,
368 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3D, 0xFC, 0xD5, 0x06, 0x4F, 0xF3,
369 0xE0, 0x20, 0x45, 0x3D, 0x4D, 0xF3, 0x4B, 0x05, 0xB3, 0xFD, 0xE0,
370 0x00, 0xC3, 0xFF, 0x05, 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x20, 0x00,
371 0x7B, 0xFF, 0x6E, 0x01, 0xCA, 0xFC, 0x9D, 0x06, 0xB1, 0xF1, 0x86,
372 0x35, 0xAE, 0x2A, 0xCD, 0xF1, 0x2B, 0x07, 0x3F, 0xFC, 0xD1, 0x01,
373 0x46, 0xFF, 0x32, 0x00, 0xFD, 0xFF, 0x0A, 0x00, 0xDA, 0xFF, 0x36,
374 0x00, 0xFA, 0xFF, 0x43, 0xFF, 0xBF, 0x02, 0x75, 0xF7, 0x42, 0x44,
375 0x20, 0x15, 0x55, 0xF6, 0xA9, 0x05, 0xB2, 0xFC, 0xBF, 0x01, 0x41,
376 0xFF, 0x32, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x21, 0x00, 0x7C, 0xFF,
377 0x27, 0x01, 0x05, 0xFE, 0xEB, 0x02, 0x14, 0xFC, 0x50, 0x05, 0xEA,
378 0x48, 0x1B, 0x02, 0x78, 0xFD, 0x32, 0x02, 0x64, 0xFE, 0xFA, 0x00,
379 0x8D, 0xFF, 0x1C, 0x00, 0xFE, 0xFF, 0x35, 0x00, 0x3A, 0xFF, 0xD4,
380 0x01, 0x7C, 0xFC, 0x27, 0x06, 0x28, 0xF5, 0x31, 0x19, 0x21, 0x42,
381 0xB8, 0xF5, 0xC0, 0x03, 0xAA, 0xFE, 0x51, 0x00, 0x0B, 0x00, 0xEA,
382 0xFF, 0x06, 0x00, 0xFD, 0xFF, 0x2D, 0x00, 0x54, 0xFF, 0xB7, 0x01,
383 0x5E, 0xFC, 0x19, 0x07, 0x88, 0xF1, 0x9F, 0x2E, 0xE3, 0x31, 0x7E,
384 0xF1, 0xEE, 0x06, 0x88, 0xFC, 0x9A, 0x01, 0x64, 0xFF, 0x28, 0x00,
385 0xFD, 0xFF, 0x04, 0x00, 0xF7, 0xFF, 0xE8, 0xFF, 0x96, 0x00, 0x31,
386 0xFE, 0x84, 0x04, 0x79, 0xF4, 0x07, 0x40, 0xBA, 0x1C, 0x3E, 0xF4,
387 0x82, 0x06, 0x58, 0xFC, 0xE0, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFE,
388 0xFF, 0x18, 0x00, 0x9D, 0xFF, 0xD3, 0x00, 0xB8, 0xFE, 0x93, 0x01,
389 0xA1, 0xFE, 0x8E, 0xFF, 0x92, 0x48, 0x3D, 0x08, 0xE1, 0xFA, 0x86,
390 0x03, 0xB6, 0xFD, 0x4C, 0x01, 0x6D, 0xFF, 0x25, 0x00, 0x00, 0x00,
391 0xFF, 0xFF, 0x30, 0x00, 0x4A, 0xFF, 0xA8, 0x01, 0xE9, 0xFC, 0x2D,
392 0x05, 0x6B, 0xF7, 0xB6, 0x11, 0xC8, 0x45, 0x30, 0xF9, 0xCD, 0x01,
393 0xD0, 0xFF, 0xAC, 0xFF, 0x5C, 0x00, 0xCB, 0xFF, 0x0D, 0x00, 0xFD,
394 0xFF, 0x34, 0x00, 0x3E, 0xFF, 0xDF, 0x01, 0x33, 0xFC, 0x20, 0x07,
395 0x35, 0xF2, 0x36, 0x27, 0x78, 0x38, 0x14, 0xF2, 0x3B, 0x06, 0x11,
396 0xFD, 0x41, 0x01, 0x92, 0xFF, 0x17, 0x00, 0xFF, 0xFF, 0x00, 0x00,
397 0x10, 0x00, 0xA7, 0xFF, 0x19, 0x01, 0x53, 0xFD, 0xDB, 0x05, 0x88,
398 0xF2, 0xAD, 0x3A, 0x6D, 0x24, 0xA4, 0xF2, 0x08, 0x07, 0x32, 0xFC,
399 0xE5, 0x01, 0x39, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x10, 0x00, 0xBF,
400 0xFF, 0x7B, 0x00, 0x6C, 0xFF, 0x44, 0x00, 0x01, 0x01, 0xB6, 0xFA,
401 0xC8, 0x46, 0x13, 0x0F, 0x51, 0xF8, 0xC4, 0x04, 0x1B, 0xFD, 0x92,
402 0x01, 0x52, 0xFF, 0x2D, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x28, 0x00,
403 0x63, 0xFF, 0x67, 0x01, 0x7A, 0xFD, 0xFE, 0x03, 0xEE, 0xF9, 0xAA,
404 0x0A, 0x16, 0x48, 0xAC, 0xFD, 0x86, 0xFF, 0x17, 0x01, 0xFA, 0xFE,
405 0xB3, 0x00, 0xAA, 0xFF, 0x15, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36,
406 0xFF, 0xE5, 0x01, 0x44, 0xFC, 0xBD, 0x06, 0x97, 0xF3, 0x8A, 0x1F,
407 0x31, 0x3E, 0xA5, 0xF3, 0x0F, 0x05, 0xDA, 0xFD, 0xC9, 0x00, 0xCF,
408 0xFF, 0x01, 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x22, 0x00, 0x73, 0xFF,
409 0x7D, 0x01, 0xB3, 0xFC, 0xBB, 0x06, 0x9A, 0xF1, 0x60, 0x34, 0xF5,
410 0x2B, 0xB0, 0xF1, 0x28, 0x07, 0x47, 0xFC, 0xCA, 0x01, 0x4A, 0xFF,
411 0x30, 0x00, 0xFD, 0xFF, 0x09, 0x00, 0xDF, 0xFF, 0x28, 0x00, 0x17,
412 0x00, 0x10, 0xFF, 0x15, 0x03, 0xDD, 0xF6, 0x9E, 0x43, 0x6C, 0x16,
413 0xF1, 0xF5, 0xD3, 0x05, 0x9F, 0xFC, 0xC6, 0x01, 0x3F, 0xFF, 0x33,
414 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x1F, 0x00, 0x81, 0xFF, 0x19, 0x01,
415 0x23, 0xFE, 0xB0, 0x02, 0x87, 0xFC, 0x41, 0x04, 0xF4, 0x48, 0x1C,
416 0x03, 0x06, 0xFD, 0x6E, 0x02, 0x45, 0xFE, 0x09, 0x01, 0x88, 0xFF,
417 0x1D, 0x00, 0xFE, 0xFF, 0x34, 0x00, 0x3C, 0xFF, 0xCE, 0x01, 0x8C,
418 0xFC, 0x00, 0x06, 0x86, 0xF5, 0xE0, 0x17, 0xDB, 0x42, 0x3F, 0xF6,
419 0x71, 0x03, 0xD9, 0xFE, 0x36, 0x00, 0x18, 0x00, 0xE5, 0xFF, 0x07,
420 0x00, 0xFD, 0xFF, 0x2F, 0x00, 0x4F, 0xFF, 0xC1, 0x01, 0x52, 0xFC,
421 0x22, 0x07, 0x98, 0xF1, 0x5E, 0x2D, 0x13, 0x33, 0x87, 0xF1, 0xD8,
422 0x06, 0x9B, 0xFC, 0x8D, 0x01, 0x6B, 0xFF, 0x25, 0x00, 0xFD, 0xFF,
423 0x03, 0x00, 0xFC, 0xFF, 0xDC, 0xFF, 0xAF, 0x00, 0x07, 0xFE, 0xC8,
424 0x04, 0x10, 0xF4, 0x2D, 0x3F, 0x0F, 0x1E, 0xED, 0xF3, 0xA0, 0x06,
425 0x4E, 0xFC, 0xE3, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x16,
426 0x00, 0xA3, 0xFF, 0xC3, 0x00, 0xD7, 0xFE, 0x58, 0x01, 0x0F, 0xFF,
427 0xA6, 0xFE, 0x5D, 0x48, 0x61, 0x09, 0x6E, 0xFA, 0xC0, 0x03, 0x99,
428 0xFD, 0x59, 0x01, 0x68, 0xFF, 0x26, 0x00, 0x00, 0x00, 0xFF, 0xFF,
429 0x2E, 0x00, 0x4E, 0xFF, 0x9E, 0x01, 0x00, 0xFD, 0xFC, 0x04, 0xD7,
430 0xF7, 0x75, 0x10, 0x48, 0x46, 0xE4, 0xF9, 0x6E, 0x01, 0x06, 0x00,
431 0x8E, 0xFF, 0x6B, 0x00, 0xC6, 0xFF, 0x0E, 0x00, 0xFD, 0xFF, 0x35,
432 0x00, 0x3B, 0xFF, 0xE2, 0x01, 0x31, 0xFC, 0x16, 0x07, 0x67, 0xF2,
433 0xE5, 0x25, 0x87, 0x39, 0x47, 0xF2, 0x10, 0x06, 0x30, 0xFD, 0x2F,
434 0x01, 0x9C, 0xFF, 0x14, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x13, 0x00,
435 0x9D, 0xFF, 0x2D, 0x01, 0x33, 0xFD, 0x0B, 0x06, 0x4D, 0xF2, 0xA5,
436 0x39, 0xBF, 0x25, 0x6D, 0xF2, 0x15, 0x07, 0x31, 0xFC, 0xE2, 0x01,
437 0x3B, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x0E, 0x00, 0xC5, 0xFF, 0x6D,
438 0x00, 0x8B, 0xFF, 0x0D, 0x00, 0x63, 0x01, 0xF9, 0xF9, 0x55, 0x46,
439 0x51, 0x10, 0xE3, 0xF7, 0xF7, 0x04, 0x03, 0xFD, 0x9D, 0x01, 0x4E,
440 0xFF, 0x2E, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x26, 0x00, 0x68, 0xFF,
441 0x5B, 0x01, 0x96, 0xFD, 0xC6, 0x03, 0x61, 0xFA, 0x81, 0x09, 0x57,
442 0x48, 0x8D, 0xFE, 0x1B, 0xFF, 0x52, 0x01, 0xDB, 0xFE, 0xC2, 0x00,
443 0xA4, 0xFF, 0x16, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE3,
444 0x01, 0x4D, 0xFC, 0xA3, 0x06, 0xE4, 0xF3, 0x36, 0x1E, 0x16, 0x3F,
445 0x05, 0xF4, 0xCF, 0x04, 0x02, 0xFE, 0xB2, 0x00, 0xDB, 0xFF, 0xFC,
446 0xFF, 0x03, 0x00, 0xFD, 0xFF, 0x25, 0x00, 0x6C, 0xFF, 0x8B, 0x01,
447 0x9D, 0xFC, 0xD5, 0x06, 0x89, 0xF1, 0x35, 0x33, 0x3A, 0x2D, 0x9A,
448 0xF1, 0x23, 0x07, 0x51, 0xFC, 0xC2, 0x01, 0x4F, 0xFF, 0x2F, 0x00,
449 0xFD, 0xFF, 0x07, 0x00, 0xE5, 0xFF, 0x1A, 0x00, 0x33, 0x00, 0xDF,
450 0xFE, 0x68, 0x03, 0x4E, 0xF6, 0xEE, 0x42, 0xBB, 0x17, 0x90, 0xF5,
451 0xFC, 0x05, 0x8E, 0xFC, 0xCD, 0x01, 0x3C, 0xFF, 0x34, 0x00, 0xFE,
452 0xFF, 0x1E, 0x00, 0x87, 0xFF, 0x0B, 0x01, 0x42, 0xFE, 0x74, 0x02,
453 0xF9, 0xFC, 0x39, 0x03, 0xF5, 0x48, 0x24, 0x04, 0x94, 0xFC, 0xA9,
454 0x02, 0x27, 0xFE, 0x18, 0x01, 0x82, 0xFF, 0x1F, 0x00, 0x00, 0x00,
455 0xFF, 0xFF, 0x33, 0x00, 0x3E, 0xFF, 0xC7, 0x01, 0x9D, 0xFC, 0xD8,
456 0x05, 0xE7, 0xF5, 0x91, 0x16, 0x89, 0x43, 0xCD, 0xF6, 0x1E, 0x03,
457 0x0B, 0xFF, 0x1A, 0x00, 0x26, 0x00, 0xE0, 0xFF, 0x08, 0x00, 0xFD,
458 0xFF, 0x30, 0x00, 0x4B, 0xFF, 0xC9, 0x01, 0x48, 0xFC, 0x28, 0x07,
459 0xAD, 0xF1, 0x19, 0x2C, 0x3F, 0x34, 0x97, 0xF1, 0xBE, 0x06, 0xB0,
460 0xFC, 0x7F, 0x01, 0x72, 0xFF, 0x23, 0x00, 0xFE, 0xFF, 0x02, 0x00,
461 0x00, 0x00, 0xD0, 0xFF, 0xC7, 0x00, 0xDE, 0xFD, 0x08, 0x05, 0xB0,
462 0xF3, 0x4A, 0x3E, 0x64, 0x1F, 0xA0, 0xF3, 0xBB, 0x06, 0x45, 0xFC,
463 0xE5, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x15, 0x00, 0xA9,
464 0xFF, 0xB4, 0x00, 0xF7, 0xFE, 0x1D, 0x01, 0x7A, 0xFF, 0xC5, 0xFD,
465 0x1D, 0x48, 0x89, 0x0A, 0xFB, 0xF9, 0xF8, 0x03, 0x7D, 0xFD, 0x66,
466 0x01, 0x63, 0xFF, 0x28, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2D, 0x00,
467 0x52, 0xFF, 0x93, 0x01, 0x18, 0xFD, 0xC9, 0x04, 0x45, 0xF8, 0x36,
468 0x0F, 0xBB, 0x46, 0xA1, 0xFA, 0x0C, 0x01, 0x3E, 0x00, 0x70, 0xFF,
469 0x7A, 0x00, 0xC0, 0xFF, 0x0F, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x39,
470 0xFF, 0xE4, 0x01, 0x32, 0xFC, 0x09, 0x07, 0x9D, 0xF2, 0x92, 0x24,
471 0x8F, 0x3A, 0x82, 0xF2, 0xE1, 0x05, 0x50, 0xFD, 0x1B, 0x01, 0xA6,
472 0xFF, 0x10, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x17, 0x00, 0x93, 0xFF,
473 0x3F, 0x01, 0x15, 0xFD, 0x36, 0x06, 0x19, 0xF2, 0x97, 0x38, 0x11,
474 0x27, 0x3B, 0xF2, 0x1F, 0x07, 0x32, 0xFC, 0xDF, 0x01, 0x3D, 0xFF,
475 0x34, 0x00, 0xFD, 0xFF, 0x0D, 0x00, 0xCB, 0xFF, 0x5E, 0x00, 0xA9,
476 0xFF, 0xD6, 0xFF, 0xC3, 0x01, 0x43, 0xF9, 0xD7, 0x45, 0x92, 0x11,
477 0x77, 0xF7, 0x28, 0x05, 0xEC, 0xFC, 0xA7, 0x01, 0x4A, 0xFF, 0x2F,
478 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x25, 0x00, 0x6D, 0xFF, 0x4E, 0x01,
479 0xB3, 0xFD, 0x8D, 0x03, 0xD4, 0xFA, 0x5D, 0x08, 0x8D, 0x48, 0x74,
480 0xFF, 0xAE, 0xFE, 0x8D, 0x01, 0xBB, 0xFE, 0xD1, 0x00, 0x9E, 0xFF,
481 0x18, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE0, 0x01, 0x57,
482 0xFC, 0x85, 0x06, 0x34, 0xF4, 0xE0, 0x1C, 0xF0, 0x3F, 0x6D, 0xF4,
483 0x8C, 0x04, 0x2C, 0xFE, 0x99, 0x00, 0xE7, 0xFF, 0xF8, 0xFF, 0x04,
484 0x00, 0xFD, 0xFF, 0x27, 0x00, 0x65, 0xFF, 0x98, 0x01, 0x8A, 0xFC,
485 0xEC, 0x06, 0x7F, 0xF1, 0x04, 0x32, 0x7B, 0x2E, 0x8A, 0xF1, 0x1A,
486 0x07, 0x5D, 0xFC, 0xB8, 0x01, 0x54, 0xFF, 0x2D, 0x00, 0xFD, 0xFF,
487 0x06, 0x00, 0xEA, 0xFF, 0x0C, 0x00, 0x4E, 0x00, 0xAF, 0xFE, 0xB8,
488 0x03, 0xC7, 0xF5, 0x38, 0x42, 0x0C, 0x19, 0x32, 0xF5, 0x23, 0x06,
489 0x7D, 0xFC, 0xD3, 0x01, 0x3A, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x1C,
490 0x00, 0x8D, 0xFF, 0xFC, 0x00, 0x61, 0xFE, 0x39, 0x02, 0x6B, 0xFD,
491 0x37, 0x02, 0xEB, 0x48, 0x31, 0x05, 0x21, 0xFC, 0xE4, 0x02, 0x08,
492 0xFE, 0x26, 0x01, 0x7C, 0xFF, 0x21, 0x00, 0x00, 0x00, 0xFF, 0xFF,
493 0x32, 0x00, 0x41, 0xFF, 0xC0, 0x01, 0xAF, 0xFC, 0xAD, 0x05, 0x4A,
494 0xF6, 0x44, 0x15, 0x2F, 0x44, 0x64, 0xF7, 0xC9, 0x02, 0x3D, 0xFF,
495 0xFE, 0xFF, 0x34, 0x00, 0xDB, 0xFF, 0x09, 0x00, 0xFD, 0xFF, 0x32,
496 0x00, 0x47, 0xFF, 0xD0, 0x01, 0x40, 0xFC, 0x2A, 0x07, 0xCA, 0xF1,
497 0xD1, 0x2A, 0x65, 0x35, 0xAE, 0xF1, 0xA0, 0x06, 0xC7, 0xFC, 0x70,
498 0x01, 0x7A, 0xFF, 0x20, 0x00, 0xFE, 0xFF, 0x02, 0x00, 0x05, 0x00,
499 0xC5, 0xFF, 0xDE, 0x00, 0xB7, 0xFD, 0x45, 0x05, 0x56, 0xF3, 0x61,
500 0x3D, 0xBA, 0x20, 0x56, 0xF3, 0xD3, 0x06, 0x3E, 0xFC, 0xE6, 0x01,
501 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x13, 0x00, 0xAF, 0xFF, 0xA5,
502 0x00, 0x16, 0xFF, 0xE3, 0x00, 0xE4, 0xFF, 0xEB, 0xFC, 0xD2, 0x47,
503 0xB6, 0x0B, 0x89, 0xF9, 0x2F, 0x04, 0x62, 0xFD, 0x72, 0x01, 0x5E,
504 0xFF, 0x29, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2C, 0x00, 0x56, 0xFF,
505 0x88, 0x01, 0x31, 0xFD, 0x95, 0x04, 0xB4, 0xF8, 0xFC, 0x0D, 0x26,
506 0x47, 0x64, 0xFB, 0xA7, 0x00, 0x77, 0x00, 0x51, 0xFF, 0x89, 0x00,
507 0xBA, 0xFF, 0x11, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x38, 0xFF, 0xE6,
508 0x01, 0x34, 0xFC, 0xF9, 0x06, 0xD9, 0xF2, 0x3F, 0x23, 0x90, 0x3B,
509 0xC4, 0xF2, 0xAE, 0x05, 0x72, 0xFD, 0x07, 0x01, 0xB0, 0xFF, 0x0C,
510 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x1A, 0x00, 0x8A, 0xFF, 0x51, 0x01,
511 0xF8, 0xFC, 0x5E, 0x06, 0xED, 0xF1, 0x82, 0x37, 0x60, 0x28, 0x0E,
512 0xF2, 0x26, 0x07, 0x35, 0xFC, 0xDB, 0x01, 0x40, 0xFF, 0x34, 0x00,
513 0xFD, 0xFF, 0x0C, 0x00, 0xD0, 0xFF, 0x4F, 0x00, 0xC7, 0xFF, 0xA0,
514 0xFF, 0x20, 0x02, 0x96, 0xF8, 0x4E, 0x45, 0xD7, 0x12, 0x0D, 0xF7,
515 0x58, 0x05, 0xD6, 0xFC, 0xB0, 0x01, 0x47, 0xFF, 0x30, 0x00, 0xFF,
516 0xFF, 0x00, 0x00, 0x23, 0x00, 0x72, 0xFF, 0x40, 0x01, 0xD0, 0xFD,
517 0x53, 0x03, 0x47, 0xFB, 0x3F, 0x07, 0xB8, 0x48, 0x62, 0x00, 0x3F,
518 0xFE, 0xC8, 0x01, 0x9C, 0xFE, 0xE0, 0x00, 0x98, 0xFF, 0x19, 0x00,
519 0xFE, 0xFF, 0x36, 0x00, 0x38, 0xFF, 0xDC, 0x01, 0x63, 0xFC, 0x66,
520 0x06, 0x89, 0xF4, 0x8C, 0x1B, 0xC3, 0x40, 0xDD, 0xF4, 0x46, 0x04,
521 0x58, 0xFE, 0x80, 0x00, 0xF4, 0xFF, 0xF3, 0xFF, 0x05, 0x00, 0xFD,
522 0xFF, 0x29, 0x00, 0x5F, 0xFF, 0xA5, 0x01, 0x78, 0xFC, 0xFF, 0x06,
523 0x7D, 0xF1, 0xCF, 0x30, 0xB8, 0x2F, 0x80, 0xF1, 0x0D, 0x07, 0x6A,
524 0xFC, 0xAE, 0x01, 0x59, 0xFF, 0x2B, 0x00, 0xFD, 0xFF, 0x05, 0x00,
525 0xEF, 0xFF, 0xFF, 0xFF, 0x69, 0x00, 0x80, 0xFE, 0x04, 0x04, 0x48,
526 0xF5, 0x74, 0x41, 0x5D, 0x1A, 0xD7, 0xF4, 0x47, 0x06, 0x6F, 0xFC,
527 0xD8, 0x01, 0x39, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x1B, 0x00, 0x93,
528 0xFF, 0xED, 0x00, 0x80, 0xFE, 0xFD, 0x01, 0xDC, 0xFD, 0x3C, 0x01,
529 0xD5, 0x48, 0x45, 0x06, 0xAE, 0xFB, 0x1F, 0x03, 0xEA, 0xFD, 0x34,
530 0x01, 0x77, 0xFF, 0x22, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x31, 0x00,
531 0x44, 0xFF, 0xB8, 0x01, 0xC3, 0xFC, 0x81, 0x05, 0xB0, 0xF6, 0xFA,
532 0x13, 0xCC, 0x44, 0x02, 0xF8, 0x71, 0x02, 0x71, 0xFF, 0xE1, 0xFF,
533 0x42, 0x00, 0xD5, 0xFF, 0x0B, 0x00, 0xFD, 0xFF, 0x33, 0x00, 0x43,
534 0xFF, 0xD6, 0x01, 0x39, 0xFC, 0x2A, 0x07, 0xEB, 0xF1, 0x87, 0x29,
535 0x85, 0x36, 0xCC, 0xF1, 0x7F, 0x06, 0xE0, 0xFC, 0x60, 0x01, 0x82,
536 0xFF, 0x1D, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x09, 0x00, 0xBA, 0xFF,
537 0xF4, 0x00, 0x91, 0xFD, 0x7E, 0x05, 0x05, 0xF3, 0x6E, 0x3C, 0x10,
538 0x22, 0x12, 0xF3, 0xE9, 0x06, 0x38, 0xFC, 0xE6, 0x01, 0x37, 0xFF,
539 0x36, 0x00, 0xFD, 0xFF, 0x12, 0x00, 0xB5, 0xFF, 0x96, 0x00, 0x35,
540 0xFF, 0xA9, 0x00, 0x4D, 0x00, 0x19, 0xFC, 0x7C, 0x47, 0xE8, 0x0C,
541 0x18, 0xF9, 0x66, 0x04, 0x48, 0xFD, 0x7E, 0x01, 0x5A, 0xFF, 0x2B,
542 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x5A, 0xFF, 0x7D, 0x01,
543 0x4B, 0xFD, 0x60, 0x04, 0x24, 0xF9, 0xC6, 0x0C, 0x86, 0x47, 0x30,
544 0xFC, 0x41, 0x00, 0xB0, 0x00, 0x32, 0xFF, 0x98, 0x00, 0xB4, 0xFF,
545 0x12, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x38,
546 0xFC, 0xE6, 0x06, 0x19, 0xF3, 0xEA, 0x21, 0x8A, 0x3C, 0x0E, 0xF3,
547 0x78, 0x05, 0x96, 0xFD, 0xF1, 0x00, 0xBB, 0xFF, 0x08, 0x00, 0x01,
548 0x00, 0xFE, 0xFF, 0x1D, 0x00, 0x81, 0xFF, 0x62, 0x01, 0xDD, 0xFC,
549 0x83, 0x06, 0xC9, 0xF1, 0x66, 0x36, 0xAC, 0x29, 0xE7, 0xF1, 0x2A,
550 0x07, 0x3A, 0xFC, 0xD5, 0x01, 0x43, 0xFF, 0x33, 0x00, 0xFD, 0xFF,
551 0x0B, 0x00, 0xD6, 0xFF, 0x41, 0x00, 0xE4, 0xFF, 0x6B, 0xFF, 0x7B,
552 0x02, 0xF0, 0xF7, 0xBA, 0x44, 0x1E, 0x14, 0xA5, 0xF6, 0x86, 0x05,
553 0xC1, 0xFC, 0xB9, 0x01, 0x44, 0xFF, 0x32, 0x00, 0xFF, 0xFF, 0x00,
554 0x00, 0x22, 0x00, 0x77, 0xFF, 0x32, 0x01, 0xED, 0xFD, 0x19, 0x03,
555 0xBB, 0xFB, 0x26, 0x06, 0xD7, 0x48, 0x58, 0x01, 0xCF, 0xFD, 0x04,
556 0x02, 0x7D, 0xFE, 0xEF, 0x00, 0x92, 0xFF, 0x1B, 0x00, 0xFE, 0xFF,
557 0x35, 0x00, 0x39, 0xFF, 0xD8, 0x01, 0x70, 0xFC, 0x43, 0x06, 0xE1,
558 0xF4, 0x38, 0x1A, 0x8C, 0x41, 0x55, 0xF5, 0xFC, 0x03, 0x85, 0xFE,
559 0x66, 0x00, 0x01, 0x00, 0xEE, 0xFF, 0x06, 0x00, 0xFD, 0xFF, 0x2B,
560 0x00, 0x59, 0xFF, 0xB0, 0x01, 0x69, 0xFC, 0x0F, 0x07, 0x80, 0xF1,
561 0x96, 0x2F, 0xF2, 0x30, 0x7C, 0xF1, 0xFD, 0x06, 0x7A, 0xFC, 0xA3,
562 0x01, 0x5F, 0xFF, 0x29, 0x00, 0xFD, 0xFF, 0x05, 0x00, 0xF4, 0xFF,
563 0xF2, 0xFF, 0x83, 0x00, 0x53, 0xFE, 0x4E, 0x04, 0xD0, 0xF4, 0xAB,
564 0x40, 0xB2, 0x1B, 0x7F, 0xF4, 0x69, 0x06, 0x62, 0xFC, 0xDD, 0x01,
565 0x38, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x19, 0x00, 0x98, 0xFF, 0xDE,
566 0x00, 0x9F, 0xFE, 0xC2, 0x01, 0x4B, 0xFE, 0x48, 0x00, 0xB3, 0x48,
567 0x5E, 0x07, 0x3B, 0xFB, 0x59, 0x03, 0xCD, 0xFD, 0x42, 0x01, 0x71,
568 0xFF, 0x24, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x30, 0x00, 0x47, 0xFF,
569 0xAF, 0x01, 0xD8, 0xFC, 0x52, 0x05, 0x19, 0xF7, 0xB2, 0x12, 0x5C,
570 0x45, 0xA9, 0xF8, 0x16, 0x02, 0xA6, 0xFF, 0xC3, 0xFF, 0x51, 0x00,
571 0xD0, 0xFF, 0x0C, 0x00, 0xFD, 0xFF, 0x34, 0x00, 0x40, 0xFF, 0xDB,
572 0x01, 0x35, 0xFC, 0x25, 0x07, 0x13, 0xF2, 0x3A, 0x28, 0xA0, 0x37,
573 0xF2, 0xF1, 0x5A, 0x06, 0xFB, 0xFC, 0x4F, 0x01, 0x8B, 0xFF, 0x1A,
574 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x0D, 0x00, 0xAF, 0xFF, 0x09, 0x01,
575 0x6E, 0xFD, 0xB4, 0x05, 0xBC, 0xF2, 0x73, 0x3B, 0x64, 0x23, 0xD2,
576 0xF2, 0xFB, 0x06, 0x34, 0xFC, 0xE6, 0x01, 0x38, 0xFF, 0x36, 0x00,
577 0xFD, 0xFF, 0x11, 0x00, 0xBB, 0xFF, 0x87, 0x00, 0x54, 0xFF, 0x70,
578 0x00, 0xB3, 0x00, 0x4E, 0xFB, 0x1A, 0x47, 0x1F, 0x0E, 0xA8, 0xF8,
579 0x9B, 0x04, 0x2E, 0xFD, 0x8A, 0x01, 0x55, 0xFF, 0x2C, 0x00, 0xFF,
580 0xFF, 0x00, 0x00, 0x29, 0x00, 0x5F, 0xFF, 0x71, 0x01, 0x65, 0xFD,
581 0x29, 0x04, 0x96, 0xF9, 0x95, 0x0B, 0xDC, 0x47, 0x03, 0xFD, 0xD9,
582 0xFF, 0xEA, 0x00, 0x12, 0xFF, 0xA7, 0x00, 0xAE, 0xFF, 0x14, 0x00,
583 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3E, 0xFC, 0xD0,
584 0x06, 0x5E, 0xF3, 0x94, 0x20, 0x7B, 0x3D, 0x60, 0xF3, 0x3E, 0x05,
585 0xBB, 0xFD, 0xDB, 0x00, 0xC6, 0xFF, 0x04, 0x00, 0x02, 0x00, 0xFE,
586 0xFF, 0x20, 0x00, 0x79, 0xFF, 0x72, 0x01, 0xC4, 0xFC, 0xA4, 0x06,
587 0xAB, 0xF1, 0x46, 0x35, 0xF7, 0x2A, 0xC6, 0xF1, 0x2A, 0x07, 0x40,
588 0xFC, 0xCF, 0x01, 0x47, 0xFF, 0x31, 0x00, 0xFD, 0xFF, 0x09, 0x00,
589 0xDB, 0xFF, 0x33, 0x00, 0x01, 0x00, 0x38, 0xFF, 0xD3, 0x02, 0x53,
590 0xF7, 0x1F, 0x44, 0x69, 0x15, 0x3F, 0xF6, 0xB2, 0x05, 0xAD, 0xFC,
591 0xC1, 0x01, 0x41, 0xFF, 0x32, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x20,
592 0x00, 0x7D, 0xFF, 0x24, 0x01, 0x0C, 0xFE, 0xDE, 0x02, 0x2E, 0xFC,
593 0x13, 0x05, 0xEC, 0x48, 0x54, 0x02, 0x5E, 0xFD, 0x3F, 0x02, 0x5D,
594 0xFE, 0xFE, 0x00, 0x8C, 0xFF, 0x1C, 0x00, 0xFE, 0xFF, 0x35, 0x00,
595 0x3B, 0xFF, 0xD3, 0x01, 0x7F, 0xFC, 0x1F, 0x06, 0x3C, 0xF5, 0xE6,
596 0x18, 0x4D, 0x42, 0xD5, 0xF5, 0xAF, 0x03, 0xB4, 0xFE, 0x4B, 0x00,
597 0x0E, 0x00, 0xE9, 0xFF, 0x07, 0x00, 0xFD, 0xFF, 0x2D, 0x00, 0x53,
598 0xFF, 0xBA, 0x01, 0x5B, 0xFC, 0x1B, 0x07, 0x8B, 0xF1, 0x58, 0x2E,
599 0x26, 0x32, 0x80, 0xF1, 0xEA, 0x06, 0x8C, 0xFC, 0x97, 0x01, 0x66,
600 0xFF, 0x27, 0x00, 0xFD, 0xFF, 0x04, 0x00, 0xF8, 0xFF, 0xE6, 0xFF,
601 0x9C, 0x00, 0x27, 0xFE, 0x94, 0x04, 0x61, 0xF4, 0xD7, 0x3F, 0x06,
602 0x1D, 0x2B, 0xF4, 0x89, 0x06, 0x56, 0xFC, 0xE0, 0x01, 0x37, 0xFF,
603 0x36, 0x00, 0xFE, 0xFF, 0x17, 0x00, 0x9E, 0xFF, 0xCF, 0x00, 0xBF,
604 0xFE, 0x86, 0x01, 0xBA, 0xFE, 0x5A, 0xFF, 0x86, 0x48, 0x7D, 0x08,
605 0xC7, 0xFA, 0x93, 0x03, 0xB0, 0xFD, 0x4F, 0x01, 0x6C, 0xFF, 0x25,
606 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2F, 0x00, 0x4B, 0xFF, 0xA6, 0x01,
607 0xEE, 0xFC, 0x23, 0x05, 0x83, 0xF7, 0x6E, 0x11, 0xE5, 0x45, 0x57,
608 0xF9, 0xB8, 0x01, 0xDC, 0xFF, 0xA5, 0xFF, 0x5F, 0x00, 0xCA, 0xFF,
609 0x0D, 0x00, 0xFD, 0xFF, 0x35, 0x00, 0x3D, 0xFF, 0xDF, 0x01, 0x32,
610 0xFC, 0x1E, 0x07, 0x40, 0xF2, 0xEB, 0x26, 0xB5, 0x38, 0x1F, 0xF2,
611 0x32, 0x06, 0x18, 0xFD, 0x3D, 0x01, 0x94, 0xFF, 0x16, 0x00, 0xFF,
612 0xFF, 0x00, 0x00, 0x11, 0x00, 0xA4, 0xFF, 0x1D, 0x01, 0x4C, 0xFD,
613 0xE6, 0x05, 0x7B, 0xF2, 0x71, 0x3A, 0xB8, 0x24, 0x97, 0xF2, 0x0B,
614 0x07, 0x32, 0xFC, 0xE4, 0x01, 0x39, 0xFF, 0x36, 0x00, 0xFD, 0xFF,
615 0x0F, 0x00, 0xC0, 0xFF, 0x78, 0x00, 0x73, 0xFF, 0x38, 0x00, 0x17,
616 0x01, 0x8B, 0xFA, 0xAF, 0x46, 0x59, 0x0F, 0x39, 0xF8, 0xCF, 0x04,
617 0x15, 0xFD, 0x95, 0x01, 0x51, 0xFF, 0x2D, 0x00, 0xFF, 0xFF, 0x00,
618 0x00, 0x28, 0x00, 0x64, 0xFF, 0x65, 0x01, 0x81, 0xFD, 0xF2, 0x03,
619 0x08, 0xFA, 0x68, 0x0A, 0x25, 0x48, 0xDE, 0xFD, 0x6E, 0xFF, 0x24,
620 0x01, 0xF3, 0xFE, 0xB6, 0x00, 0xA8, 0xFF, 0x15, 0x00, 0xFD, 0xFF,
621 0x36, 0x00, 0x36, 0xFF, 0xE5, 0x01, 0x46, 0xFC, 0xB8, 0x06, 0xA8,
622 0xF3, 0x3F, 0x1F, 0x64, 0x3E, 0xBA, 0xF3, 0x01, 0x05, 0xE2, 0xFD,
623 0xC4, 0x00, 0xD2, 0xFF, 0x00, 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x23,
624 0x00, 0x71, 0xFF, 0x81, 0x01, 0xAE, 0xFC, 0xC1, 0x06, 0x95, 0xF1,
625 0x1E, 0x34, 0x3E, 0x2C, 0xAB, 0xF1, 0x27, 0x07, 0x49, 0xFC, 0xC8,
626 0x01, 0x4B, 0xFF, 0x30, 0x00, 0xFD, 0xFF, 0x08, 0x00, 0xE1, 0xFF,
627 0x25, 0x00, 0x1D, 0x00, 0x05, 0xFF, 0x28, 0x03, 0xBD, 0xF6, 0x77,
628 0x43, 0xB6, 0x16, 0xDC, 0xF5, 0xDD, 0x05, 0x9B, 0xFC, 0xC8, 0x01,
629 0x3E, 0xFF, 0x33, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x1F, 0x00, 0x83,
630 0xFF, 0x16, 0x01, 0x2A, 0xFE, 0xA3, 0x02, 0xA1, 0xFC, 0x06, 0x04,
631 0xF5, 0x48, 0x56, 0x03, 0xED, 0xFC, 0x7B, 0x02, 0x3E, 0xFE, 0x0C,
632 0x01, 0x86, 0xFF, 0x1E, 0x00, 0xFE, 0xFF, 0x34, 0x00, 0x3D, 0xFF,
633 0xCC, 0x01, 0x8F, 0xFC, 0xF8, 0x05, 0x9B, 0xF5, 0x96, 0x17, 0x02,
634 0x43, 0x5E, 0xF6, 0x5F, 0x03, 0xE4, 0xFE, 0x30, 0x00, 0x1B, 0x00,
635 0xE4, 0xFF, 0x08, 0x00, 0xFD, 0xFF, 0x2F, 0x00, 0x4E, 0xFF, 0xC3,
636 0x01, 0x4F, 0xFC, 0x24, 0x07, 0x9C, 0xF1, 0x17, 0x2D, 0x57, 0x33,
637 0x8A, 0xF1, 0xD3, 0x06, 0x9F, 0xFC, 0x8A, 0x01, 0x6D, 0xFF, 0x25,
638 0x00, 0xFD, 0xFF, 0x03, 0x00, 0xFD, 0xFF, 0xD9, 0xFF, 0xB4, 0x00,
639 0xFD, 0xFD, 0xD7, 0x04, 0xFA, 0xF3, 0xFC, 0x3E, 0x5B, 0x1E, 0xDB,
640 0xF3, 0xA6, 0x06, 0x4C, 0xFC, 0xE3, 0x01, 0x36, 0xFF, 0x36, 0x00,
641 0xFE, 0xFF, 0x16, 0x00, 0xA4, 0xFF, 0xC0, 0x00, 0xDE, 0xFE, 0x4B,
642 0x01, 0x27, 0xFF, 0x73, 0xFE, 0x4F, 0x48, 0xA2, 0x09, 0x54, 0xFA,
643 0xCC, 0x03, 0x93, 0xFD, 0x5C, 0x01, 0x67, 0xFF, 0x27, 0x00, 0x00,
644 0x00, 0xFF, 0xFF, 0x2E, 0x00, 0x4E, 0xFF, 0x9C, 0x01, 0x05, 0xFD,
645 0xF1, 0x04, 0xF0, 0xF7, 0x2D, 0x10, 0x61, 0x46, 0x0D, 0xFA, 0x58,
646 0x01, 0x13, 0x00, 0x87, 0xFF, 0x6E, 0x00, 0xC4, 0xFF, 0x0E, 0x00,
647 0xFD, 0xFF, 0x35, 0x00, 0x3B, 0xFF, 0xE3, 0x01, 0x31, 0xFC, 0x14,
648 0x07, 0x73, 0xF2, 0x99, 0x25, 0xC2, 0x39, 0x54, 0xF2, 0x05, 0x06,
649 0x37, 0xFD, 0x2B, 0x01, 0x9E, 0xFF, 0x13, 0x00, 0xFF, 0xFF, 0xFF,
650 0xFF, 0x14, 0x00, 0x9B, 0xFF, 0x31, 0x01, 0x2C, 0xFD, 0x15, 0x06,
651 0x41, 0xF2, 0x6A, 0x39, 0x0A, 0x26, 0x61, 0xF2, 0x17, 0x07, 0x31,
652 0xFC, 0xE2, 0x01, 0x3B, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x0E, 0x00,
653 0xC6, 0xFF, 0x69, 0x00, 0x91, 0xFF, 0x00, 0x00, 0x78, 0x01, 0xD0,
654 0xF9, 0x39, 0x46, 0x98, 0x10, 0xCB, 0xF7, 0x02, 0x05, 0xFE, 0xFC,
655 0x9F, 0x01, 0x4D, 0xFF, 0x2E, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x26,
656 0x00, 0x69, 0xFF, 0x58, 0x01, 0x9D, 0xFD, 0xB9, 0x03, 0x7B, 0xFA,
657 0x40, 0x09, 0x63, 0x48, 0xBF, 0xFE, 0x03, 0xFF, 0x5F, 0x01, 0xD4,
658 0xFE, 0xC5, 0x00, 0xA2, 0xFF, 0x16, 0x00, 0xFE, 0xFF, 0x36, 0x00,
659 0x36, 0xFF, 0xE2, 0x01, 0x4F, 0xFC, 0x9C, 0x06, 0xF5, 0xF3, 0xEA,
660 0x1D, 0x47, 0x3F, 0x1B, 0xF4, 0xC1, 0x04, 0x0B, 0xFE, 0xAC, 0x00,
661 0xDE, 0xFF, 0xFB, 0xFF, 0x03, 0x00, 0xFD, 0xFF, 0x25, 0x00, 0x6A,
662 0xFF, 0x8E, 0x01, 0x99, 0xFC, 0xDB, 0x06, 0x86, 0xF1, 0xF2, 0x32,
663 0x82, 0x2D, 0x96, 0xF1, 0x21, 0x07, 0x53, 0xFC, 0xC0, 0x01, 0x50,
664 0xFF, 0x2E, 0x00, 0xFD, 0xFF, 0x07, 0x00, 0xE6, 0xFF, 0x17, 0x00,
665 0x39, 0x00, 0xD4, 0xFE, 0x7A, 0x03, 0x2F, 0xF6, 0xC7, 0x42, 0x06,
666 0x18, 0x7B, 0xF5, 0x05, 0x06, 0x8A, 0xFC, 0xCF, 0x01, 0x3C, 0xFF,
667 0x34, 0x00, 0xFE, 0xFF, 0x1D, 0x00, 0x88, 0xFF, 0x07, 0x01, 0x49,
668 0xFE, 0x67, 0x02, 0x13, 0xFD, 0xFF, 0x02, 0xF4, 0x48, 0x5F, 0x04,
669 0x7A, 0xFC, 0xB6, 0x02, 0x20, 0xFE, 0x1B, 0x01, 0x81, 0xFF, 0x1F,
670 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x33, 0x00, 0x3F, 0xFF, 0xC6, 0x01,
671 0xA1, 0xFC, 0xCF, 0x05, 0xFC, 0xF5, 0x47, 0x16, 0xB0, 0x43, 0xEE,
672 0xF6, 0x0C, 0x03, 0x16, 0xFF, 0x14, 0x00, 0x29, 0x00, 0xDF, 0xFF,
673 0x09, 0x00, 0xFD, 0xFF, 0x30, 0x00, 0x4A, 0xFF, 0xCA, 0x01, 0x46,
674 0xFC, 0x29, 0x07, 0xB3, 0xF1, 0xD1, 0x2B, 0x81, 0x34, 0x9C, 0xF1,
675 0xB8, 0x06, 0xB5, 0xFC, 0x7C, 0x01, 0x74, 0xFF, 0x22, 0x00, 0xFE,
676 0xFF, 0x02, 0x00, 0x01, 0x00, 0xCE, 0xFF, 0xCC, 0x00, 0xD5, 0xFD,
677 0x16, 0x05, 0x9B, 0xF3, 0x18, 0x3E, 0xB1, 0x1F, 0x8F, 0xF3, 0xC0,
678 0x06, 0x43, 0xFC, 0xE5, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF,
679 0x15, 0x00, 0xAA, 0xFF, 0xB1, 0x00, 0xFE, 0xFE, 0x10, 0x01, 0x92,
680 0xFF, 0x94, 0xFD, 0x0D, 0x48, 0xCB, 0x0A, 0xE2, 0xF9, 0x04, 0x04,
681 0x77, 0xFD, 0x69, 0x01, 0x62, 0xFF, 0x28, 0x00, 0x00, 0x00, 0xFF,
682 0xFF, 0x2D, 0x00, 0x52, 0xFF, 0x91, 0x01, 0x1E, 0xFD, 0xBE, 0x04,
683 0x5E, 0xF8, 0xF0, 0x0E, 0xD3, 0x46, 0xCB, 0xFA, 0xF6, 0x00, 0x4B,
684 0x00, 0x69, 0xFF, 0x7D, 0x00, 0xBE, 0xFF, 0x10, 0x00, 0xFD, 0xFF,
685 0x36, 0x00, 0x39, 0xFF, 0xE5, 0x01, 0x32, 0xFC, 0x06, 0x07, 0xAA,
686 0xF2, 0x46, 0x24, 0xC8, 0x3A, 0x90, 0xF2, 0xD6, 0x05, 0x57, 0xFD,
687 0x17, 0x01, 0xA8, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x18,
688 0x00, 0x91, 0xFF, 0x43, 0x01, 0x0E, 0xFD, 0x40, 0x06, 0x0F, 0xF2,
689 0x5B, 0x38, 0x5C, 0x27, 0x30, 0xF2, 0x21, 0x07, 0x33, 0xFC, 0xDE,
690 0x01, 0x3E, 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0x0D, 0x00, 0xCC, 0xFF,
691 0x5A, 0x00, 0xAF, 0xFF, 0xCA, 0xFF, 0xD8, 0x01, 0x1C, 0xF9, 0xB8,
692 0x45, 0xDA, 0x11, 0x60, 0xF7, 0x33, 0x05, 0xE7, 0xFC, 0xA9, 0x01,
693 0x4A, 0xFF, 0x30, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x25, 0x00, 0x6E,
694 0xFF, 0x4B, 0x01, 0xB9, 0xFD, 0x80, 0x03, 0xEE, 0xFA, 0x1D, 0x08,
695 0x98, 0x48, 0xA8, 0xFF, 0x95, 0xFE, 0x9A, 0x01, 0xB4, 0xFE, 0xD4,
696 0x00, 0x9C, 0xFF, 0x18, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x37, 0xFF,
697 0xDF, 0x01, 0x5A, 0xFC, 0x7E, 0x06, 0x47, 0xF4, 0x94, 0x1C, 0x1F,
698 0x40, 0x85, 0xF4, 0x7D, 0x04, 0x36, 0xFE, 0x93, 0x00, 0xEA, 0xFF,
699 0xF7, 0xFF, 0x04, 0x00, 0xFD, 0xFF, 0x28, 0x00, 0x63, 0xFF, 0x9B,
700 0x01, 0x86, 0xFC, 0xF1, 0x06, 0x7E, 0xF1, 0xC0, 0x31, 0xC2, 0x2E,
701 0x87, 0xF1, 0x17, 0x07, 0x5F, 0xFC, 0xB6, 0x01, 0x55, 0xFF, 0x2D,
702 0x00, 0xFD, 0xFF, 0x06, 0x00, 0xEB, 0xFF, 0x09, 0x00, 0x54, 0x00,
703 0xA4, 0xFE, 0xC9, 0x03, 0xAA, 0xF5, 0x0C, 0x42, 0x56, 0x19, 0x1E,
704 0xF5, 0x2B, 0x06, 0x7A, 0xFC, 0xD4, 0x01, 0x3A, 0xFF, 0x35, 0x00,
705 0xFE, 0xFF, 0x1C, 0x00, 0x8E, 0xFF, 0xF9, 0x00, 0x68, 0xFE, 0x2C,
706 0x02, 0x84, 0xFD, 0xFF, 0x01, 0xE6, 0x48, 0x6E, 0x05, 0x07, 0xFC,
707 0xF1, 0x02, 0x01, 0xFE, 0x29, 0x01, 0x7B, 0xFF, 0x21, 0x00, 0x00,
708 0x00, 0xFF, 0xFF, 0x32, 0x00, 0x42, 0xFF, 0xBE, 0x01, 0xB4, 0xFC,
709 0xA4, 0x05, 0x61, 0xF6, 0xFB, 0x14, 0x53, 0x44, 0x86, 0xF7, 0xB6,
710 0x02, 0x49, 0xFF, 0xF7, 0xFF, 0x37, 0x00, 0xD9, 0xFF, 0x0A, 0x00,
711 0xFD, 0xFF, 0x32, 0x00, 0x46, 0xFF, 0xD1, 0x01, 0x3E, 0xFC, 0x2B,
712 0x07, 0xD0, 0xF1, 0x89, 0x2A, 0xA6, 0x35, 0xB4, 0xF1, 0x99, 0x06,
713 0xCD, 0xFC, 0x6D, 0x01, 0x7C, 0xFF, 0x1F, 0x00, 0xFE, 0xFF, 0x01,
714 0x00, 0x06, 0x00, 0xC2, 0xFF, 0xE3, 0x00, 0xAE, 0xFD, 0x52, 0x05,
715 0x44, 0xF3, 0x2A, 0x3D, 0x06, 0x21, 0x47, 0xF3, 0xD8, 0x06, 0x3C,
716 0xFC, 0xE6, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x13, 0x00,
717 0xB0, 0xFF, 0xA2, 0x00, 0x1D, 0xFF, 0xD6, 0x00, 0xFC, 0xFF, 0xBC,
718 0xFC, 0xC0, 0x47, 0xFA, 0x0B, 0x70, 0xF9, 0x3C, 0x04, 0x5C, 0xFD,
719 0x75, 0x01, 0x5D, 0xFF, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B,
720 0x00, 0x57, 0xFF, 0x86, 0x01, 0x36, 0xFD, 0x89, 0x04, 0xCD, 0xF8,
721 0xB7, 0x0D, 0x3D, 0x47, 0x91, 0xFB, 0x91, 0x00, 0x83, 0x00, 0x4A,
722 0xFF, 0x8C, 0x00, 0xB9, 0xFF, 0x11, 0x00, 0xFD, 0xFF, 0x36, 0x00,
723 0x38, 0xFF, 0xE6, 0x01, 0x35, 0xFC, 0xF5, 0x06, 0xE7, 0xF2, 0xF2,
724 0x22, 0xC7, 0x3B, 0xD4, 0xF2, 0xA2, 0x05, 0x7A, 0xFD, 0x02, 0x01,
725 0xB2, 0xFF, 0x0B, 0x00, 0x01, 0x00, 0xFE, 0xFF, 0x1B, 0x00, 0x88,
726 0xFF, 0x55, 0x01, 0xF2, 0xFC, 0x67, 0x06, 0xE4, 0xF1, 0x44, 0x37,
727 0xAA, 0x28, 0x05, 0xF2, 0x27, 0x07, 0x36, 0xFC, 0xDA, 0x01, 0x41,
728 0xFF, 0x33, 0x00, 0xFD, 0xFF, 0x0B, 0x00, 0xD2, 0xFF, 0x4C, 0x00,
729 0xCD, 0xFF, 0x94, 0xFF, 0x34, 0x02, 0x70, 0xF8, 0x2E, 0x45, 0x20,
730 0x13, 0xF6, 0xF6, 0x62, 0x05, 0xD1, 0xFC, 0xB2, 0x01, 0x46, 0xFF,
731 0x31, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x23, 0x00, 0x73, 0xFF, 0x3D,
732 0x01, 0xD6, 0xFD, 0x46, 0x03, 0x61, 0xFB, 0x00, 0x07, 0xBF, 0x48,
733 0x98, 0x00, 0x26, 0xFE, 0xD5, 0x01, 0x95, 0xFE, 0xE3, 0x00, 0x96,
734 0xFF, 0x1A, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x38, 0xFF, 0xDB, 0x01,
735 0x66, 0xFC, 0x5E, 0x06, 0x9C, 0xF4, 0x40, 0x1B, 0xEF, 0x40, 0xF7,
736 0xF4, 0x35, 0x04, 0x62, 0xFE, 0x7A, 0x00, 0xF7, 0xFF, 0xF2, 0xFF,
737 0x05, 0x00, 0xFD, 0xFF, 0x2A, 0x00, 0x5D, 0xFF, 0xA7, 0x01, 0x75,
738 0xFC, 0x03, 0x07, 0x7D, 0xF1, 0x8A, 0x30, 0xFF, 0x2F, 0x7E, 0xF1,
739 0x0A, 0x07, 0x6E, 0xFC, 0xAC, 0x01, 0x5A, 0xFF, 0x2B, 0x00, 0xFD,
740 0xFF, 0x05, 0x00, 0xF0, 0xFF, 0xFC, 0xFF, 0x6E, 0x00, 0x76, 0xFE,
741 0x15, 0x04, 0x2C, 0xF5, 0x49, 0x41, 0xA9, 0x1A, 0xC3, 0xF4, 0x4F,
742 0x06, 0x6C, 0xFC, 0xD9, 0x01, 0x38, 0xFF, 0x35, 0x00, 0xFE, 0xFF,
743 0x1A, 0x00, 0x94, 0xFF, 0xEA, 0x00, 0x87, 0xFE, 0xF0, 0x01, 0xF5,
744 0xFD, 0x05, 0x01, 0xCE, 0x48, 0x83, 0x06, 0x94, 0xFB, 0x2C, 0x03,
745 0xE4, 0xFD, 0x37, 0x01, 0x76, 0xFF, 0x22, 0x00, 0x00, 0x00, 0xFF,
746 0xFF, 0x31, 0x00, 0x45, 0xFF, 0xB6, 0x01, 0xC8, 0xFC, 0x77, 0x05,
747 0xC7, 0xF6, 0xB1, 0x13, 0xED, 0x44, 0x26, 0xF8, 0x5D, 0x02, 0x7D,
748 0xFF, 0xDA, 0xFF, 0x46, 0x00, 0xD4, 0xFF, 0x0B, 0x00, 0xFD, 0xFF,
749 0x33, 0x00, 0x42, 0xFF, 0xD7, 0x01, 0x38, 0xFC, 0x29, 0x07, 0xF3,
750 0xF1, 0x3E, 0x29, 0xC6, 0x36, 0xD4, 0xF1, 0x77, 0x06, 0xE6, 0xFC,
751 0x5C, 0x01, 0x84, 0xFF, 0x1C, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x0A,
752 0x00, 0xB7, 0xFF, 0xF9, 0x00, 0x89, 0xFD, 0x8A, 0x05, 0xF4, 0xF2,
753 0x37, 0x3C, 0x5B, 0x22, 0x03, 0xF3, 0xED, 0x06, 0x37, 0xFC, 0xE6,
754 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x12, 0x00, 0xB6, 0xFF,
755 0x93, 0x00, 0x3C, 0xFF, 0x9D, 0x00, 0x63, 0x00, 0xEB, 0xFB, 0x69,
756 0x47, 0x2D, 0x0D, 0xFF, 0xF8, 0x72, 0x04, 0x42, 0xFD, 0x81, 0x01,
757 0x59, 0xFF, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x5B,
758 0xFF, 0x7A, 0x01, 0x50, 0xFD, 0x54, 0x04, 0x3D, 0xF9, 0x82, 0x0C,
759 0x9A, 0x47, 0x5E, 0xFC, 0x2A, 0x00, 0xBD, 0x00, 0x2B, 0xFF, 0x9B,
760 0x00, 0xB3, 0xFF, 0x12, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x37, 0xFF,
761 0xE6, 0x01, 0x3A, 0xFC, 0xE2, 0x06, 0x28, 0xF3, 0x9E, 0x21, 0xC0,
762 0x3C, 0x1F, 0xF3, 0x6C, 0x05, 0x9E, 0xFD, 0xED, 0x00, 0xBD, 0xFF,
763 0x07, 0x00, 0x01, 0x00, 0xFE, 0xFF, 0x1E, 0x00, 0x80, 0xFF, 0x66,
764 0x01, 0xD8, 0xFC, 0x8B, 0x06, 0xC1, 0xF1, 0x27, 0x36, 0xF6, 0x29,
765 0xDF, 0xF1, 0x2A, 0x07, 0x3B, 0xFC, 0xD4, 0x01, 0x44, 0xFF, 0x32,
766 0x00, 0xFD, 0xFF, 0x0A, 0x00, 0xD7, 0xFF, 0x3E, 0x00, 0xEA, 0xFF,
767 0x60, 0xFF, 0x8F, 0x02, 0xCD, 0xF7, 0x99, 0x44, 0x68, 0x14, 0x8E,
768 0xF6, 0x90, 0x05, 0xBC, 0xFC, 0xBA, 0x01, 0x43, 0xFF, 0x32, 0x00,
769 0xFF, 0xFF, 0x00, 0x00, 0x22, 0x00, 0x79, 0xFF, 0x2F, 0x01, 0xF4,
770 0xFD, 0x0C, 0x03, 0xD4, 0xFB, 0xE9, 0x05, 0xDE, 0x48, 0x8F, 0x01,
771 0xB6, 0xFD, 0x11, 0x02, 0x76, 0xFE, 0xF2, 0x00, 0x91, 0xFF, 0x1B,
772 0x00, 0xFE, 0xFF, 0x35, 0x00, 0x39, 0xFF, 0xD7, 0x01, 0x73, 0xFC,
773 0x3B, 0x06, 0xF5, 0xF4, 0xED, 0x19, 0xB7, 0x41, 0x71, 0xF5, 0xEB,
774 0x03, 0x90, 0xFE, 0x60, 0x00, 0x04, 0x00, 0xED, 0xFF, 0x06, 0x00,
775 0xFD, 0xFF, 0x2C, 0x00, 0x57, 0xFF, 0xB2, 0x01, 0x65, 0xFC, 0x12,
776 0x07, 0x82, 0xF1, 0x50, 0x2F, 0x38, 0x31, 0x7C, 0xF1, 0xF9, 0x06,
777 0x7E, 0xFC, 0xA1, 0x01, 0x61, 0xFF, 0x29, 0x00, 0xFD, 0xFF, 0x04,
778 0x00, 0xF5, 0xFF, 0xEF, 0xFF, 0x88, 0x00, 0x49, 0xFE, 0x5D, 0x04,
779 0xB7, 0xF4, 0x7D, 0x40, 0xFD, 0x1B, 0x6C, 0xF4, 0x70, 0x06, 0x5F,
780 0xFC, 0xDE, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x19, 0x00,
781 0x9A, 0xFF, 0xDB, 0x00, 0xA6, 0xFE, 0xB4, 0x01, 0x64, 0xFE, 0x12,
782 0x00, 0xAA, 0x48, 0x9E, 0x07, 0x21, 0xFB, 0x66, 0x03, 0xC6, 0xFD,
783 0x45, 0x01, 0x70, 0xFF, 0x24, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x30,
784 0x00, 0x48, 0xFF, 0xAD, 0x01, 0xDD, 0xFC, 0x48, 0x05, 0x30, 0xF7,
785 0x6B, 0x12, 0x7D, 0x45, 0xCF, 0xF8, 0x01, 0x02, 0xB2, 0xFF, 0xBD,
786 0xFF, 0x54, 0x00, 0xCE, 0xFF, 0x0C, 0x00, 0xFD, 0xFF, 0x34, 0x00,
787 0x3F, 0xFF, 0xDC, 0x01, 0x34, 0xFC, 0x24, 0x07, 0x1C, 0xF2, 0xF0,
788 0x27, 0xDF, 0x37, 0xFB, 0xF1, 0x51, 0x06, 0x01, 0xFD, 0x4B, 0x01,
789 0x8D, 0xFF, 0x19, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x0E, 0x00, 0xAC,
790 0xFF, 0x0E, 0x01, 0x66, 0xFD, 0xBF, 0x05, 0xAD, 0xF2, 0x3B, 0x3B,
791 0xB0, 0x23, 0xC4, 0xF2, 0xFF, 0x06, 0x33, 0xFC, 0xE5, 0x01, 0x38,
792 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x10, 0x00, 0xBC, 0xFF, 0x84, 0x00,
793 0x5B, 0xFF, 0x64, 0x00, 0xC9, 0x00, 0x22, 0xFB, 0x02, 0x47, 0x64,
794 0x0E, 0x8F, 0xF8, 0xA7, 0x04, 0x29, 0xFD, 0x8C, 0x01, 0x54, 0xFF,
795 0x2C, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x29, 0x00, 0x60, 0xFF, 0x6E,
796 0x01, 0x6B, 0xFD, 0x1D, 0x04, 0xAF, 0xF9, 0x51, 0x0B, 0xEC, 0x47,
797 0x33, 0xFD, 0xC1, 0xFF, 0xF7, 0x00, 0x0C, 0xFF, 0xAA, 0x00, 0xAD,
798 0xFF, 0x14, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01,
799 0x40, 0xFC, 0xCB, 0x06, 0x6E, 0xF3, 0x49, 0x20, 0xB0, 0x3D, 0x73,
800 0xF3, 0x31, 0x05, 0xC4, 0xFD, 0xD6, 0x00, 0xC8, 0xFF, 0x03, 0x00,
801 0x02, 0x00, 0xFE, 0xFF, 0x21, 0x00, 0x77, 0xFF, 0x75, 0x01, 0xBF,
802 0xFC, 0xAB, 0x06, 0xA6, 0xF1, 0x05, 0x35, 0x40, 0x2B, 0xBF, 0xF1,
803 0x2A, 0x07, 0x42, 0xFC, 0xCE, 0x01, 0x48, 0xFF, 0x31, 0x00, 0xFD,
804 0xFF, 0x09, 0x00, 0xDC, 0xFF, 0x2F, 0x00, 0x07, 0x00, 0x2C, 0xFF,
805 0xE6, 0x02, 0x31, 0xF7, 0xFA, 0x43, 0xB3, 0x15, 0x29, 0xF6, 0xBC,
806 0x05, 0xA9, 0xFC, 0xC2, 0x01, 0x40, 0xFF, 0x33, 0x00, 0xFF, 0xFF,
807 0x00, 0x00, 0x20, 0x00, 0x7E, 0xFF, 0x21, 0x01, 0x12, 0xFE, 0xD1,
808 0x02, 0x47, 0xFC, 0xD7, 0x04, 0xF0, 0x48, 0x8D, 0x02, 0x45, 0xFD,
809 0x4D, 0x02, 0x56, 0xFE, 0x01, 0x01, 0x8B, 0xFF, 0x1D, 0x00, 0xFE,
810 0xFF, 0x34, 0x00, 0x3B, 0xFF, 0xD1, 0x01, 0x83, 0xFC, 0x16, 0x06,
811 0x51, 0xF5, 0x9B, 0x18, 0x75, 0x42, 0xF3, 0xF5, 0x9D, 0x03, 0xBF,
812 0xFE, 0x45, 0x00, 0x11, 0x00, 0xE8, 0xFF, 0x07, 0x00, 0xFD, 0xFF,
813 0x2E, 0x00, 0x52, 0xFF, 0xBC, 0x01, 0x58, 0xFC, 0x1D, 0x07, 0x8E,
814 0xF1, 0x11, 0x2E, 0x6B, 0x32, 0x81, 0xF1, 0xE5, 0x06, 0x90, 0xFC,
815 0x94, 0x01, 0x67, 0xFF, 0x26, 0x00, 0xFD, 0xFF, 0x04, 0x00, 0xF9,
816 0xFF, 0xE3, 0xFF, 0xA1, 0x00, 0x1E, 0xFE, 0xA3, 0x04, 0x49, 0xF4,
817 0xA8, 0x3F, 0x52, 0x1D, 0x19, 0xF4, 0x90, 0x06, 0x53, 0xFC, 0xE1,
818 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x17, 0x00, 0xA0, 0xFF,
819 0xCC, 0x00, 0xC6, 0xFE, 0x79, 0x01, 0xD2, 0xFE, 0x26, 0xFF, 0x7C,
820 0x48, 0xBE, 0x08, 0xAE, 0xFA, 0xA0, 0x03, 0xA9, 0xFD, 0x52, 0x01,
821 0x6B, 0xFF, 0x25, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2F, 0x00, 0x4C,
822 0xFF, 0xA3, 0x01, 0xF3, 0xFC, 0x18, 0x05, 0x9B, 0xF7, 0x27, 0x11,
823 0x02, 0x46, 0x7F, 0xF9, 0xA3, 0x01, 0xE8, 0xFF, 0x9F, 0xFF, 0x63,
824 0x00, 0xC9, 0xFF, 0x0D, 0x00, 0xFD, 0xFF, 0x35, 0x00, 0x3C, 0xFF,
825 0xE0, 0x01, 0x32, 0xFC, 0x1C, 0x07, 0x4B, 0xF2, 0xA0, 0x26, 0xF2,
826 0x38, 0x2A, 0xF2, 0x28, 0x06, 0x1F, 0xFD, 0x39, 0x01, 0x96, 0xFF,
827 0x16, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x11, 0x00, 0xA2, 0xFF, 0x22,
828 0x01, 0x45, 0xFD, 0xF1, 0x05, 0x6D, 0xF2, 0x38, 0x3A, 0x03, 0x25,
829 0x8B, 0xF2, 0x0E, 0x07, 0x32, 0xFC, 0xE4, 0x01, 0x3A, 0xFF, 0x36,
830 0x00, 0xFD, 0xFF, 0x0F, 0x00, 0xC2, 0xFF, 0x75, 0x00, 0x7A, 0xFF,
831 0x2B, 0x00, 0x2D, 0x01, 0x61, 0xFA, 0x97, 0x46, 0xA0, 0x0F, 0x20,
832 0xF8, 0xDA, 0x04, 0x10, 0xFD, 0x97, 0x01, 0x50, 0xFF, 0x2E, 0x00,
833 0xFF, 0xFF, 0x00, 0x00, 0x27, 0x00, 0x65, 0xFF, 0x62, 0x01, 0x87,
834 0xFD, 0xE5, 0x03, 0x21, 0xFA, 0x25, 0x0A, 0x33, 0x48, 0x0F, 0xFE,
835 0x57, 0xFF, 0x31, 0x01, 0xEC, 0xFE, 0xB9, 0x00, 0xA7, 0xFF, 0x15,
836 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE4, 0x01, 0x48, 0xFC,
837 0xB2, 0x06, 0xB9, 0xF3, 0xF3, 0x1E, 0x98, 0x3E, 0xCF, 0xF3, 0xF3,
838 0x04, 0xEB, 0xFD, 0xBF, 0x00, 0xD4, 0xFF, 0xFF, 0xFF, 0x03, 0x00,
839 0xFE, 0xFF, 0x23, 0x00, 0x70, 0xFF, 0x84, 0x01, 0xA9, 0xFC, 0xC7,
840 0x06, 0x91, 0xF1, 0xDC, 0x33, 0x87, 0x2C, 0xA5, 0xF1, 0x26, 0x07,
841 0x4B, 0xFC, 0xC6, 0x01, 0x4C, 0xFF, 0x30, 0x00, 0xFD, 0xFF, 0x08,
842 0x00, 0xE2, 0xFF, 0x21, 0x00, 0x23, 0x00, 0xFA, 0xFE, 0x3A, 0x03,
843 0x9D, 0xF6, 0x50, 0x43, 0x00, 0x17, 0xC6, 0xF5, 0xE6, 0x05, 0x97,
844 0xFC, 0xC9, 0x01, 0x3E, 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0x00, 0x00,
845 0x1E, 0x00, 0x84, 0xFF, 0x13, 0x01, 0x31, 0xFE, 0x95, 0x02, 0xBA,
846 0xFC, 0xCB, 0x03, 0xF7, 0x48, 0x91, 0x03, 0xD3, 0xFC, 0x88, 0x02,
847 0x38, 0xFE, 0x10, 0x01, 0x85, 0xFF, 0x1E, 0x00, 0xFE, 0xFF, 0x34,
848 0x00, 0x3D, 0xFF, 0xCB, 0x01, 0x93, 0xFC, 0xEF, 0x05, 0xB0, 0xF5,
849 0x4B, 0x17, 0x2A, 0x43, 0x7D, 0xF6, 0x4D, 0x03, 0xEF, 0xFE, 0x2A,
850 0x00, 0x1E, 0x00, 0xE3, 0xFF, 0x08, 0x00, 0xFD, 0xFF, 0x2F, 0x00,
851 0x4D, 0xFF, 0xC4, 0x01, 0x4D, 0xFC, 0x25, 0x07, 0xA1, 0xF1, 0xCE,
852 0x2C, 0x99, 0x33, 0x8E, 0xF1, 0xCD, 0x06, 0xA4, 0xFC, 0x87, 0x01,
853 0x6E, 0xFF, 0x24, 0x00, 0xFD, 0xFF, 0x03, 0x00, 0xFE, 0xFF, 0xD7,
854 0xFF, 0xBA, 0x00, 0xF4, 0xFD, 0xE5, 0x04, 0xE4, 0xF3, 0xCA, 0x3E,
855 0xA7, 0x1E, 0xCA, 0xF3, 0xAC, 0x06, 0x4A, 0xFC, 0xE4, 0x01, 0x36,
856 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x16, 0x00, 0xA6, 0xFF, 0xBD, 0x00,
857 0xE5, 0xFE, 0x3E, 0x01, 0x3F, 0xFF, 0x41, 0xFE, 0x41, 0x48, 0xE4,
858 0x09, 0x3B, 0xFA, 0xD9, 0x03, 0x8D, 0xFD, 0x5F, 0x01, 0x66, 0xFF,
859 0x27, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2E, 0x00, 0x4F, 0xFF, 0x99,
860 0x01, 0x0B, 0xFD, 0xE6, 0x04, 0x08, 0xF8, 0xE7, 0x0F, 0x7C, 0x46,
861 0x37, 0xFA, 0x42, 0x01, 0x1F, 0x00, 0x81, 0xFF, 0x71, 0x00, 0xC3,
862 0xFF, 0x0F, 0x00, 0xFD, 0xFF, 0x35, 0x00, 0x3A, 0xFF, 0xE3, 0x01,
863 0x31, 0xFC, 0x11, 0x07, 0x7F, 0xF2, 0x4E, 0x25, 0xFD, 0x39, 0x60,
864 0xF2, 0xFB, 0x05, 0x3E, 0xFD, 0x26, 0x01, 0xA0, 0xFF, 0x12, 0x00,
865 0x00, 0x00, 0xFF, 0xFF, 0x15, 0x00, 0x98, 0xFF, 0x35, 0x01, 0x25,
866 0xFD, 0x1E, 0x06, 0x35, 0xF2, 0x2E, 0x39, 0x55, 0x26, 0x56, 0xF2,
867 0x1A, 0x07, 0x31, 0xFC, 0xE1, 0x01, 0x3C, 0xFF, 0x35, 0x00, 0xFD,
868 0xFF, 0x0E, 0x00, 0xC7, 0xFF, 0x66, 0x00, 0x98, 0xFF, 0xF4, 0xFF,
869 0x8E, 0x01, 0xA7, 0xF9, 0x1D, 0x46, 0xDF, 0x10, 0xB3, 0xF7, 0x0D,
870 0x05, 0xF8, 0xFC, 0xA1, 0x01, 0x4C, 0xFF, 0x2F, 0x00, 0xFF, 0xFF,
871 0x00, 0x00, 0x26, 0x00, 0x6A, 0xFF, 0x55, 0x01, 0xA3, 0xFD, 0xAD,
872 0x03, 0x94, 0xFA, 0xFF, 0x08, 0x70, 0x48, 0xF3, 0xFE, 0xEA, 0xFE,
873 0x6C, 0x01, 0xCD, 0xFE, 0xC9, 0x00, 0xA1, 0xFF, 0x17, 0x00, 0xFE,
874 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE2, 0x01, 0x51, 0xFC, 0x96, 0x06,
875 0x07, 0xF4, 0x9E, 0x1D, 0x77, 0x3F, 0x32, 0xF4, 0xB2, 0x04, 0x15,
876 0xFE, 0xA7, 0x00, 0xE0, 0xFF, 0xFA, 0xFF, 0x03, 0x00, 0xFD, 0xFF,
877 0x26, 0x00, 0x69, 0xFF, 0x91, 0x01, 0x94, 0xFC, 0xE0, 0x06, 0x84,
878 0xF1, 0xAF, 0x32, 0xCA, 0x2D, 0x92, 0xF1, 0x1F, 0x07, 0x56, 0xFC,
879 0xBE, 0x01, 0x51, 0xFF, 0x2E, 0x00, 0xFD, 0xFF, 0x07, 0x00, 0xE7,
880 0xFF, 0x14, 0x00, 0x3F, 0x00, 0xC9, 0xFE, 0x8C, 0x03, 0x11, 0xF6,
881 0x9E, 0x42, 0x50, 0x18, 0x66, 0xF5, 0x0D, 0x06, 0x86, 0xFC, 0xD0,
882 0x01, 0x3B, 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0x1D, 0x00, 0x8A, 0xFF,
883 0x04, 0x01, 0x50, 0xFE, 0x5A, 0x02, 0x2C, 0xFD, 0xC6, 0x02, 0xF2,
884 0x48, 0x9B, 0x04, 0x61, 0xFC, 0xC3, 0x02, 0x19, 0xFE, 0x1E, 0x01,
885 0x7F, 0xFF, 0x20, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x33, 0x00, 0x40,
886 0xFF, 0xC4, 0x01, 0xA5, 0xFC, 0xC5, 0x05, 0x13, 0xF6, 0xFD, 0x15,
887 0xD4, 0x43, 0x0F, 0xF7, 0xF9, 0x02, 0x21, 0xFF, 0x0D, 0x00, 0x2C,
888 0x00, 0xDE, 0xFF, 0x09, 0x00, 0xFD, 0xFF, 0x31, 0x00, 0x49, 0xFF,
889 0xCC, 0x01, 0x44, 0xFC, 0x29, 0x07, 0xB9, 0xF1, 0x89, 0x2B, 0xC3,
890 0x34, 0xA0, 0xF1, 0xB1, 0x06, 0xBA, 0xFC, 0x79, 0x01, 0x76, 0xFF,
891 0x21, 0x00, 0xFE, 0xFF, 0x02, 0x00, 0x02, 0x00, 0xCB, 0xFF, 0xD1,
892 0x00, 0xCC, 0xFD, 0x24, 0x05, 0x87, 0xF3, 0xE4, 0x3D, 0xFD, 0x1F,
893 0x7F, 0xF3, 0xC6, 0x06, 0x41, 0xFC, 0xE5, 0x01, 0x36, 0xFF, 0x36,
894 0x00, 0xFD, 0xFF, 0x14, 0x00, 0xAC, 0xFF, 0xAE, 0x00, 0x05, 0xFF,
895 0x03, 0x01, 0xAA, 0xFF, 0x63, 0xFD, 0xFD, 0x47, 0x0E, 0x0B, 0xC8,
896 0xF9, 0x11, 0x04, 0x71, 0xFD, 0x6C, 0x01, 0x61, 0xFF, 0x28, 0x00,
897 0x00, 0x00, 0xFF, 0xFF, 0x2D, 0x00, 0x53, 0xFF, 0x8F, 0x01, 0x23,
898 0xFD, 0xB2, 0x04, 0x76, 0xF8, 0xAA, 0x0E, 0xED, 0x46, 0xF7, 0xFA,
899 0xDF, 0x00, 0x57, 0x00, 0x62, 0xFF, 0x80, 0x00, 0xBD, 0xFF, 0x10,
900 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x39, 0xFF, 0xE5, 0x01, 0x33, 0xFC,
901 0x03, 0x07, 0xB7, 0xF2, 0xFC, 0x23, 0x03, 0x3B, 0x9E, 0xF2, 0xCB,
902 0x05, 0x5F, 0xFD, 0x12, 0x01, 0xAA, 0xFF, 0x0E, 0x00, 0x00, 0x00,
903 0xFF, 0xFF, 0x18, 0x00, 0x8F, 0xFF, 0x47, 0x01, 0x08, 0xFD, 0x49,
904 0x06, 0x05, 0xF2, 0x1D, 0x38, 0xA6, 0x27, 0x26, 0xF2, 0x23, 0x07,
905 0x33, 0xFC, 0xDD, 0x01, 0x3E, 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0x0C,
906 0x00, 0xCD, 0xFF, 0x57, 0x00, 0xB6, 0xFF, 0xBE, 0xFF, 0xED, 0x01,
907 0xF5, 0xF8, 0x9B, 0x45, 0x22, 0x12, 0x48, 0xF7, 0x3D, 0x05, 0xE2,
908 0xFC, 0xAB, 0x01, 0x49, 0xFF, 0x30, 0x00, 0xFF, 0xFF, 0x00, 0x00,
909 0x24, 0x00, 0x6F, 0xFF, 0x48, 0x01, 0xC0, 0xFD, 0x73, 0x03, 0x07,
910 0xFB, 0xDD, 0x07, 0xA1, 0x48, 0xDD, 0xFF, 0x7D, 0xFE, 0xA7, 0x01,
911 0xAD, 0xFE, 0xD8, 0x00, 0x9B, 0xFF, 0x18, 0x00, 0xFE, 0xFF, 0x36,
912 0x00, 0x37, 0xFF, 0xDF, 0x01, 0x5C, 0xFC, 0x78, 0x06, 0x5A, 0xF4,
913 0x49, 0x1C, 0x4E, 0x40, 0x9E, 0xF4, 0x6D, 0x04, 0x3F, 0xFE, 0x8E,
914 0x00, 0xED, 0xFF, 0xF6, 0xFF, 0x04, 0x00, 0xFD, 0xFF, 0x28, 0x00,
915 0x62, 0xFF, 0x9E, 0x01, 0x82, 0xFC, 0xF5, 0x06, 0x7D, 0xF1, 0x7B,
916 0x31, 0x09, 0x2F, 0x84, 0xF1, 0x15, 0x07, 0x62, 0xFC, 0xB4, 0x01,
917 0x56, 0xFF, 0x2C, 0x00, 0xFD, 0xFF, 0x06, 0x00, 0xEC, 0xFF, 0x06,
918 0x00, 0x5A, 0x00, 0x9A, 0xFE, 0xDA, 0x03, 0x8D, 0xF5, 0xE1, 0x41,
919 0xA1, 0x19, 0x09, 0xF5, 0x33, 0x06, 0x77, 0xFC, 0xD6, 0x01, 0x3A,
920 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x1B, 0x00, 0x8F, 0xFF, 0xF5, 0x00,
921 0x6F, 0xFE, 0x1E, 0x02, 0x9D, 0xFD, 0xC7, 0x01, 0xE1, 0x48, 0xAB,
922 0x05, 0xEE, 0xFB, 0xFE, 0x02, 0xFB, 0xFD, 0x2C, 0x01, 0x7A, 0xFF,
923 0x21, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x32, 0x00, 0x42, 0xFF, 0xBC,
924 0x01, 0xB8, 0xFC, 0x9A, 0x05, 0x77, 0xF6, 0xB1, 0x14, 0x77, 0x44,
925 0xA9, 0xF7, 0xA2, 0x02, 0x54, 0xFF, 0xF1, 0xFF, 0x3A, 0x00, 0xD8,
926 0xFF, 0x0A, 0x00, 0xFD, 0xFF, 0x32, 0x00, 0x45, 0xFF, 0xD3, 0x01,
927 0x3C, 0xFC, 0x2A, 0x07, 0xD8, 0xF1, 0x3F, 0x2A, 0xE6, 0x35, 0xBB,
928 0xF1, 0x92, 0x06, 0xD2, 0xFC, 0x69, 0x01, 0x7E, 0xFF, 0x1F, 0x00,
929 0xFE, 0xFF, 0x01, 0x00, 0x07, 0x00, 0xC0, 0xFF, 0xE8, 0x00, 0xA6,
930 0xFD, 0x5F, 0x05, 0x31, 0xF3, 0xF6, 0x3C, 0x52, 0x21, 0x37, 0xF3,
931 0xDD, 0x06, 0x3B, 0xFC, 0xE6, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD,
932 0xFF, 0x13, 0x00, 0xB1, 0xFF, 0x9F, 0x00, 0x24, 0xFF, 0xC9, 0x00,
933 0x13, 0x00, 0x8D, 0xFC, 0xAE, 0x47, 0x3E, 0x0C, 0x56, 0xF9, 0x48,
934 0x04, 0x56, 0xFD, 0x78, 0x01, 0x5C, 0xFF, 0x2A, 0x00, 0x00, 0x00,
935 0x00, 0x00, 0x2B, 0x00, 0x58, 0xFF, 0x83, 0x01, 0x3C, 0xFD, 0x7E,
936 0x04, 0xE6, 0xF8, 0x72, 0x0D, 0x52, 0x47, 0xBE, 0xFB, 0x7A, 0x00,
937 0x90, 0x00, 0x43, 0xFF, 0x8F, 0x00, 0xB7, 0xFF, 0x11, 0x00, 0xFD,
938 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x36, 0xFC, 0xF1, 0x06,
939 0xF5, 0xF2, 0xA7, 0x22, 0xFF, 0x3B, 0xE4, 0xF2, 0x96, 0x05, 0x81,
940 0xFD, 0xFD, 0x00, 0xB5, 0xFF, 0x0B, 0x00, 0x01, 0x00, 0xFE, 0xFF,
941 0x1C, 0x00, 0x86, 0xFF, 0x59, 0x01, 0xEC, 0xFC, 0x6F, 0x06, 0xDC,
942 0xF1, 0x04, 0x37, 0xF3, 0x28, 0xFC, 0xF1, 0x28, 0x07, 0x37, 0xFC,
943 0xD8, 0x01, 0x41, 0xFF, 0x33, 0x00, 0xFD, 0xFF, 0x0B, 0x00, 0xD3,
944 0xFF, 0x49, 0x00, 0xD4, 0xFF, 0x88, 0xFF, 0x49, 0x02, 0x4B, 0xF8,
945 0x0D, 0x45, 0x68, 0x13, 0xDF, 0xF6, 0x6C, 0x05, 0xCC, 0xFC, 0xB4,
946 0x01, 0x45, 0xFF, 0x31, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x23, 0x00,
947 0x74, 0xFF, 0x3A, 0x01, 0xDD, 0xFD, 0x39, 0x03, 0x7B, 0xFB, 0xC1,
948 0x06, 0xC7, 0x48, 0xCF, 0x00, 0x0D, 0xFE, 0xE3, 0x01, 0x8E, 0xFE,
949 0xE7, 0x00, 0x95, 0xFF, 0x1A, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x38,
950 0xFF, 0xDA, 0x01, 0x69, 0xFC, 0x57, 0x06, 0xAF, 0xF4, 0xF5, 0x1A,
951 0x1D, 0x41, 0x11, 0xF5, 0x25, 0x04, 0x6C, 0xFE, 0x74, 0x00, 0xF9,
952 0xFF, 0xF1, 0xFF, 0x05, 0x00, 0xFD, 0xFF, 0x2A, 0x00, 0x5C, 0xFF,
953 0xAA, 0x01, 0x71, 0xFC, 0x07, 0x07, 0x7E, 0xF1, 0x44, 0x30, 0x44,
954 0x30, 0x7E, 0xF1, 0x07, 0x07, 0x71, 0xFC, 0xAA, 0x01, 0x5C, 0xFF,
955 0x2A, 0x00, 0xFD, 0xFF, 0x05, 0x00, 0xF1, 0xFF, 0xF9, 0xFF, 0x74,
956 0x00, 0x6C, 0xFE, 0x25, 0x04, 0x11, 0xF5, 0x1D, 0x41, 0xF5, 0x1A,
957 0xAF, 0xF4, 0x57, 0x06, 0x69, 0xFC, 0xDA, 0x01, 0x38, 0xFF, 0x36,
958 0x00, 0xFE, 0xFF, 0x1A, 0x00, 0x95, 0xFF, 0xE7, 0x00, 0x8E, 0xFE,
959 0xE3, 0x01, 0x0D, 0xFE, 0xCF, 0x00, 0xC7, 0x48, 0xC1, 0x06, 0x7B,
960 0xFB, 0x39, 0x03, 0xDD, 0xFD, 0x3A, 0x01, 0x74, 0xFF, 0x23, 0x00,
961 0x00, 0x00, 0xFF, 0xFF, 0x31, 0x00, 0x45, 0xFF, 0xB4, 0x01, 0xCC,
962 0xFC, 0x6C, 0x05, 0xDF, 0xF6, 0x68, 0x13, 0x0D, 0x45, 0x4B, 0xF8,
963 0x49, 0x02, 0x88, 0xFF, 0xD4, 0xFF, 0x49, 0x00, 0xD3, 0xFF, 0x0B,
964 0x00, 0xFD, 0xFF, 0x33, 0x00, 0x41, 0xFF, 0xD8, 0x01, 0x37, 0xFC,
965 0x28, 0x07, 0xFC, 0xF1, 0xF3, 0x28, 0x04, 0x37, 0xDC, 0xF1, 0x6F,
966 0x06, 0xEC, 0xFC, 0x59, 0x01, 0x86, 0xFF, 0x1C, 0x00, 0xFE, 0xFF,
967 0x01, 0x00, 0x0B, 0x00, 0xB5, 0xFF, 0xFD, 0x00, 0x81, 0xFD, 0x96,
968 0x05, 0xE4, 0xF2, 0xFF, 0x3B, 0xA7, 0x22, 0xF5, 0xF2, 0xF1, 0x06,
969 0x36, 0xFC, 0xE6, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x11,
970 0x00, 0xB7, 0xFF, 0x8F, 0x00, 0x43, 0xFF, 0x90, 0x00, 0x7A, 0x00,
971 0xBE, 0xFB, 0x52, 0x47, 0x72, 0x0D, 0xE6, 0xF8, 0x7E, 0x04, 0x3C,
972 0xFD, 0x83, 0x01, 0x58, 0xFF, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00,
973 0x2A, 0x00, 0x5C, 0xFF, 0x78, 0x01, 0x56, 0xFD, 0x48, 0x04, 0x56,
974 0xF9, 0x3E, 0x0C, 0xAE, 0x47, 0x8D, 0xFC, 0x13, 0x00, 0xC9, 0x00,
975 0x24, 0xFF, 0x9F, 0x00, 0xB1, 0xFF, 0x13, 0x00, 0xFD, 0xFF, 0x36,
976 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3B, 0xFC, 0xDD, 0x06, 0x37, 0xF3,
977 0x52, 0x21, 0xF6, 0x3C, 0x31, 0xF3, 0x5F, 0x05, 0xA6, 0xFD, 0xE8,
978 0x00, 0xC0, 0xFF, 0x07, 0x00, 0x01, 0x00, 0xFE, 0xFF, 0x1F, 0x00,
979 0x7E, 0xFF, 0x69, 0x01, 0xD2, 0xFC, 0x92, 0x06, 0xBB, 0xF1, 0xE6,
980 0x35, 0x3F, 0x2A, 0xD8, 0xF1, 0x2A, 0x07, 0x3C, 0xFC, 0xD3, 0x01,
981 0x45, 0xFF, 0x32, 0x00, 0xFD, 0xFF, 0x0A, 0x00, 0xD8, 0xFF, 0x3A,
982 0x00, 0xF1, 0xFF, 0x54, 0xFF, 0xA2, 0x02, 0xA9, 0xF7, 0x77, 0x44,
983 0xB1, 0x14, 0x77, 0xF6, 0x9A, 0x05, 0xB8, 0xFC, 0xBC, 0x01, 0x42,
984 0xFF, 0x32, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x21, 0x00, 0x7A, 0xFF,
985 0x2C, 0x01, 0xFB, 0xFD, 0xFE, 0x02, 0xEE, 0xFB, 0xAB, 0x05, 0xE1,
986 0x48, 0xC7, 0x01, 0x9D, 0xFD, 0x1E, 0x02, 0x6F, 0xFE, 0xF5, 0x00,
987 0x8F, 0xFF, 0x1B, 0x00, 0xFE, 0xFF, 0x35, 0x00, 0x3A, 0xFF, 0xD6,
988 0x01, 0x77, 0xFC, 0x33, 0x06, 0x09, 0xF5, 0xA1, 0x19, 0xE1, 0x41,
989 0x8D, 0xF5, 0xDA, 0x03, 0x9A, 0xFE, 0x5A, 0x00, 0x06, 0x00, 0xEC,
990 0xFF, 0x06, 0x00, 0xFD, 0xFF, 0x2C, 0x00, 0x56, 0xFF, 0xB4, 0x01,
991 0x62, 0xFC, 0x15, 0x07, 0x84, 0xF1, 0x09, 0x2F, 0x7B, 0x31, 0x7D,
992 0xF1, 0xF5, 0x06, 0x82, 0xFC, 0x9E, 0x01, 0x62, 0xFF, 0x28, 0x00,
993 0xFD, 0xFF, 0x04, 0x00, 0xF6, 0xFF, 0xED, 0xFF, 0x8E, 0x00, 0x3F,
994 0xFE, 0x6D, 0x04, 0x9E, 0xF4, 0x4E, 0x40, 0x49, 0x1C, 0x5A, 0xF4,
995 0x78, 0x06, 0x5C, 0xFC, 0xDF, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFE,
996 0xFF, 0x18, 0x00, 0x9B, 0xFF, 0xD8, 0x00, 0xAD, 0xFE, 0xA7, 0x01,
997 0x7D, 0xFE, 0xDD, 0xFF, 0xA1, 0x48, 0xDD, 0x07, 0x07, 0xFB, 0x73,
998 0x03, 0xC0, 0xFD, 0x48, 0x01, 0x6F, 0xFF, 0x24, 0x00, 0x00, 0x00,
999 0xFF, 0xFF, 0x30, 0x00, 0x49, 0xFF, 0xAB, 0x01, 0xE2, 0xFC, 0x3D,
1000 0x05, 0x48, 0xF7, 0x22, 0x12, 0x9B, 0x45, 0xF5, 0xF8, 0xED, 0x01,
1001 0xBE, 0xFF, 0xB6, 0xFF, 0x57, 0x00, 0xCD, 0xFF, 0x0C, 0x00, 0xFD,
1002 0xFF, 0x34, 0x00, 0x3E, 0xFF, 0xDD, 0x01, 0x33, 0xFC, 0x23, 0x07,
1003 0x26, 0xF2, 0xA6, 0x27, 0x1D, 0x38, 0x05, 0xF2, 0x49, 0x06, 0x08,
1004 0xFD, 0x47, 0x01, 0x8F, 0xFF, 0x18, 0x00, 0xFF, 0xFF, 0x00, 0x00,
1005 0x0E, 0x00, 0xAA, 0xFF, 0x12, 0x01, 0x5F, 0xFD, 0xCB, 0x05, 0x9E,
1006 0xF2, 0x03, 0x3B, 0xFC, 0x23, 0xB7, 0xF2, 0x03, 0x07, 0x33, 0xFC,
1007 0xE5, 0x01, 0x39, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x10, 0x00, 0xBD,
1008 0xFF, 0x80, 0x00, 0x62, 0xFF, 0x57, 0x00, 0xDF, 0x00, 0xF7, 0xFA,
1009 0xED, 0x46, 0xAA, 0x0E, 0x76, 0xF8, 0xB2, 0x04, 0x23, 0xFD, 0x8F,
1010 0x01, 0x53, 0xFF, 0x2D, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x28, 0x00,
1011 0x61, 0xFF, 0x6C, 0x01, 0x71, 0xFD, 0x11, 0x04, 0xC8, 0xF9, 0x0E,
1012 0x0B, 0xFD, 0x47, 0x63, 0xFD, 0xAA, 0xFF, 0x03, 0x01, 0x05, 0xFF,
1013 0xAE, 0x00, 0xAC, 0xFF, 0x14, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36,
1014 0xFF, 0xE5, 0x01, 0x41, 0xFC, 0xC6, 0x06, 0x7F, 0xF3, 0xFD, 0x1F,
1015 0xE4, 0x3D, 0x87, 0xF3, 0x24, 0x05, 0xCC, 0xFD, 0xD1, 0x00, 0xCB,
1016 0xFF, 0x02, 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x21, 0x00, 0x76, 0xFF,
1017 0x79, 0x01, 0xBA, 0xFC, 0xB1, 0x06, 0xA0, 0xF1, 0xC3, 0x34, 0x89,
1018 0x2B, 0xB9, 0xF1, 0x29, 0x07, 0x44, 0xFC, 0xCC, 0x01, 0x49, 0xFF,
1019 0x31, 0x00, 0xFD, 0xFF, 0x09, 0x00, 0xDE, 0xFF, 0x2C, 0x00, 0x0D,
1020 0x00, 0x21, 0xFF, 0xF9, 0x02, 0x0F, 0xF7, 0xD4, 0x43, 0xFD, 0x15,
1021 0x13, 0xF6, 0xC5, 0x05, 0xA5, 0xFC, 0xC4, 0x01, 0x40, 0xFF, 0x33,
1022 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x20, 0x00, 0x7F, 0xFF, 0x1E, 0x01,
1023 0x19, 0xFE, 0xC3, 0x02, 0x61, 0xFC, 0x9B, 0x04, 0xF2, 0x48, 0xC6,
1024 0x02, 0x2C, 0xFD, 0x5A, 0x02, 0x50, 0xFE, 0x04, 0x01, 0x8A, 0xFF,
1025 0x1D, 0x00, 0xFE, 0xFF, 0x34, 0x00, 0x3B, 0xFF, 0xD0, 0x01, 0x86,
1026 0xFC, 0x0D, 0x06, 0x66, 0xF5, 0x50, 0x18, 0x9E, 0x42, 0x11, 0xF6,
1027 0x8C, 0x03, 0xC9, 0xFE, 0x3F, 0x00, 0x14, 0x00, 0xE7, 0xFF, 0x07,
1028 0x00, 0xFD, 0xFF, 0x2E, 0x00, 0x51, 0xFF, 0xBE, 0x01, 0x56, 0xFC,
1029 0x1F, 0x07, 0x92, 0xF1, 0xCA, 0x2D, 0xAF, 0x32, 0x84, 0xF1, 0xE0,
1030 0x06, 0x94, 0xFC, 0x91, 0x01, 0x69, 0xFF, 0x26, 0x00, 0xFD, 0xFF,
1031 0x03, 0x00, 0xFA, 0xFF, 0xE0, 0xFF, 0xA7, 0x00, 0x15, 0xFE, 0xB2,
1032 0x04, 0x32, 0xF4, 0x77, 0x3F, 0x9E, 0x1D, 0x07, 0xF4, 0x96, 0x06,
1033 0x51, 0xFC, 0xE2, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x17,
1034 0x00, 0xA1, 0xFF, 0xC9, 0x00, 0xCD, 0xFE, 0x6C, 0x01, 0xEA, 0xFE,
1035 0xF3, 0xFE, 0x70, 0x48, 0xFF, 0x08, 0x94, 0xFA, 0xAD, 0x03, 0xA3,
1036 0xFD, 0x55, 0x01, 0x6A, 0xFF, 0x26, 0x00, 0x00, 0x00, 0xFF, 0xFF,
1037 0x2F, 0x00, 0x4C, 0xFF, 0xA1, 0x01, 0xF8, 0xFC, 0x0D, 0x05, 0xB3,
1038 0xF7, 0xDF, 0x10, 0x1D, 0x46, 0xA7, 0xF9, 0x8E, 0x01, 0xF4, 0xFF,
1039 0x98, 0xFF, 0x66, 0x00, 0xC7, 0xFF, 0x0E, 0x00, 0xFD, 0xFF, 0x35,
1040 0x00, 0x3C, 0xFF, 0xE1, 0x01, 0x31, 0xFC, 0x1A, 0x07, 0x56, 0xF2,
1041 0x55, 0x26, 0x2E, 0x39, 0x35, 0xF2, 0x1E, 0x06, 0x25, 0xFD, 0x35,
1042 0x01, 0x98, 0xFF, 0x15, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x12, 0x00,
1043 0xA0, 0xFF, 0x26, 0x01, 0x3E, 0xFD, 0xFB, 0x05, 0x60, 0xF2, 0xFD,
1044 0x39, 0x4E, 0x25, 0x7F, 0xF2, 0x11, 0x07, 0x31, 0xFC, 0xE3, 0x01,
1045 0x3A, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x0F, 0x00, 0xC3, 0xFF, 0x71,
1046 0x00, 0x81, 0xFF, 0x1F, 0x00, 0x42, 0x01, 0x37, 0xFA, 0x7C, 0x46,
1047 0xE7, 0x0F, 0x08, 0xF8, 0xE6, 0x04, 0x0B, 0xFD, 0x99, 0x01, 0x4F,
1048 0xFF, 0x2E, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x27, 0x00, 0x66, 0xFF,
1049 0x5F, 0x01, 0x8D, 0xFD, 0xD9, 0x03, 0x3B, 0xFA, 0xE4, 0x09, 0x41,
1050 0x48, 0x41, 0xFE, 0x3F, 0xFF, 0x3E, 0x01, 0xE5, 0xFE, 0xBD, 0x00,
1051 0xA6, 0xFF, 0x16, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE4,
1052 0x01, 0x4A, 0xFC, 0xAC, 0x06, 0xCA, 0xF3, 0xA7, 0x1E, 0xCA, 0x3E,
1053 0xE4, 0xF3, 0xE5, 0x04, 0xF4, 0xFD, 0xBA, 0x00, 0xD7, 0xFF, 0xFE,
1054 0xFF, 0x03, 0x00, 0xFD, 0xFF, 0x24, 0x00, 0x6E, 0xFF, 0x87, 0x01,
1055 0xA4, 0xFC, 0xCD, 0x06, 0x8E, 0xF1, 0x99, 0x33, 0xCE, 0x2C, 0xA1,
1056 0xF1, 0x25, 0x07, 0x4D, 0xFC, 0xC4, 0x01, 0x4D, 0xFF, 0x2F, 0x00,
1057 0xFD, 0xFF, 0x08, 0x00, 0xE3, 0xFF, 0x1E, 0x00, 0x2A, 0x00, 0xEF,
1058 0xFE, 0x4D, 0x03, 0x7D, 0xF6, 0x2A, 0x43, 0x4B, 0x17, 0xB0, 0xF5,
1059 0xEF, 0x05, 0x93, 0xFC, 0xCB, 0x01, 0x3D, 0xFF, 0x34, 0x00, 0xFE,
1060 0xFF, 0x1E, 0x00, 0x85, 0xFF, 0x10, 0x01, 0x38, 0xFE, 0x88, 0x02,
1061 0xD3, 0xFC, 0x91, 0x03, 0xF7, 0x48, 0xCB, 0x03, 0xBA, 0xFC, 0x95,
1062 0x02, 0x31, 0xFE, 0x13, 0x01, 0x84, 0xFF, 0x1E, 0x00, 0x00, 0x00,
1063 0xFE, 0xFF, 0x34, 0x00, 0x3E, 0xFF, 0xC9, 0x01, 0x97, 0xFC, 0xE6,
1064 0x05, 0xC6, 0xF5, 0x00, 0x17, 0x50, 0x43, 0x9D, 0xF6, 0x3A, 0x03,
1065 0xFA, 0xFE, 0x23, 0x00, 0x21, 0x00, 0xE2, 0xFF, 0x08, 0x00, 0xFD,
1066 0xFF, 0x30, 0x00, 0x4C, 0xFF, 0xC6, 0x01, 0x4B, 0xFC, 0x26, 0x07,
1067 0xA5, 0xF1, 0x87, 0x2C, 0xDC, 0x33, 0x91, 0xF1, 0xC7, 0x06, 0xA9,
1068 0xFC, 0x84, 0x01, 0x70, 0xFF, 0x23, 0x00, 0xFE, 0xFF, 0x03, 0x00,
1069 0xFF, 0xFF, 0xD4, 0xFF, 0xBF, 0x00, 0xEB, 0xFD, 0xF3, 0x04, 0xCF,
1070 0xF3, 0x98, 0x3E, 0xF3, 0x1E, 0xB9, 0xF3, 0xB2, 0x06, 0x48, 0xFC,
1071 0xE4, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x15, 0x00, 0xA7,
1072 0xFF, 0xB9, 0x00, 0xEC, 0xFE, 0x31, 0x01, 0x57, 0xFF, 0x0F, 0xFE,
1073 0x33, 0x48, 0x25, 0x0A, 0x21, 0xFA, 0xE5, 0x03, 0x87, 0xFD, 0x62,
1074 0x01, 0x65, 0xFF, 0x27, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2E, 0x00,
1075 0x50, 0xFF, 0x97, 0x01, 0x10, 0xFD, 0xDA, 0x04, 0x20, 0xF8, 0xA0,
1076 0x0F, 0x97, 0x46, 0x61, 0xFA, 0x2D, 0x01, 0x2B, 0x00, 0x7A, 0xFF,
1077 0x75, 0x00, 0xC2, 0xFF, 0x0F, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x3A,
1078 0xFF, 0xE4, 0x01, 0x32, 0xFC, 0x0E, 0x07, 0x8B, 0xF2, 0x03, 0x25,
1079 0x38, 0x3A, 0x6D, 0xF2, 0xF1, 0x05, 0x45, 0xFD, 0x22, 0x01, 0xA2,
1080 0xFF, 0x11, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x16, 0x00, 0x96, 0xFF,
1081 0x39, 0x01, 0x1F, 0xFD, 0x28, 0x06, 0x2A, 0xF2, 0xF2, 0x38, 0xA0,
1082 0x26, 0x4B, 0xF2, 0x1C, 0x07, 0x32, 0xFC, 0xE0, 0x01, 0x3C, 0xFF,
1083 0x35, 0x00, 0xFD, 0xFF, 0x0D, 0x00, 0xC9, 0xFF, 0x63, 0x00, 0x9F,
1084 0xFF, 0xE8, 0xFF, 0xA3, 0x01, 0x7F, 0xF9, 0x02, 0x46, 0x27, 0x11,
1085 0x9B, 0xF7, 0x18, 0x05, 0xF3, 0xFC, 0xA3, 0x01, 0x4C, 0xFF, 0x2F,
1086 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x25, 0x00, 0x6B, 0xFF, 0x52, 0x01,
1087 0xA9, 0xFD, 0xA0, 0x03, 0xAE, 0xFA, 0xBE, 0x08, 0x7C, 0x48, 0x26,
1088 0xFF, 0xD2, 0xFE, 0x79, 0x01, 0xC6, 0xFE, 0xCC, 0x00, 0xA0, 0xFF,
1089 0x17, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE1, 0x01, 0x53,
1090 0xFC, 0x90, 0x06, 0x19, 0xF4, 0x52, 0x1D, 0xA8, 0x3F, 0x49, 0xF4,
1091 0xA3, 0x04, 0x1E, 0xFE, 0xA1, 0x00, 0xE3, 0xFF, 0xF9, 0xFF, 0x04,
1092 0x00, 0xFD, 0xFF, 0x26, 0x00, 0x67, 0xFF, 0x94, 0x01, 0x90, 0xFC,
1093 0xE5, 0x06, 0x81, 0xF1, 0x6B, 0x32, 0x11, 0x2E, 0x8E, 0xF1, 0x1D,
1094 0x07, 0x58, 0xFC, 0xBC, 0x01, 0x52, 0xFF, 0x2E, 0x00, 0xFD, 0xFF,
1095 0x07, 0x00, 0xE8, 0xFF, 0x11, 0x00, 0x45, 0x00, 0xBF, 0xFE, 0x9D,
1096 0x03, 0xF3, 0xF5, 0x75, 0x42, 0x9B, 0x18, 0x51, 0xF5, 0x16, 0x06,
1097 0x83, 0xFC, 0xD1, 0x01, 0x3B, 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0x1D,
1098 0x00, 0x8B, 0xFF, 0x01, 0x01, 0x56, 0xFE, 0x4D, 0x02, 0x45, 0xFD,
1099 0x8D, 0x02, 0xF0, 0x48, 0xD7, 0x04, 0x47, 0xFC, 0xD1, 0x02, 0x12,
1100 0xFE, 0x21, 0x01, 0x7E, 0xFF, 0x20, 0x00, 0x00, 0x00, 0xFF, 0xFF,
1101 0x33, 0x00, 0x40, 0xFF, 0xC2, 0x01, 0xA9, 0xFC, 0xBC, 0x05, 0x29,
1102 0xF6, 0xB3, 0x15, 0xFA, 0x43, 0x31, 0xF7, 0xE6, 0x02, 0x2C, 0xFF,
1103 0x07, 0x00, 0x2F, 0x00, 0xDC, 0xFF, 0x09, 0x00, 0xFD, 0xFF, 0x31,
1104 0x00, 0x48, 0xFF, 0xCE, 0x01, 0x42, 0xFC, 0x2A, 0x07, 0xBF, 0xF1,
1105 0x40, 0x2B, 0x05, 0x35, 0xA6, 0xF1, 0xAB, 0x06, 0xBF, 0xFC, 0x75,
1106 0x01, 0x77, 0xFF, 0x21, 0x00, 0xFE, 0xFF, 0x02, 0x00, 0x03, 0x00,
1107 0xC8, 0xFF, 0xD6, 0x00, 0xC4, 0xFD, 0x31, 0x05, 0x73, 0xF3, 0xB0,
1108 0x3D, 0x49, 0x20, 0x6E, 0xF3, 0xCB, 0x06, 0x40, 0xFC, 0xE6, 0x01,
1109 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x14, 0x00, 0xAD, 0xFF, 0xAA,
1110 0x00, 0x0C, 0xFF, 0xF7, 0x00, 0xC1, 0xFF, 0x33, 0xFD, 0xEC, 0x47,
1111 0x51, 0x0B, 0xAF, 0xF9, 0x1D, 0x04, 0x6B, 0xFD, 0x6E, 0x01, 0x60,
1112 0xFF, 0x29, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2C, 0x00, 0x54, 0xFF,
1113 0x8C, 0x01, 0x29, 0xFD, 0xA7, 0x04, 0x8F, 0xF8, 0x64, 0x0E, 0x02,
1114 0x47, 0x22, 0xFB, 0xC9, 0x00, 0x64, 0x00, 0x5B, 0xFF, 0x84, 0x00,
1115 0xBC, 0xFF, 0x10, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x38, 0xFF, 0xE5,
1116 0x01, 0x33, 0xFC, 0xFF, 0x06, 0xC4, 0xF2, 0xB0, 0x23, 0x3B, 0x3B,
1117 0xAD, 0xF2, 0xBF, 0x05, 0x66, 0xFD, 0x0E, 0x01, 0xAC, 0xFF, 0x0E,
1118 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x19, 0x00, 0x8D, 0xFF, 0x4B, 0x01,
1119 0x01, 0xFD, 0x51, 0x06, 0xFB, 0xF1, 0xDF, 0x37, 0xF0, 0x27, 0x1C,
1120 0xF2, 0x24, 0x07, 0x34, 0xFC, 0xDC, 0x01, 0x3F, 0xFF, 0x34, 0x00,
1121 0xFD, 0xFF, 0x0C, 0x00, 0xCE, 0xFF, 0x54, 0x00, 0xBD, 0xFF, 0xB2,
1122 0xFF, 0x01, 0x02, 0xCF, 0xF8, 0x7D, 0x45, 0x6B, 0x12, 0x30, 0xF7,
1123 0x48, 0x05, 0xDD, 0xFC, 0xAD, 0x01, 0x48, 0xFF, 0x30, 0x00, 0xFF,
1124 0xFF, 0x00, 0x00, 0x24, 0x00, 0x70, 0xFF, 0x45, 0x01, 0xC6, 0xFD,
1125 0x66, 0x03, 0x21, 0xFB, 0x9E, 0x07, 0xAA, 0x48, 0x12, 0x00, 0x64,
1126 0xFE, 0xB4, 0x01, 0xA6, 0xFE, 0xDB, 0x00, 0x9A, 0xFF, 0x19, 0x00,
1127 0xFE, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xDE, 0x01, 0x5F, 0xFC, 0x70,
1128 0x06, 0x6C, 0xF4, 0xFD, 0x1B, 0x7D, 0x40, 0xB7, 0xF4, 0x5D, 0x04,
1129 0x49, 0xFE, 0x88, 0x00, 0xEF, 0xFF, 0xF5, 0xFF, 0x04, 0x00, 0xFD,
1130 0xFF, 0x29, 0x00, 0x61, 0xFF, 0xA1, 0x01, 0x7E, 0xFC, 0xF9, 0x06,
1131 0x7C, 0xF1, 0x38, 0x31, 0x50, 0x2F, 0x82, 0xF1, 0x12, 0x07, 0x65,
1132 0xFC, 0xB2, 0x01, 0x57, 0xFF, 0x2C, 0x00, 0xFD, 0xFF, 0x06, 0x00,
1133 0xED, 0xFF, 0x04, 0x00, 0x60, 0x00, 0x90, 0xFE, 0xEB, 0x03, 0x71,
1134 0xF5, 0xB7, 0x41, 0xED, 0x19, 0xF5, 0xF4, 0x3B, 0x06, 0x73, 0xFC,
1135 0xD7, 0x01, 0x39, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x1B, 0x00, 0x91,
1136 0xFF, 0xF2, 0x00, 0x76, 0xFE, 0x11, 0x02, 0xB6, 0xFD, 0x8F, 0x01,
1137 0xDE, 0x48, 0xE9, 0x05, 0xD4, 0xFB, 0x0C, 0x03, 0xF4, 0xFD, 0x2F,
1138 0x01, 0x79, 0xFF, 0x22, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x32, 0x00,
1139 0x43, 0xFF, 0xBA, 0x01, 0xBC, 0xFC, 0x90, 0x05, 0x8E, 0xF6, 0x68,
1140 0x14, 0x99, 0x44, 0xCD, 0xF7, 0x8F, 0x02, 0x60, 0xFF, 0xEA, 0xFF,
1141 0x3E, 0x00, 0xD7, 0xFF, 0x0A, 0x00, 0xFD, 0xFF, 0x32, 0x00, 0x44,
1142 0xFF, 0xD4, 0x01, 0x3B, 0xFC, 0x2A, 0x07, 0xDF, 0xF1, 0xF6, 0x29,
1143 0x27, 0x36, 0xC1, 0xF1, 0x8B, 0x06, 0xD8, 0xFC, 0x66, 0x01, 0x80,
1144 0xFF, 0x1E, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x07, 0x00, 0xBD, 0xFF,
1145 0xED, 0x00, 0x9E, 0xFD, 0x6C, 0x05, 0x1F, 0xF3, 0xC0, 0x3C, 0x9E,
1146 0x21, 0x28, 0xF3, 0xE2, 0x06, 0x3A, 0xFC, 0xE6, 0x01, 0x37, 0xFF,
1147 0x36, 0x00, 0xFD, 0xFF, 0x12, 0x00, 0xB3, 0xFF, 0x9B, 0x00, 0x2B,
1148 0xFF, 0xBD, 0x00, 0x2A, 0x00, 0x5E, 0xFC, 0x9A, 0x47, 0x82, 0x0C,
1149 0x3D, 0xF9, 0x54, 0x04, 0x50, 0xFD, 0x7A, 0x01, 0x5B, 0xFF, 0x2A,
1150 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x59, 0xFF, 0x81, 0x01,
1151 0x42, 0xFD, 0x72, 0x04, 0xFF, 0xF8, 0x2D, 0x0D, 0x69, 0x47, 0xEB,
1152 0xFB, 0x63, 0x00, 0x9D, 0x00, 0x3C, 0xFF, 0x93, 0x00, 0xB6, 0xFF,
1153 0x12, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x37,
1154 0xFC, 0xED, 0x06, 0x03, 0xF3, 0x5B, 0x22, 0x37, 0x3C, 0xF4, 0xF2,
1155 0x8A, 0x05, 0x89, 0xFD, 0xF9, 0x00, 0xB7, 0xFF, 0x0A, 0x00, 0x01,
1156 0x00, 0xFE, 0xFF, 0x1C, 0x00, 0x84, 0xFF, 0x5C, 0x01, 0xE6, 0xFC,
1157 0x77, 0x06, 0xD4, 0xF1, 0xC6, 0x36, 0x3E, 0x29, 0xF3, 0xF1, 0x29,
1158 0x07, 0x38, 0xFC, 0xD7, 0x01, 0x42, 0xFF, 0x33, 0x00, 0xFD, 0xFF,
1159 0x0B, 0x00, 0xD4, 0xFF, 0x46, 0x00, 0xDA, 0xFF, 0x7D, 0xFF, 0x5D,
1160 0x02, 0x26, 0xF8, 0xED, 0x44, 0xB1, 0x13, 0xC7, 0xF6, 0x77, 0x05,
1161 0xC8, 0xFC, 0xB6, 0x01, 0x45, 0xFF, 0x31, 0x00, 0xFF, 0xFF, 0x00,
1162 0x00, 0x22, 0x00, 0x76, 0xFF, 0x37, 0x01, 0xE4, 0xFD, 0x2C, 0x03,
1163 0x94, 0xFB, 0x83, 0x06, 0xCE, 0x48, 0x05, 0x01, 0xF5, 0xFD, 0xF0,
1164 0x01, 0x87, 0xFE, 0xEA, 0x00, 0x94, 0xFF, 0x1A, 0x00, 0xFE, 0xFF,
1165 0x35, 0x00, 0x38, 0xFF, 0xD9, 0x01, 0x6C, 0xFC, 0x4F, 0x06, 0xC3,
1166 0xF4, 0xA9, 0x1A, 0x49, 0x41, 0x2C, 0xF5, 0x15, 0x04, 0x76, 0xFE,
1167 0x6E, 0x00, 0xFC, 0xFF, 0xF0, 0xFF, 0x05, 0x00, 0xFD, 0xFF, 0x2B,
1168 0x00, 0x5A, 0xFF, 0xAC, 0x01, 0x6E, 0xFC, 0x0A, 0x07, 0x7E, 0xF1,
1169 0xFF, 0x2F, 0x8A, 0x30, 0x7D, 0xF1, 0x03, 0x07, 0x75, 0xFC, 0xA7,
1170 0x01, 0x5D, 0xFF, 0x2A, 0x00, 0xFD, 0xFF, 0x05, 0x00, 0xF2, 0xFF,
1171 0xF7, 0xFF, 0x7A, 0x00, 0x62, 0xFE, 0x35, 0x04, 0xF7, 0xF4, 0xEF,
1172 0x40, 0x40, 0x1B, 0x9C, 0xF4, 0x5E, 0x06, 0x66, 0xFC, 0xDB, 0x01,
1173 0x38, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x1A, 0x00, 0x96, 0xFF, 0xE3,
1174 0x00, 0x95, 0xFE, 0xD5, 0x01, 0x26, 0xFE, 0x98, 0x00, 0xBF, 0x48,
1175 0x00, 0x07, 0x61, 0xFB, 0x46, 0x03, 0xD6, 0xFD, 0x3D, 0x01, 0x73,
1176 0xFF, 0x23, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x31, 0x00, 0x46, 0xFF,
1177 0xB2, 0x01, 0xD1, 0xFC, 0x62, 0x05, 0xF6, 0xF6, 0x20, 0x13, 0x2E,
1178 0x45, 0x70, 0xF8, 0x34, 0x02, 0x94, 0xFF, 0xCD, 0xFF, 0x4C, 0x00,
1179 0xD2, 0xFF, 0x0B, 0x00, 0xFD, 0xFF, 0x33, 0x00, 0x41, 0xFF, 0xDA,
1180 0x01, 0x36, 0xFC, 0x27, 0x07, 0x05, 0xF2, 0xAA, 0x28, 0x44, 0x37,
1181 0xE4, 0xF1, 0x67, 0x06, 0xF2, 0xFC, 0x55, 0x01, 0x88, 0xFF, 0x1B,
1182 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x0B, 0x00, 0xB2, 0xFF, 0x02, 0x01,
1183 0x7A, 0xFD, 0xA2, 0x05, 0xD4, 0xF2, 0xC7, 0x3B, 0xF2, 0x22, 0xE7,
1184 0xF2, 0xF5, 0x06, 0x35, 0xFC, 0xE6, 0x01, 0x38, 0xFF, 0x36, 0x00,
1185 0xFD, 0xFF, 0x11, 0x00, 0xB9, 0xFF, 0x8C, 0x00, 0x4A, 0xFF, 0x83,
1186 0x00, 0x91, 0x00, 0x91, 0xFB, 0x3D, 0x47, 0xB7, 0x0D, 0xCD, 0xF8,
1187 0x89, 0x04, 0x36, 0xFD, 0x86, 0x01, 0x57, 0xFF, 0x2B, 0x00, 0x00,
1188 0x00, 0x00, 0x00, 0x2A, 0x00, 0x5D, 0xFF, 0x75, 0x01, 0x5C, 0xFD,
1189 0x3C, 0x04, 0x70, 0xF9, 0xFA, 0x0B, 0xC0, 0x47, 0xBC, 0xFC, 0xFC,
1190 0xFF, 0xD6, 0x00, 0x1D, 0xFF, 0xA2, 0x00, 0xB0, 0xFF, 0x13, 0x00,
1191 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3C, 0xFC, 0xD8,
1192 0x06, 0x47, 0xF3, 0x06, 0x21, 0x2A, 0x3D, 0x44, 0xF3, 0x52, 0x05,
1193 0xAE, 0xFD, 0xE3, 0x00, 0xC2, 0xFF, 0x06, 0x00, 0x01, 0x00, 0xFE,
1194 0xFF, 0x1F, 0x00, 0x7C, 0xFF, 0x6D, 0x01, 0xCD, 0xFC, 0x99, 0x06,
1195 0xB4, 0xF1, 0xA6, 0x35, 0x89, 0x2A, 0xD0, 0xF1, 0x2B, 0x07, 0x3E,
1196 0xFC, 0xD1, 0x01, 0x46, 0xFF, 0x32, 0x00, 0xFD, 0xFF, 0x0A, 0x00,
1197 0xD9, 0xFF, 0x37, 0x00, 0xF7, 0xFF, 0x49, 0xFF, 0xB6, 0x02, 0x86,
1198 0xF7, 0x53, 0x44, 0xFB, 0x14, 0x61, 0xF6, 0xA4, 0x05, 0xB4, 0xFC,
1199 0xBE, 0x01, 0x42, 0xFF, 0x32, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x21,
1200 0x00, 0x7B, 0xFF, 0x29, 0x01, 0x01, 0xFE, 0xF1, 0x02, 0x07, 0xFC,
1201 0x6E, 0x05, 0xE6, 0x48, 0xFF, 0x01, 0x84, 0xFD, 0x2C, 0x02, 0x68,
1202 0xFE, 0xF9, 0x00, 0x8E, 0xFF, 0x1C, 0x00, 0xFE, 0xFF, 0x35, 0x00,
1203 0x3A, 0xFF, 0xD4, 0x01, 0x7A, 0xFC, 0x2B, 0x06, 0x1E, 0xF5, 0x56,
1204 0x19, 0x0C, 0x42, 0xAA, 0xF5, 0xC9, 0x03, 0xA4, 0xFE, 0x54, 0x00,
1205 0x09, 0x00, 0xEB, 0xFF, 0x06, 0x00, 0xFD, 0xFF, 0x2D, 0x00, 0x55,
1206 0xFF, 0xB6, 0x01, 0x5F, 0xFC, 0x17, 0x07, 0x87, 0xF1, 0xC2, 0x2E,
1207 0xC0, 0x31, 0x7E, 0xF1, 0xF1, 0x06, 0x86, 0xFC, 0x9B, 0x01, 0x63,
1208 0xFF, 0x28, 0x00, 0xFD, 0xFF, 0x04, 0x00, 0xF7, 0xFF, 0xEA, 0xFF,
1209 0x93, 0x00, 0x36, 0xFE, 0x7D, 0x04, 0x85, 0xF4, 0x1F, 0x40, 0x94,
1210 0x1C, 0x47, 0xF4, 0x7E, 0x06, 0x5A, 0xFC, 0xDF, 0x01, 0x37, 0xFF,
1211 0x36, 0x00, 0xFE, 0xFF, 0x18, 0x00, 0x9C, 0xFF, 0xD4, 0x00, 0xB4,
1212 0xFE, 0x9A, 0x01, 0x95, 0xFE, 0xA8, 0xFF, 0x98, 0x48, 0x1D, 0x08,
1213 0xEE, 0xFA, 0x80, 0x03, 0xB9, 0xFD, 0x4B, 0x01, 0x6E, 0xFF, 0x25,
1214 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x30, 0x00, 0x4A, 0xFF, 0xA9, 0x01,
1215 0xE7, 0xFC, 0x33, 0x05, 0x60, 0xF7, 0xDA, 0x11, 0xB8, 0x45, 0x1C,
1216 0xF9, 0xD8, 0x01, 0xCA, 0xFF, 0xAF, 0xFF, 0x5A, 0x00, 0xCC, 0xFF,
1217 0x0D, 0x00, 0xFD, 0xFF, 0x34, 0x00, 0x3E, 0xFF, 0xDE, 0x01, 0x33,
1218 0xFC, 0x21, 0x07, 0x30, 0xF2, 0x5C, 0x27, 0x5B, 0x38, 0x0F, 0xF2,
1219 0x40, 0x06, 0x0E, 0xFD, 0x43, 0x01, 0x91, 0xFF, 0x18, 0x00, 0xFF,
1220 0xFF, 0x00, 0x00, 0x0F, 0x00, 0xA8, 0xFF, 0x17, 0x01, 0x57, 0xFD,
1221 0xD6, 0x05, 0x90, 0xF2, 0xC8, 0x3A, 0x46, 0x24, 0xAA, 0xF2, 0x06,
1222 0x07, 0x32, 0xFC, 0xE5, 0x01, 0x39, 0xFF, 0x36, 0x00, 0xFD, 0xFF,
1223 0x10, 0x00, 0xBE, 0xFF, 0x7D, 0x00, 0x69, 0xFF, 0x4B, 0x00, 0xF6,
1224 0x00, 0xCB, 0xFA, 0xD3, 0x46, 0xF0, 0x0E, 0x5E, 0xF8, 0xBE, 0x04,
1225 0x1E, 0xFD, 0x91, 0x01, 0x52, 0xFF, 0x2D, 0x00, 0xFF, 0xFF, 0x00,
1226 0x00, 0x28, 0x00, 0x62, 0xFF, 0x69, 0x01, 0x77, 0xFD, 0x04, 0x04,
1227 0xE2, 0xF9, 0xCB, 0x0A, 0x0D, 0x48, 0x94, 0xFD, 0x92, 0xFF, 0x10,
1228 0x01, 0xFE, 0xFE, 0xB1, 0x00, 0xAA, 0xFF, 0x15, 0x00, 0xFD, 0xFF,
1229 0x36, 0x00, 0x36, 0xFF, 0xE5, 0x01, 0x43, 0xFC, 0xC0, 0x06, 0x8F,
1230 0xF3, 0xB1, 0x1F, 0x18, 0x3E, 0x9B, 0xF3, 0x16, 0x05, 0xD5, 0xFD,
1231 0xCC, 0x00, 0xCE, 0xFF, 0x01, 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x22,
1232 0x00, 0x74, 0xFF, 0x7C, 0x01, 0xB5, 0xFC, 0xB8, 0x06, 0x9C, 0xF1,
1233 0x81, 0x34, 0xD1, 0x2B, 0xB3, 0xF1, 0x29, 0x07, 0x46, 0xFC, 0xCA,
1234 0x01, 0x4A, 0xFF, 0x30, 0x00, 0xFD, 0xFF, 0x09, 0x00, 0xDF, 0xFF,
1235 0x29, 0x00, 0x14, 0x00, 0x16, 0xFF, 0x0C, 0x03, 0xEE, 0xF6, 0xB0,
1236 0x43, 0x47, 0x16, 0xFC, 0xF5, 0xCF, 0x05, 0xA1, 0xFC, 0xC6, 0x01,
1237 0x3F, 0xFF, 0x33, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x1F, 0x00, 0x81,
1238 0xFF, 0x1B, 0x01, 0x20, 0xFE, 0xB6, 0x02, 0x7A, 0xFC, 0x5F, 0x04,
1239 0xF4, 0x48, 0xFF, 0x02, 0x13, 0xFD, 0x67, 0x02, 0x49, 0xFE, 0x07,
1240 0x01, 0x88, 0xFF, 0x1D, 0x00, 0xFE, 0xFF, 0x34, 0x00, 0x3C, 0xFF,
1241 0xCF, 0x01, 0x8A, 0xFC, 0x05, 0x06, 0x7B, 0xF5, 0x06, 0x18, 0xC7,
1242 0x42, 0x2F, 0xF6, 0x7A, 0x03, 0xD4, 0xFE, 0x39, 0x00, 0x17, 0x00,
1243 0xE6, 0xFF, 0x07, 0x00, 0xFD, 0xFF, 0x2E, 0x00, 0x50, 0xFF, 0xC0,
1244 0x01, 0x53, 0xFC, 0x21, 0x07, 0x96, 0xF1, 0x82, 0x2D, 0xF2, 0x32,
1245 0x86, 0xF1, 0xDB, 0x06, 0x99, 0xFC, 0x8E, 0x01, 0x6A, 0xFF, 0x25,
1246 0x00, 0xFD, 0xFF, 0x03, 0x00, 0xFB, 0xFF, 0xDE, 0xFF, 0xAC, 0x00,
1247 0x0B, 0xFE, 0xC1, 0x04, 0x1B, 0xF4, 0x47, 0x3F, 0xEA, 0x1D, 0xF5,
1248 0xF3, 0x9C, 0x06, 0x4F, 0xFC, 0xE2, 0x01, 0x36, 0xFF, 0x36, 0x00,
1249 0xFE, 0xFF, 0x16, 0x00, 0xA2, 0xFF, 0xC5, 0x00, 0xD4, 0xFE, 0x5F,
1250 0x01, 0x03, 0xFF, 0xBF, 0xFE, 0x63, 0x48, 0x40, 0x09, 0x7B, 0xFA,
1251 0xB9, 0x03, 0x9D, 0xFD, 0x58, 0x01, 0x69, 0xFF, 0x26, 0x00, 0x00,
1252 0x00, 0xFF, 0xFF, 0x2E, 0x00, 0x4D, 0xFF, 0x9F, 0x01, 0xFE, 0xFC,
1253 0x02, 0x05, 0xCB, 0xF7, 0x98, 0x10, 0x39, 0x46, 0xD0, 0xF9, 0x78,
1254 0x01, 0x00, 0x00, 0x91, 0xFF, 0x69, 0x00, 0xC6, 0xFF, 0x0E, 0x00,
1255 0xFD, 0xFF, 0x35, 0x00, 0x3B, 0xFF, 0xE2, 0x01, 0x31, 0xFC, 0x17,
1256 0x07, 0x61, 0xF2, 0x0A, 0x26, 0x6A, 0x39, 0x41, 0xF2, 0x15, 0x06,
1257 0x2C, 0xFD, 0x31, 0x01, 0x9B, 0xFF, 0x14, 0x00, 0xFF, 0xFF, 0xFF,
1258 0xFF, 0x13, 0x00, 0x9E, 0xFF, 0x2B, 0x01, 0x37, 0xFD, 0x05, 0x06,
1259 0x54, 0xF2, 0xC2, 0x39, 0x99, 0x25, 0x73, 0xF2, 0x14, 0x07, 0x31,
1260 0xFC, 0xE3, 0x01, 0x3B, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x0E, 0x00,
1261 0xC4, 0xFF, 0x6E, 0x00, 0x87, 0xFF, 0x13, 0x00, 0x58, 0x01, 0x0D,
1262 0xFA, 0x61, 0x46, 0x2D, 0x10, 0xF0, 0xF7, 0xF1, 0x04, 0x05, 0xFD,
1263 0x9C, 0x01, 0x4E, 0xFF, 0x2E, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x27,
1264 0x00, 0x67, 0xFF, 0x5C, 0x01, 0x93, 0xFD, 0xCC, 0x03, 0x54, 0xFA,
1265 0xA2, 0x09, 0x4F, 0x48, 0x73, 0xFE, 0x27, 0xFF, 0x4B, 0x01, 0xDE,
1266 0xFE, 0xC0, 0x00, 0xA4, 0xFF, 0x16, 0x00, 0xFE, 0xFF, 0x36, 0x00,
1267 0x36, 0xFF, 0xE3, 0x01, 0x4C, 0xFC, 0xA6, 0x06, 0xDB, 0xF3, 0x5B,
1268 0x1E, 0xFC, 0x3E, 0xFA, 0xF3, 0xD7, 0x04, 0xFD, 0xFD, 0xB4, 0x00,
1269 0xD9, 0xFF, 0xFD, 0xFF, 0x03, 0x00, 0xFD, 0xFF, 0x25, 0x00, 0x6D,
1270 0xFF, 0x8A, 0x01, 0x9F, 0xFC, 0xD3, 0x06, 0x8A, 0xF1, 0x57, 0x33,
1271 0x17, 0x2D, 0x9C, 0xF1, 0x24, 0x07, 0x4F, 0xFC, 0xC3, 0x01, 0x4E,
1272 0xFF, 0x2F, 0x00, 0xFD, 0xFF, 0x08, 0x00, 0xE4, 0xFF, 0x1B, 0x00,
1273 0x30, 0x00, 0xE4, 0xFE, 0x5F, 0x03, 0x5E, 0xF6, 0x02, 0x43, 0x96,
1274 0x17, 0x9B, 0xF5, 0xF8, 0x05, 0x8F, 0xFC, 0xCC, 0x01, 0x3D, 0xFF,
1275 0x34, 0x00, 0xFE, 0xFF, 0x1E, 0x00, 0x86, 0xFF, 0x0C, 0x01, 0x3E,
1276 0xFE, 0x7B, 0x02, 0xED, 0xFC, 0x56, 0x03, 0xF5, 0x48, 0x06, 0x04,
1277 0xA1, 0xFC, 0xA3, 0x02, 0x2A, 0xFE, 0x16, 0x01, 0x83, 0xFF, 0x1F,
1278 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x33, 0x00, 0x3E, 0xFF, 0xC8, 0x01,
1279 0x9B, 0xFC, 0xDD, 0x05, 0xDC, 0xF5, 0xB6, 0x16, 0x77, 0x43, 0xBD,
1280 0xF6, 0x28, 0x03, 0x05, 0xFF, 0x1D, 0x00, 0x25, 0x00, 0xE1, 0xFF,
1281 0x08, 0x00, 0xFD, 0xFF, 0x30, 0x00, 0x4B, 0xFF, 0xC8, 0x01, 0x49,
1282 0xFC, 0x27, 0x07, 0xAB, 0xF1, 0x3E, 0x2C, 0x1E, 0x34, 0x95, 0xF1,
1283 0xC1, 0x06, 0xAE, 0xFC, 0x81, 0x01, 0x71, 0xFF, 0x23, 0x00, 0xFE,
1284 0xFF, 0x02, 0x00, 0x00, 0x00, 0xD2, 0xFF, 0xC4, 0x00, 0xE2, 0xFD,
1285 0x01, 0x05, 0xBA, 0xF3, 0x64, 0x3E, 0x3F, 0x1F, 0xA8, 0xF3, 0xB8,
1286 0x06, 0x46, 0xFC, 0xE5, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF,
1287 0x15, 0x00, 0xA8, 0xFF, 0xB6, 0x00, 0xF3, 0xFE, 0x24, 0x01, 0x6E,
1288 0xFF, 0xDE, 0xFD, 0x25, 0x48, 0x68, 0x0A, 0x08, 0xFA, 0xF2, 0x03,
1289 0x81, 0xFD, 0x65, 0x01, 0x64, 0xFF, 0x28, 0x00, 0x00, 0x00, 0xFF,
1290 0xFF, 0x2D, 0x00, 0x51, 0xFF, 0x95, 0x01, 0x15, 0xFD, 0xCF, 0x04,
1291 0x39, 0xF8, 0x59, 0x0F, 0xAF, 0x46, 0x8B, 0xFA, 0x17, 0x01, 0x38,
1292 0x00, 0x73, 0xFF, 0x78, 0x00, 0xC0, 0xFF, 0x0F, 0x00, 0xFD, 0xFF,
1293 0x36, 0x00, 0x39, 0xFF, 0xE4, 0x01, 0x32, 0xFC, 0x0B, 0x07, 0x97,
1294 0xF2, 0xB8, 0x24, 0x71, 0x3A, 0x7B, 0xF2, 0xE6, 0x05, 0x4C, 0xFD,
1295 0x1D, 0x01, 0xA4, 0xFF, 0x11, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x16,
1296 0x00, 0x94, 0xFF, 0x3D, 0x01, 0x18, 0xFD, 0x32, 0x06, 0x1F, 0xF2,
1297 0xB5, 0x38, 0xEB, 0x26, 0x40, 0xF2, 0x1E, 0x07, 0x32, 0xFC, 0xDF,
1298 0x01, 0x3D, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x0D, 0x00, 0xCA, 0xFF,
1299 0x5F, 0x00, 0xA5, 0xFF, 0xDC, 0xFF, 0xB8, 0x01, 0x57, 0xF9, 0xE5,
1300 0x45, 0x6E, 0x11, 0x83, 0xF7, 0x23, 0x05, 0xEE, 0xFC, 0xA6, 0x01,
1301 0x4B, 0xFF, 0x2F, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x25, 0x00, 0x6C,
1302 0xFF, 0x4F, 0x01, 0xB0, 0xFD, 0x93, 0x03, 0xC7, 0xFA, 0x7D, 0x08,
1303 0x86, 0x48, 0x5A, 0xFF, 0xBA, 0xFE, 0x86, 0x01, 0xBF, 0xFE, 0xCF,
1304 0x00, 0x9E, 0xFF, 0x17, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x37, 0xFF,
1305 0xE0, 0x01, 0x56, 0xFC, 0x89, 0x06, 0x2B, 0xF4, 0x06, 0x1D, 0xD7,
1306 0x3F, 0x61, 0xF4, 0x94, 0x04, 0x27, 0xFE, 0x9C, 0x00, 0xE6, 0xFF,
1307 0xF8, 0xFF, 0x04, 0x00, 0xFD, 0xFF, 0x27, 0x00, 0x66, 0xFF, 0x97,
1308 0x01, 0x8C, 0xFC, 0xEA, 0x06, 0x80, 0xF1, 0x26, 0x32, 0x58, 0x2E,
1309 0x8B, 0xF1, 0x1B, 0x07, 0x5B, 0xFC, 0xBA, 0x01, 0x53, 0xFF, 0x2D,
1310 0x00, 0xFD, 0xFF, 0x07, 0x00, 0xE9, 0xFF, 0x0E, 0x00, 0x4B, 0x00,
1311 0xB4, 0xFE, 0xAF, 0x03, 0xD5, 0xF5, 0x4D, 0x42, 0xE6, 0x18, 0x3C,
1312 0xF5, 0x1F, 0x06, 0x7F, 0xFC, 0xD3, 0x01, 0x3B, 0xFF, 0x35, 0x00,
1313 0xFE, 0xFF, 0x1C, 0x00, 0x8C, 0xFF, 0xFE, 0x00, 0x5D, 0xFE, 0x3F,
1314 0x02, 0x5E, 0xFD, 0x54, 0x02, 0xEC, 0x48, 0x13, 0x05, 0x2E, 0xFC,
1315 0xDE, 0x02, 0x0C, 0xFE, 0x24, 0x01, 0x7D, 0xFF, 0x20, 0x00, 0x00,
1316 0x00, 0xFF, 0xFF, 0x32, 0x00, 0x41, 0xFF, 0xC1, 0x01, 0xAD, 0xFC,
1317 0xB2, 0x05, 0x3F, 0xF6, 0x69, 0x15, 0x1F, 0x44, 0x53, 0xF7, 0xD3,
1318 0x02, 0x38, 0xFF, 0x01, 0x00, 0x33, 0x00, 0xDB, 0xFF, 0x09, 0x00,
1319 0xFD, 0xFF, 0x31, 0x00, 0x47, 0xFF, 0xCF, 0x01, 0x40, 0xFC, 0x2A,
1320 0x07, 0xC6, 0xF1, 0xF7, 0x2A, 0x46, 0x35, 0xAB, 0xF1, 0xA4, 0x06,
1321 0xC4, 0xFC, 0x72, 0x01, 0x79, 0xFF, 0x20, 0x00, 0xFE, 0xFF, 0x02,
1322 0x00, 0x04, 0x00, 0xC6, 0xFF, 0xDB, 0x00, 0xBB, 0xFD, 0x3E, 0x05,
1323 0x60, 0xF3, 0x7B, 0x3D, 0x94, 0x20, 0x5E, 0xF3, 0xD0, 0x06, 0x3E,
1324 0xFC, 0xE6, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x14, 0x00,
1325 0xAE, 0xFF, 0xA7, 0x00, 0x12, 0xFF, 0xEA, 0x00, 0xD9, 0xFF, 0x03,
1326 0xFD, 0xDC, 0x47, 0x95, 0x0B, 0x96, 0xF9, 0x29, 0x04, 0x65, 0xFD,
1327 0x71, 0x01, 0x5F, 0xFF, 0x29, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2C,
1328 0x00, 0x55, 0xFF, 0x8A, 0x01, 0x2E, 0xFD, 0x9B, 0x04, 0xA8, 0xF8,
1329 0x1F, 0x0E, 0x1A, 0x47, 0x4E, 0xFB, 0xB3, 0x00, 0x70, 0x00, 0x54,
1330 0xFF, 0x87, 0x00, 0xBB, 0xFF, 0x11, 0x00, 0xFD, 0xFF, 0x36, 0x00,
1331 0x38, 0xFF, 0xE6, 0x01, 0x34, 0xFC, 0xFB, 0x06, 0xD2, 0xF2, 0x64,
1332 0x23, 0x73, 0x3B, 0xBC, 0xF2, 0xB4, 0x05, 0x6E, 0xFD, 0x09, 0x01,
1333 0xAF, 0xFF, 0x0D, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x1A, 0x00, 0x8B,
1334 0xFF, 0x4F, 0x01, 0xFB, 0xFC, 0x5A, 0x06, 0xF2, 0xF1, 0xA0, 0x37,
1335 0x3A, 0x28, 0x13, 0xF2, 0x25, 0x07, 0x35, 0xFC, 0xDB, 0x01, 0x40,
1336 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0x0C, 0x00, 0xD0, 0xFF, 0x51, 0x00,
1337 0xC3, 0xFF, 0xA6, 0xFF, 0x16, 0x02, 0xA9, 0xF8, 0x5C, 0x45, 0xB2,
1338 0x12, 0x19, 0xF7, 0x52, 0x05, 0xD8, 0xFC, 0xAF, 0x01, 0x47, 0xFF,
1339 0x30, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x24, 0x00, 0x71, 0xFF, 0x42,
1340 0x01, 0xCD, 0xFD, 0x59, 0x03, 0x3B, 0xFB, 0x5E, 0x07, 0xB3, 0x48,
1341 0x48, 0x00, 0x4B, 0xFE, 0xC2, 0x01, 0x9F, 0xFE, 0xDE, 0x00, 0x98,
1342 0xFF, 0x19, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x38, 0xFF, 0xDD, 0x01,
1343 0x62, 0xFC, 0x69, 0x06, 0x7F, 0xF4, 0xB2, 0x1B, 0xAB, 0x40, 0xD0,
1344 0xF4, 0x4E, 0x04, 0x53, 0xFE, 0x83, 0x00, 0xF2, 0xFF, 0xF4, 0xFF,
1345 0x05, 0x00, 0xFD, 0xFF, 0x29, 0x00, 0x5F, 0xFF, 0xA3, 0x01, 0x7A,
1346 0xFC, 0xFD, 0x06, 0x7C, 0xF1, 0xF2, 0x30, 0x96, 0x2F, 0x80, 0xF1,
1347 0x0F, 0x07, 0x69, 0xFC, 0xB0, 0x01, 0x59, 0xFF, 0x2B, 0x00, 0xFD,
1348 0xFF, 0x06, 0x00, 0xEE, 0xFF, 0x01, 0x00, 0x66, 0x00, 0x85, 0xFE,
1349 0xFC, 0x03, 0x55, 0xF5, 0x8C, 0x41, 0x38, 0x1A, 0xE1, 0xF4, 0x43,
1350 0x06, 0x70, 0xFC, 0xD8, 0x01, 0x39, 0xFF, 0x35, 0x00, 0xFE, 0xFF,
1351 0x1B, 0x00, 0x92, 0xFF, 0xEF, 0x00, 0x7D, 0xFE, 0x04, 0x02, 0xCF,
1352 0xFD, 0x58, 0x01, 0xD7, 0x48, 0x26, 0x06, 0xBB, 0xFB, 0x19, 0x03,
1353 0xED, 0xFD, 0x32, 0x01, 0x77, 0xFF, 0x22, 0x00, 0x00, 0x00, 0xFF,
1354 0xFF, 0x32, 0x00, 0x44, 0xFF, 0xB9, 0x01, 0xC1, 0xFC, 0x86, 0x05,
1355 0xA5, 0xF6, 0x1E, 0x14, 0xBA, 0x44, 0xF0, 0xF7, 0x7B, 0x02, 0x6B,
1356 0xFF, 0xE4, 0xFF, 0x41, 0x00, 0xD6, 0xFF, 0x0B, 0x00, 0xFD, 0xFF,
1357 0x33, 0x00, 0x43, 0xFF, 0xD5, 0x01, 0x3A, 0xFC, 0x2A, 0x07, 0xE7,
1358 0xF1, 0xAC, 0x29, 0x66, 0x36, 0xC9, 0xF1, 0x83, 0x06, 0xDD, 0xFC,
1359 0x62, 0x01, 0x81, 0xFF, 0x1D, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x08,
1360 0x00, 0xBB, 0xFF, 0xF1, 0x00, 0x96, 0xFD, 0x78, 0x05, 0x0E, 0xF3,
1361 0x8A, 0x3C, 0xEA, 0x21, 0x19, 0xF3, 0xE6, 0x06, 0x38, 0xFC, 0xE6,
1362 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x12, 0x00, 0xB4, 0xFF,
1363 0x98, 0x00, 0x32, 0xFF, 0xB0, 0x00, 0x41, 0x00, 0x30, 0xFC, 0x86,
1364 0x47, 0xC6, 0x0C, 0x24, 0xF9, 0x60, 0x04, 0x4B, 0xFD, 0x7D, 0x01,
1365 0x5A, 0xFF, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x5A,
1366 0xFF, 0x7E, 0x01, 0x48, 0xFD, 0x66, 0x04, 0x18, 0xF9, 0xE8, 0x0C,
1367 0x7C, 0x47, 0x19, 0xFC, 0x4D, 0x00, 0xA9, 0x00, 0x35, 0xFF, 0x96,
1368 0x00, 0xB5, 0xFF, 0x12, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x37, 0xFF,
1369 0xE6, 0x01, 0x38, 0xFC, 0xE9, 0x06, 0x12, 0xF3, 0x10, 0x22, 0x6E,
1370 0x3C, 0x05, 0xF3, 0x7E, 0x05, 0x91, 0xFD, 0xF4, 0x00, 0xBA, 0xFF,
1371 0x09, 0x00, 0x01, 0x00, 0xFE, 0xFF, 0x1D, 0x00, 0x82, 0xFF, 0x60,
1372 0x01, 0xE0, 0xFC, 0x7F, 0x06, 0xCC, 0xF1, 0x85, 0x36, 0x87, 0x29,
1373 0xEB, 0xF1, 0x2A, 0x07, 0x39, 0xFC, 0xD6, 0x01, 0x43, 0xFF, 0x33,
1374 0x00, 0xFD, 0xFF, 0x0B, 0x00, 0xD5, 0xFF, 0x42, 0x00, 0xE1, 0xFF,
1375 0x71, 0xFF, 0x71, 0x02, 0x02, 0xF8, 0xCC, 0x44, 0xFA, 0x13, 0xB0,
1376 0xF6, 0x81, 0x05, 0xC3, 0xFC, 0xB8, 0x01, 0x44, 0xFF, 0x31, 0x00,
1377 0xFF, 0xFF, 0x00, 0x00, 0x22, 0x00, 0x77, 0xFF, 0x34, 0x01, 0xEA,
1378 0xFD, 0x1F, 0x03, 0xAE, 0xFB, 0x45, 0x06, 0xD5, 0x48, 0x3C, 0x01,
1379 0xDC, 0xFD, 0xFD, 0x01, 0x80, 0xFE, 0xED, 0x00, 0x93, 0xFF, 0x1B,
1380 0x00, 0xFE, 0xFF, 0x35, 0x00, 0x39, 0xFF, 0xD8, 0x01, 0x6F, 0xFC,
1381 0x47, 0x06, 0xD7, 0xF4, 0x5D, 0x1A, 0x74, 0x41, 0x48, 0xF5, 0x04,
1382 0x04, 0x80, 0xFE, 0x69, 0x00, 0xFF, 0xFF, 0xEF, 0xFF, 0x05, 0x00,
1383 0xFD, 0xFF, 0x2B, 0x00, 0x59, 0xFF, 0xAE, 0x01, 0x6A, 0xFC, 0x0D,
1384 0x07, 0x80, 0xF1, 0xB8, 0x2F, 0xCF, 0x30, 0x7D, 0xF1, 0xFF, 0x06,
1385 0x78, 0xFC, 0xA5, 0x01, 0x5F, 0xFF, 0x29, 0x00, 0xFD, 0xFF, 0x05,
1386 0x00, 0xF3, 0xFF, 0xF4, 0xFF, 0x80, 0x00, 0x58, 0xFE, 0x46, 0x04,
1387 0xDD, 0xF4, 0xC3, 0x40, 0x8C, 0x1B, 0x89, 0xF4, 0x66, 0x06, 0x63,
1388 0xFC, 0xDC, 0x01, 0x38, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x19, 0x00,
1389 0x98, 0xFF, 0xE0, 0x00, 0x9C, 0xFE, 0xC8, 0x01, 0x3F, 0xFE, 0x62,
1390 0x00, 0xB8, 0x48, 0x3F, 0x07, 0x47, 0xFB, 0x53, 0x03, 0xD0, 0xFD,
1391 0x40, 0x01, 0x72, 0xFF, 0x23, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x30,
1392 0x00, 0x47, 0xFF, 0xB0, 0x01, 0xD6, 0xFC, 0x58, 0x05, 0x0D, 0xF7,
1393 0xD7, 0x12, 0x4E, 0x45, 0x96, 0xF8, 0x20, 0x02, 0xA0, 0xFF, 0xC7,
1394 0xFF, 0x4F, 0x00, 0xD0, 0xFF, 0x0C, 0x00, 0xFD, 0xFF, 0x34, 0x00,
1395 0x40, 0xFF, 0xDB, 0x01, 0x35, 0xFC, 0x26, 0x07, 0x0E, 0xF2, 0x60,
1396 0x28, 0x82, 0x37, 0xED, 0xF1, 0x5E, 0x06, 0xF8, 0xFC, 0x51, 0x01,
1397 0x8A, 0xFF, 0x1A, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x0C, 0x00, 0xB0,
1398 0xFF, 0x07, 0x01, 0x72, 0xFD, 0xAE, 0x05, 0xC4, 0xF2, 0x90, 0x3B,
1399 0x3F, 0x23, 0xD9, 0xF2, 0xF9, 0x06, 0x34, 0xFC, 0xE6, 0x01, 0x38,
1400 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x11, 0x00, 0xBA, 0xFF, 0x89, 0x00,
1401 0x51, 0xFF, 0x77, 0x00, 0xA7, 0x00, 0x64, 0xFB, 0x26, 0x47, 0xFC,
1402 0x0D, 0xB4, 0xF8, 0x95, 0x04, 0x31, 0xFD, 0x88, 0x01, 0x56, 0xFF,
1403 0x2C, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x29, 0x00, 0x5E, 0xFF, 0x72,
1404 0x01, 0x62, 0xFD, 0x2F, 0x04, 0x89, 0xF9, 0xB6, 0x0B, 0xD2, 0x47,
1405 0xEB, 0xFC, 0xE4, 0xFF, 0xE3, 0x00, 0x16, 0xFF, 0xA5, 0x00, 0xAF,
1406 0xFF, 0x13, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01,
1407 0x3E, 0xFC, 0xD3, 0x06, 0x56, 0xF3, 0xBA, 0x20, 0x61, 0x3D, 0x56,
1408 0xF3, 0x45, 0x05, 0xB7, 0xFD, 0xDE, 0x00, 0xC5, 0xFF, 0x05, 0x00,
1409 0x02, 0x00, 0xFE, 0xFF, 0x20, 0x00, 0x7A, 0xFF, 0x70, 0x01, 0xC7,
1410 0xFC, 0xA0, 0x06, 0xAE, 0xF1, 0x65, 0x35, 0xD1, 0x2A, 0xCA, 0xF1,
1411 0x2A, 0x07, 0x40, 0xFC, 0xD0, 0x01, 0x47, 0xFF, 0x32, 0x00, 0xFD,
1412 0xFF, 0x09, 0x00, 0xDB, 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0x3D, 0xFF,
1413 0xC9, 0x02, 0x64, 0xF7, 0x2F, 0x44, 0x44, 0x15, 0x4A, 0xF6, 0xAD,
1414 0x05, 0xAF, 0xFC, 0xC0, 0x01, 0x41, 0xFF, 0x32, 0x00, 0xFF, 0xFF,
1415 0x00, 0x00, 0x21, 0x00, 0x7C, 0xFF, 0x26, 0x01, 0x08, 0xFE, 0xE4,
1416 0x02, 0x21, 0xFC, 0x31, 0x05, 0xEB, 0x48, 0x37, 0x02, 0x6B, 0xFD,
1417 0x39, 0x02, 0x61, 0xFE, 0xFC, 0x00, 0x8D, 0xFF, 0x1C, 0x00, 0xFE,
1418 0xFF, 0x35, 0x00, 0x3A, 0xFF, 0xD3, 0x01, 0x7D, 0xFC, 0x23, 0x06,
1419 0x32, 0xF5, 0x0C, 0x19, 0x38, 0x42, 0xC7, 0xF5, 0xB8, 0x03, 0xAF,
1420 0xFE, 0x4E, 0x00, 0x0C, 0x00, 0xEA, 0xFF, 0x06, 0x00, 0xFD, 0xFF,
1421 0x2D, 0x00, 0x54, 0xFF, 0xB8, 0x01, 0x5D, 0xFC, 0x1A, 0x07, 0x8A,
1422 0xF1, 0x7B, 0x2E, 0x04, 0x32, 0x7F, 0xF1, 0xEC, 0x06, 0x8A, 0xFC,
1423 0x98, 0x01, 0x65, 0xFF, 0x27, 0x00, 0xFD, 0xFF, 0x04, 0x00, 0xF8,
1424 0xFF, 0xE7, 0xFF, 0x99, 0x00, 0x2C, 0xFE, 0x8C, 0x04, 0x6D, 0xF4,
1425 0xF0, 0x3F, 0xE0, 0x1C, 0x34, 0xF4, 0x85, 0x06, 0x57, 0xFC, 0xE0,
1426 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x18, 0x00, 0x9E, 0xFF,
1427 0xD1, 0x00, 0xBB, 0xFE, 0x8D, 0x01, 0xAE, 0xFE, 0x74, 0xFF, 0x8D,
1428 0x48, 0x5D, 0x08, 0xD4, 0xFA, 0x8D, 0x03, 0xB3, 0xFD, 0x4E, 0x01,
1429 0x6D, 0xFF, 0x25, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2F, 0x00, 0x4A,
1430 0xFF, 0xA7, 0x01, 0xEC, 0xFC, 0x28, 0x05, 0x77, 0xF7, 0x92, 0x11,
1431 0xD7, 0x45, 0x43, 0xF9, 0xC3, 0x01, 0xD6, 0xFF, 0xA9, 0xFF, 0x5E,
1432 0x00, 0xCB, 0xFF, 0x0D, 0x00, 0xFD, 0xFF, 0x34, 0x00, 0x3D, 0xFF,
1433 0xDF, 0x01, 0x32, 0xFC, 0x1F, 0x07, 0x3B, 0xF2, 0x11, 0x27, 0x97,
1434 0x38, 0x19, 0xF2, 0x36, 0x06, 0x15, 0xFD, 0x3F, 0x01, 0x93, 0xFF,
1435 0x17, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x10, 0x00, 0xA6, 0xFF, 0x1B,
1436 0x01, 0x50, 0xFD, 0xE1, 0x05, 0x82, 0xF2, 0x8F, 0x3A, 0x92, 0x24,
1437 0x9D, 0xF2, 0x09, 0x07, 0x32, 0xFC, 0xE4, 0x01, 0x39, 0xFF, 0x36,
1438 0x00, 0xFD, 0xFF, 0x0F, 0x00, 0xC0, 0xFF, 0x7A, 0x00, 0x70, 0xFF,
1439 0x3E, 0x00, 0x0C, 0x01, 0xA1, 0xFA, 0xBB, 0x46, 0x36, 0x0F, 0x45,
1440 0xF8, 0xC9, 0x04, 0x18, 0xFD, 0x93, 0x01, 0x52, 0xFF, 0x2D, 0x00,
1441 0xFF, 0xFF, 0x00, 0x00, 0x28, 0x00, 0x63, 0xFF, 0x66, 0x01, 0x7D,
1442 0xFD, 0xF8, 0x03, 0xFB, 0xF9, 0x89, 0x0A, 0x1D, 0x48, 0xC5, 0xFD,
1443 0x7A, 0xFF, 0x1D, 0x01, 0xF7, 0xFE, 0xB4, 0x00, 0xA9, 0xFF, 0x15,
1444 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE5, 0x01, 0x45, 0xFC,
1445 0xBB, 0x06, 0xA0, 0xF3, 0x64, 0x1F, 0x4A, 0x3E, 0xB0, 0xF3, 0x08,
1446 0x05, 0xDE, 0xFD, 0xC7, 0x00, 0xD0, 0xFF, 0x00, 0x00, 0x02, 0x00,
1447 0xFE, 0xFF, 0x23, 0x00, 0x72, 0xFF, 0x7F, 0x01, 0xB0, 0xFC, 0xBE,
1448 0x06, 0x97, 0xF1, 0x3F, 0x34, 0x19, 0x2C, 0xAD, 0xF1, 0x28, 0x07,
1449 0x48, 0xFC, 0xC9, 0x01, 0x4B, 0xFF, 0x30, 0x00, 0xFD, 0xFF, 0x08,
1450 0x00, 0xE0, 0xFF, 0x26, 0x00, 0x1A, 0x00, 0x0B, 0xFF, 0x1E, 0x03,
1451 0xCD, 0xF6, 0x89, 0x43, 0x91, 0x16, 0xE7, 0xF5, 0xD8, 0x05, 0x9D,
1452 0xFC, 0xC7, 0x01, 0x3E, 0xFF, 0x33, 0x00, 0xFF, 0xFF, 0x00, 0x00,
1453 0x1F, 0x00, 0x82, 0xFF, 0x18, 0x01, 0x27, 0xFE, 0xA9, 0x02, 0x94,
1454 0xFC, 0x24, 0x04, 0xF5, 0x48, 0x39, 0x03, 0xF9, 0xFC, 0x74, 0x02,
1455 0x42, 0xFE, 0x0B, 0x01, 0x87, 0xFF, 0x1E, 0x00, 0xFE, 0xFF, 0x34,
1456 0x00, 0x3C, 0xFF, 0xCD, 0x01, 0x8E, 0xFC, 0xFC, 0x05, 0x90, 0xF5,
1457 0xBB, 0x17, 0xEE, 0x42, 0x4E, 0xF6, 0x68, 0x03, 0xDF, 0xFE, 0x33,
1458 0x00, 0x1A, 0x00, 0xE5, 0xFF, 0x07, 0x00, 0xFD, 0xFF, 0x2F, 0x00,
1459 0x4F, 0xFF, 0xC2, 0x01, 0x51, 0xFC, 0x23, 0x07, 0x9A, 0xF1, 0x3A,
1460 0x2D, 0x35, 0x33, 0x89, 0xF1, 0xD5, 0x06, 0x9D, 0xFC, 0x8B, 0x01,
1461 0x6C, 0xFF, 0x25, 0x00, 0xFD, 0xFF, 0x03, 0x00, 0xFC, 0xFF, 0xDB,
1462 0xFF, 0xB2, 0x00, 0x02, 0xFE, 0xCF, 0x04, 0x05, 0xF4, 0x16, 0x3F,
1463 0x36, 0x1E, 0xE4, 0xF3, 0xA3, 0x06, 0x4D, 0xFC, 0xE3, 0x01, 0x36,
1464 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x16, 0x00, 0xA4, 0xFF, 0xC2, 0x00,
1465 0xDB, 0xFE, 0x52, 0x01, 0x1B, 0xFF, 0x8D, 0xFE, 0x57, 0x48, 0x81,
1466 0x09, 0x61, 0xFA, 0xC6, 0x03, 0x96, 0xFD, 0x5B, 0x01, 0x68, 0xFF,
1467 0x26, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2E, 0x00, 0x4E, 0xFF, 0x9D,
1468 0x01, 0x03, 0xFD, 0xF7, 0x04, 0xE3, 0xF7, 0x51, 0x10, 0x55, 0x46,
1469 0xF9, 0xF9, 0x63, 0x01, 0x0D, 0x00, 0x8B, 0xFF, 0x6D, 0x00, 0xC5,
1470 0xFF, 0x0E, 0x00, 0xFD, 0xFF, 0x35, 0x00, 0x3B, 0xFF, 0xE2, 0x01,
1471 0x31, 0xFC, 0x15, 0x07, 0x6D, 0xF2, 0xBF, 0x25, 0xA5, 0x39, 0x4D,
1472 0xF2, 0x0B, 0x06, 0x33, 0xFD, 0x2D, 0x01, 0x9D, 0xFF, 0x13, 0x00,
1473 0xFF, 0xFF, 0xFF, 0xFF, 0x14, 0x00, 0x9C, 0xFF, 0x2F, 0x01, 0x30,
1474 0xFD, 0x10, 0x06, 0x47, 0xF2, 0x87, 0x39, 0xE5, 0x25, 0x67, 0xF2,
1475 0x16, 0x07, 0x31, 0xFC, 0xE2, 0x01, 0x3B, 0xFF, 0x35, 0x00, 0xFD,
1476 0xFF, 0x0E, 0x00, 0xC6, 0xFF, 0x6B, 0x00, 0x8E, 0xFF, 0x06, 0x00,
1477 0x6E, 0x01, 0xE4, 0xF9, 0x48, 0x46, 0x75, 0x10, 0xD7, 0xF7, 0xFC,
1478 0x04, 0x00, 0xFD, 0x9E, 0x01, 0x4E, 0xFF, 0x2E, 0x00, 0xFF, 0xFF,
1479 0x00, 0x00, 0x26, 0x00, 0x68, 0xFF, 0x59, 0x01, 0x99, 0xFD, 0xC0,
1480 0x03, 0x6E, 0xFA, 0x61, 0x09, 0x5D, 0x48, 0xA6, 0xFE, 0x0F, 0xFF,
1481 0x58, 0x01, 0xD7, 0xFE, 0xC3, 0x00, 0xA3, 0xFF, 0x16, 0x00, 0xFE,
1482 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE3, 0x01, 0x4E, 0xFC, 0xA0, 0x06,
1483 0xED, 0xF3, 0x0F, 0x1E, 0x2D, 0x3F, 0x10, 0xF4, 0xC8, 0x04, 0x07,
1484 0xFE, 0xAF, 0x00, 0xDC, 0xFF, 0xFC, 0xFF, 0x03, 0x00, 0xFD, 0xFF,
1485 0x25, 0x00, 0x6B, 0xFF, 0x8D, 0x01, 0x9B, 0xFC, 0xD8, 0x06, 0x87,
1486 0xF1, 0x13, 0x33, 0x5E, 0x2D, 0x98, 0xF1, 0x22, 0x07, 0x52, 0xFC,
1487 0xC1, 0x01, 0x4F, 0xFF, 0x2F, 0x00, 0xFD, 0xFF, 0x07, 0x00, 0xE5,
1488 0xFF, 0x18, 0x00, 0x36, 0x00, 0xD9, 0xFE, 0x71, 0x03, 0x3F, 0xF6,
1489 0xDB, 0x42, 0xE0, 0x17, 0x86, 0xF5, 0x00, 0x06, 0x8C, 0xFC, 0xCE,
1490 0x01, 0x3C, 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0x1D, 0x00, 0x88, 0xFF,
1491 0x09, 0x01, 0x45, 0xFE, 0x6E, 0x02, 0x06, 0xFD, 0x1C, 0x03, 0xF4,
1492 0x48, 0x41, 0x04, 0x87, 0xFC, 0xB0, 0x02, 0x23, 0xFE, 0x19, 0x01,
1493 0x81, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x33, 0x00, 0x3F,
1494 0xFF, 0xC6, 0x01, 0x9F, 0xFC, 0xD3, 0x05, 0xF1, 0xF5, 0x6C, 0x16,
1495 0x9E, 0x43, 0xDD, 0xF6, 0x15, 0x03, 0x10, 0xFF, 0x17, 0x00, 0x28,
1496 0x00, 0xDF, 0xFF, 0x09, 0x00, 0xFD, 0xFF, 0x30, 0x00, 0x4A, 0xFF,
1497 0xCA, 0x01, 0x47, 0xFC, 0x28, 0x07, 0xB0, 0xF1, 0xF5, 0x2B, 0x60,
1498 0x34, 0x9A, 0xF1, 0xBB, 0x06, 0xB3, 0xFC, 0x7D, 0x01, 0x73, 0xFF,
1499 0x22, 0x00, 0xFE, 0xFF, 0x02, 0x00, 0x01, 0x00, 0xCF, 0xFF, 0xC9,
1500 0x00, 0xDA, 0xFD, 0x0F, 0x05, 0xA5, 0xF3, 0x31, 0x3E, 0x8A, 0x1F,
1501 0x97, 0xF3, 0xBD, 0x06, 0x44, 0xFC, 0xE5, 0x01, 0x36, 0xFF, 0x36,
1502 0x00, 0xFD, 0xFF, 0x15, 0x00, 0xAA, 0xFF, 0xB3, 0x00, 0xFA, 0xFE,
1503 0x17, 0x01, 0x86, 0xFF, 0xAC, 0xFD, 0x16, 0x48, 0xAA, 0x0A, 0xEE,
1504 0xF9, 0xFE, 0x03, 0x7A, 0xFD, 0x67, 0x01, 0x63, 0xFF, 0x28, 0x00,
1505 0x00, 0x00, 0xFF, 0xFF, 0x2D, 0x00, 0x52, 0xFF, 0x92, 0x01, 0x1B,
1506 0xFD, 0xC4, 0x04, 0x51, 0xF8, 0x13, 0x0F, 0xC8, 0x46, 0xB6, 0xFA,
1507 0x01, 0x01, 0x44, 0x00, 0x6C, 0xFF, 0x7B, 0x00, 0xBF, 0xFF, 0x10,
1508 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x39, 0xFF, 0xE5, 0x01, 0x32, 0xFC,
1509 0x08, 0x07, 0xA4, 0xF2, 0x6D, 0x24, 0xAD, 0x3A, 0x88, 0xF2, 0xDB,
1510 0x05, 0x53, 0xFD, 0x19, 0x01, 0xA7, 0xFF, 0x10, 0x00, 0x00, 0x00,
1511 0xFF, 0xFF, 0x17, 0x00, 0x92, 0xFF, 0x41, 0x01, 0x11, 0xFD, 0x3B,
1512 0x06, 0x14, 0xF2, 0x78, 0x38, 0x36, 0x27, 0x35, 0xF2, 0x20, 0x07,
1513 0x33, 0xFC, 0xDF, 0x01, 0x3E, 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0x0D,
1514 0x00, 0xCB, 0xFF, 0x5C, 0x00, 0xAC, 0xFF, 0xD0, 0xFF, 0xCD, 0x01,
1515 0x30, 0xF9, 0xC8, 0x45, 0xB6, 0x11, 0x6B, 0xF7, 0x2D, 0x05, 0xE9,
1516 0xFC, 0xA8, 0x01, 0x4A, 0xFF, 0x30, 0x00, 0xFF, 0xFF, 0x00, 0x00,
1517 0x25, 0x00, 0x6D, 0xFF, 0x4C, 0x01, 0xB6, 0xFD, 0x86, 0x03, 0xE1,
1518 0xFA, 0x3D, 0x08, 0x92, 0x48, 0x8E, 0xFF, 0xA1, 0xFE, 0x93, 0x01,
1519 0xB8, 0xFE, 0xD3, 0x00, 0x9D, 0xFF, 0x18, 0x00, 0xFE, 0xFF, 0x36,
1520 0x00, 0x37, 0xFF, 0xE0, 0x01, 0x58, 0xFC, 0x82, 0x06, 0x3E, 0xF4,
1521 0xBA, 0x1C, 0x07, 0x40, 0x79, 0xF4, 0x84, 0x04, 0x31, 0xFE, 0x96,
1522 0x00, 0xE8, 0xFF, 0xF7, 0xFF, 0x04, 0x00, 0xFD, 0xFF, 0x28, 0x00,
1523 0x64, 0xFF, 0x9A, 0x01, 0x88, 0xFC, 0xEE, 0x06, 0x7E, 0xF1, 0xE3,
1524 0x31, 0x9F, 0x2E, 0x88, 0xF1, 0x19, 0x07, 0x5E, 0xFC, 0xB7, 0x01,
1525 0x54, 0xFF, 0x2D, 0x00, 0xFD, 0xFF, 0x06, 0x00, 0xEA, 0xFF, 0x0B,
1526 0x00, 0x51, 0x00, 0xAA, 0xFE, 0xC0, 0x03, 0xB8, 0xF5, 0x21, 0x42,
1527 0x31, 0x19, 0x28, 0xF5, 0x27, 0x06, 0x7C, 0xFC, 0xD4, 0x01, 0x3A,
1528 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x1C, 0x00, 0x8D, 0xFF, 0xFA, 0x00,
1529 0x64, 0xFE, 0x32, 0x02, 0x78, 0xFD, 0x1B, 0x02, 0xEA, 0x48, 0x50,
1530 0x05, 0x14, 0xFC, 0xEB, 0x02, 0x05, 0xFE, 0x27, 0x01, 0x7C, 0xFF,
1531 0x21, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x32, 0x00, 0x41, 0xFF, 0xBF,
1532 0x01, 0xB2, 0xFC, 0xA9, 0x05, 0x55, 0xF6, 0x20, 0x15, 0x42, 0x44,
1533 0x75, 0xF7, 0xBF, 0x02, 0x43, 0xFF, 0xFA, 0xFF, 0x36, 0x00, 0xDA,
1534 0xFF, 0x0A, 0x00, 0xFD, 0xFF, 0x32, 0x00, 0x46, 0xFF, 0xD1, 0x01,
1535 0x3F, 0xFC, 0x2B, 0x07, 0xCD, 0xF1, 0xAE, 0x2A, 0x86, 0x35, 0xB1,
1536 0xF1, 0x9D, 0x06, 0xCA, 0xFC, 0x6E, 0x01, 0x7B, 0xFF, 0x20, 0x00,
1537 0xFE, 0xFF, 0x02, 0x00, 0x05, 0x00, 0xC3, 0xFF, 0xE0, 0x00, 0xB3,
1538 0xFD, 0x4B, 0x05, 0x4D, 0xF3, 0x45, 0x3D, 0xE0, 0x20, 0x4F, 0xF3,
1539 0xD5, 0x06, 0x3D, 0xFC, 0xE6, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD,
1540 0xFF, 0x13, 0x00, 0xAF, 0xFF, 0xA4, 0x00, 0x19, 0xFF, 0xDD, 0x00,
1541 0xF0, 0xFF, 0xD4, 0xFC, 0xC9, 0x47, 0xD8, 0x0B, 0x7C, 0xF9, 0x35,
1542 0x04, 0x5F, 0xFD, 0x74, 0x01, 0x5E, 0xFF, 0x29, 0x00, 0x00, 0x00,
1543 0x00, 0x00, 0x2C, 0x00, 0x56, 0xFF, 0x87, 0x01, 0x34, 0xFD, 0x8F,
1544 0x04, 0xC0, 0xF8, 0xD9, 0x0D, 0x31, 0x47, 0x7B, 0xFB, 0x9C, 0x00,
1545 0x7D, 0x00, 0x4D, 0xFF, 0x8A, 0x00, 0xB9, 0xFF, 0x11, 0x00, 0xFD,
1546 0xFF, 0x36, 0x00, 0x38, 0xFF, 0xE6, 0x01, 0x35, 0xFC, 0xF7, 0x06,
1547 0xE0, 0xF2, 0x18, 0x23, 0xAB, 0x3B, 0xCC, 0xF2, 0xA8, 0x05, 0x76,
1548 0xFD, 0x04, 0x01, 0xB1, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0xFE, 0xFF,
1549 0x1A, 0x00, 0x89, 0xFF, 0x53, 0x01, 0xF5, 0xFC, 0x63, 0x06, 0xE9,
1550 0xF1, 0x63, 0x37, 0x85, 0x28, 0x09, 0xF2, 0x27, 0x07, 0x35, 0xFC,
1551 0xDA, 0x01, 0x40, 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0x0C, 0x00, 0xD1,
1552 0xFF, 0x4E, 0x00, 0xCA, 0xFF, 0x9A, 0xFF, 0x2A, 0x02, 0x83, 0xF8,
1553 0x3F, 0x45, 0xFB, 0x12, 0x01, 0xF7, 0x5D, 0x05, 0xD3, 0xFC, 0xB1,
1554 0x01, 0x46, 0xFF, 0x31, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x23, 0x00,
1555 0x73, 0xFF, 0x3F, 0x01, 0xD3, 0xFD, 0x4C, 0x03, 0x54, 0xFB, 0x1F,
1556 0x07, 0xBB, 0x48, 0x7D, 0x00, 0x33, 0xFE, 0xCF, 0x01, 0x98, 0xFE,
1557 0xE2, 0x00, 0x97, 0xFF, 0x19, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x38,
1558 0xFF, 0xDC, 0x01, 0x64, 0xFC, 0x62, 0x06, 0x93, 0xF4, 0x66, 0x1B,
1559 0xD9, 0x40, 0xEA, 0xF4, 0x3E, 0x04, 0x5D, 0xFE, 0x7D, 0x00, 0xF5,
1560 0xFF, 0xF3, 0xFF, 0x05, 0x00, 0xFD, 0xFF, 0x2A, 0x00, 0x5E, 0xFF,
1561 0xA6, 0x01, 0x76, 0xFC, 0x01, 0x07, 0x7D, 0xF1, 0xAD, 0x30, 0xDC,
1562 0x2F, 0x7F, 0xF1, 0x0C, 0x07, 0x6C, 0xFC, 0xAD, 0x01, 0x5A, 0xFF,
1563 0x2B, 0x00, 0xFD, 0xFF, 0x05, 0x00, 0xEF, 0xFF, 0xFE, 0xFF, 0x6C,
1564 0x00, 0x7B, 0xFE, 0x0C, 0x04, 0x3A, 0xF5, 0x5F, 0x41, 0x83, 0x1A,
1565 0xCD, 0xF4, 0x4B, 0x06, 0x6D, 0xFC, 0xD9, 0x01, 0x39, 0xFF, 0x35,
1566 0x00, 0xFE, 0xFF, 0x1A, 0x00, 0x93, 0xFF, 0xEC, 0x00, 0x83, 0xFE,
1567 0xF7, 0x01, 0xE8, 0xFD, 0x21, 0x01, 0xD2, 0x48, 0x64, 0x06, 0xA1,
1568 0xFB, 0x26, 0x03, 0xE7, 0xFD, 0x35, 0x01, 0x76, 0xFF, 0x22, 0x00,
1569 0x00, 0x00, 0xFF, 0xFF, 0x31, 0x00, 0x44, 0xFF, 0xB7, 0x01, 0xC5,
1570 0xFC, 0x7C, 0x05, 0xBC, 0xF6, 0xD5, 0x13, 0xDC, 0x44, 0x14, 0xF8,
1571 0x67, 0x02, 0x77, 0xFF, 0xDD, 0xFF, 0x44, 0x00, 0xD5, 0xFF, 0x0B,
1572 0x00, 0xFD, 0xFF, 0x33, 0x00, 0x42, 0xFF, 0xD7, 0x01, 0x39, 0xFC,
1573 0x29, 0x07, 0xEF, 0xF1, 0x62, 0x29, 0xA5, 0x36, 0xD0, 0xF1, 0x7B,
1574 0x06, 0xE3, 0xFC, 0x5E, 0x01, 0x83, 0xFF, 0x1D, 0x00, 0xFE, 0xFF,
1575 0x01, 0x00, 0x09, 0x00, 0xB8, 0xFF, 0xF6, 0x00, 0x8D, 0xFD, 0x84,
1576 0x05, 0xFD, 0xF2, 0x52, 0x3C, 0x35, 0x22, 0x0B, 0xF3, 0xEB, 0x06,
1577 0x37, 0xFC, 0xE6, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x12,
1578 0x00, 0xB5, 0xFF, 0x94, 0x00, 0x39, 0xFF, 0xA3, 0x00, 0x58, 0x00,
1579 0x02, 0xFC, 0x73, 0x47, 0x0B, 0x0D, 0x0B, 0xF9, 0x6C, 0x04, 0x45,
1580 0xFD, 0x80, 0x01, 0x59, 0xFF, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00,
1581 0x2A, 0x00, 0x5B, 0xFF, 0x7C, 0x01, 0x4E, 0xFD, 0x5A, 0x04, 0x31,
1582 0xF9, 0xA4, 0x0C, 0x90, 0x47, 0x47, 0xFC, 0x36, 0x00, 0xB6, 0x00,
1583 0x2E, 0xFF, 0x99, 0x00, 0xB3, 0xFF, 0x12, 0x00, 0xFD, 0xFF, 0x36,
1584 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x39, 0xFC, 0xE4, 0x06, 0x21, 0xF3,
1585 0xC4, 0x21, 0xA5, 0x3C, 0x16, 0xF3, 0x72, 0x05, 0x9A, 0xFD, 0xEF,
1586 0x00, 0xBC, 0xFF, 0x08, 0x00, 0x01, 0x00, 0xFE, 0xFF, 0x1E, 0x00,
1587 0x80, 0xFF, 0x64, 0x01, 0xDA, 0xFC, 0x87, 0x06, 0xC5, 0xF1, 0x46,
1588 0x36, 0xD1, 0x29, 0xE3, 0xF1, 0x2A, 0x07, 0x3A, 0xFC, 0xD5, 0x01,
1589 0x44, 0xFF, 0x32, 0x00, 0xFD, 0xFF, 0x0A, 0x00, 0xD6, 0xFF, 0x3F,
1590 0x00, 0xE7, 0xFF, 0x65, 0xFF, 0x85, 0x02, 0xDE, 0xF7, 0xA9, 0x44,
1591 0x43, 0x14, 0x99, 0xF6, 0x8B, 0x05, 0xBF, 0xFC, 0xBA, 0x01, 0x43,
1592 0xFF, 0x32, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x22, 0x00, 0x78, 0xFF,
1593 0x31, 0x01, 0xF1, 0xFD, 0x12, 0x03, 0xC7, 0xFB, 0x07, 0x06, 0xDB,
1594 0x48, 0x73, 0x01, 0xC3, 0xFD, 0x0A, 0x02, 0x79, 0xFE, 0xF1, 0x00,
1595 0x91, 0xFF, 0x1B, 0x00, 0xFE, 0xFF, 0x35, 0x00, 0x39, 0xFF, 0xD7,
1596 0x01, 0x72, 0xFC, 0x3F, 0x06, 0xEB, 0xF4, 0x12, 0x1A, 0xA1, 0x41,
1597 0x63, 0xF5, 0xF3, 0x03, 0x8A, 0xFE, 0x63, 0x00, 0x02, 0x00, 0xEE,
1598 0xFF, 0x06, 0x00, 0xFD, 0xFF, 0x2C, 0x00, 0x58, 0xFF, 0xB1, 0x01,
1599 0x67, 0xFC, 0x10, 0x07, 0x81, 0xF1, 0x73, 0x2F, 0x15, 0x31, 0x7C,
1600 0xF1, 0xFB, 0x06, 0x7C, 0xFC, 0xA2, 0x01, 0x60, 0xFF, 0x29, 0x00,
1601 0xFD, 0xFF, 0x04, 0x00, 0xF4, 0xFF, 0xF1, 0xFF, 0x85, 0x00, 0x4E,
1602 0xFE, 0x56, 0x04, 0xC3, 0xF4, 0x95, 0x40, 0xD8, 0x1B, 0x76, 0xF4,
1603 0x6D, 0x06, 0x60, 0xFC, 0xDD, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFE,
1604 0xFF, 0x19, 0x00, 0x99, 0xFF, 0xDD, 0x00, 0xA3, 0xFE, 0xBB, 0x01,
1605 0x58, 0xFE, 0x2D, 0x00, 0xAF, 0x48, 0x7E, 0x07, 0x2E, 0xFB, 0x60,
1606 0x03, 0xC9, 0xFD, 0x43, 0x01, 0x71, 0xFF, 0x24, 0x00, 0x00, 0x00,
1607 0xFF, 0xFF, 0x30, 0x00, 0x48, 0xFF, 0xAE, 0x01, 0xDB, 0xFC, 0x4D,
1608 0x05, 0x24, 0xF7, 0x8E, 0x12, 0x6D, 0x45, 0xBC, 0xF8, 0x0C, 0x02,
1609 0xAC, 0xFF, 0xC0, 0xFF, 0x52, 0x00, 0xCF, 0xFF, 0x0C, 0x00, 0xFD,
1610 0xFF, 0x34, 0x00, 0x3F, 0xFF, 0xDC, 0x01, 0x34, 0xFC, 0x25, 0x07,
1611 0x18, 0xF2, 0x15, 0x28, 0xBF, 0x37, 0xF7, 0xF1, 0x56, 0x06, 0xFE,
1612 0xFC, 0x4D, 0x01, 0x8C, 0xFF, 0x19, 0x00, 0xFF, 0xFF, 0x00, 0x00,
1613 0x0D, 0x00, 0xAE, 0xFF, 0x0B, 0x01, 0x6A, 0xFD, 0xBA, 0x05, 0xB4,
1614 0xF2, 0x58, 0x3B, 0x8A, 0x23, 0xCB, 0xF2, 0xFD, 0x06, 0x34, 0xFC,
1615 0xE6, 0x01, 0x38, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x10, 0x00, 0xBB,
1616 0xFF, 0x85, 0x00, 0x58, 0xFF, 0x6A, 0x00, 0xBE, 0x00, 0x38, 0xFB,
1617 0x0F, 0x47, 0x42, 0x0E, 0x9B, 0xF8, 0xA1, 0x04, 0x2B, 0xFD, 0x8B,
1618 0x01, 0x55, 0xFF, 0x2C, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x29, 0x00,
1619 0x5F, 0xFF, 0x70, 0x01, 0x68, 0xFD, 0x23, 0x04, 0xA2, 0xF9, 0x73,
1620 0x0B, 0xE4, 0x47, 0x1B, 0xFD, 0xCD, 0xFF, 0xF0, 0x00, 0x0F, 0xFF,
1621 0xA9, 0x00, 0xAE, 0xFF, 0x14, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36,
1622 0xFF, 0xE6, 0x01, 0x3F, 0xFC, 0xCE, 0x06, 0x66, 0xF3, 0x6F, 0x20,
1623 0x96, 0x3D, 0x69, 0xF3, 0x38, 0x05, 0xBF, 0xFD, 0xD9, 0x00, 0xC7,
1624 0xFF, 0x04, 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x20, 0x00, 0x78, 0xFF,
1625 0x74, 0x01, 0xC2, 0xFC, 0xA7, 0x06, 0xA8, 0xF1, 0x25, 0x35, 0x1B,
1626 0x2B, 0xC2, 0xF1, 0x2A, 0x07, 0x41, 0xFC, 0xCE, 0x01, 0x47, 0xFF,
1627 0x31, 0x00, 0xFD, 0xFF, 0x09, 0x00, 0xDC, 0xFF, 0x31, 0x00, 0x04,
1628 0x00, 0x32, 0xFF, 0xDC, 0x02, 0x42, 0xF7, 0x0B, 0x44, 0x8E, 0x15,
1629 0x34, 0xF6, 0xB7, 0x05, 0xAB, 0xFC, 0xC1, 0x01, 0x40, 0xFF, 0x33,
1630 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x20, 0x00, 0x7E, 0xFF, 0x23, 0x01,
1631 0x0F, 0xFE, 0xD7, 0x02, 0x3B, 0xFC, 0xF5, 0x04, 0xED, 0x48, 0x70,
1632 0x02, 0x52, 0xFD, 0x46, 0x02, 0x5A, 0xFE, 0xFF, 0x00, 0x8B, 0xFF,
1633 0x1C, 0x00, 0xFE, 0xFF, 0x35, 0x00, 0x3B, 0xFF, 0xD2, 0x01, 0x81,
1634 0xFC, 0x1A, 0x06, 0x47, 0xF5, 0xC1, 0x18, 0x60, 0x42, 0xE4, 0xF5,
1635 0xA6, 0x03, 0xB9, 0xFE, 0x48, 0x00, 0x0F, 0x00, 0xE9, 0xFF, 0x07,
1636 0x00, 0xFD, 0xFF, 0x2E, 0x00, 0x53, 0xFF, 0xBB, 0x01, 0x5A, 0xFC,
1637 0x1C, 0x07, 0x8D, 0xF1, 0x34, 0x2E, 0x48, 0x32, 0x81, 0xF1, 0xE7,
1638 0x06, 0x8E, 0xFC, 0x96, 0x01, 0x66, 0xFF, 0x27, 0x00, 0xFD, 0xFF,
1639 0x04, 0x00, 0xF9, 0xFF, 0xE4, 0xFF, 0x9F, 0x00, 0x23, 0xFE, 0x9B,
1640 0x04, 0x55, 0xF4, 0xC0, 0x3F, 0x2C, 0x1D, 0x22, 0xF4, 0x8C, 0x06,
1641 0x55, 0xFC, 0xE1, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x17,
1642 0x00, 0x9F, 0xFF, 0xCE, 0x00, 0xC2, 0xFE, 0x80, 0x01, 0xC6, 0xFE,
1643 0x40, 0xFF, 0x81, 0x48, 0x9E, 0x08, 0xBA, 0xFA, 0x9A, 0x03, 0xAC,
1644 0xFD, 0x51, 0x01, 0x6C, 0xFF, 0x25, 0x00, 0x00, 0x00, 0xFF, 0xFF,
1645 0x2F, 0x00, 0x4B, 0xFF, 0xA4, 0x01, 0xF1, 0xFC, 0x1D, 0x05, 0x8F,
1646 0xF7, 0x4A, 0x11, 0xF2, 0x45, 0x6B, 0xF9, 0xAE, 0x01, 0xE2, 0xFF,
1647 0xA2, 0xFF, 0x61, 0x00, 0xC9, 0xFF, 0x0D, 0x00, 0xFD, 0xFF, 0x35,
1648 0x00, 0x3D, 0xFF, 0xE0, 0x01, 0x32, 0xFC, 0x1D, 0x07, 0x45, 0xF2,
1649 0xC6, 0x26, 0xD3, 0x38, 0x24, 0xF2, 0x2D, 0x06, 0x1B, 0xFD, 0x3B,
1650 0x01, 0x95, 0xFF, 0x16, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x11, 0x00,
1651 0xA3, 0xFF, 0x20, 0x01, 0x49, 0xFD, 0xEB, 0x05, 0x74, 0xF2, 0x54,
1652 0x3A, 0xDD, 0x24, 0x91, 0xF2, 0x0C, 0x07, 0x32, 0xFC, 0xE4, 0x01,
1653 0x3A, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x0F, 0x00, 0xC1, 0xFF, 0x76,
1654 0x00, 0x76, 0xFF, 0x32, 0x00, 0x22, 0x01, 0x76, 0xFA, 0xA3, 0x46,
1655 0x7D, 0x0F, 0x2C, 0xF8, 0xD5, 0x04, 0x13, 0xFD, 0x96, 0x01, 0x51,
1656 0xFF, 0x2D, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x27, 0x00, 0x64, 0xFF,
1657 0x63, 0x01, 0x84, 0xFD, 0xEB, 0x03, 0x14, 0xFA, 0x47, 0x0A, 0x2C,
1658 0x48, 0xF6, 0xFD, 0x63, 0xFF, 0x2B, 0x01, 0xF0, 0xFE, 0xB8, 0x00,
1659 0xA8, 0xFF, 0x15, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE4,
1660 0x01, 0x47, 0xFC, 0xB5, 0x06, 0xB0, 0xF3, 0x19, 0x1F, 0x7E, 0x3E,
1661 0xC4, 0xF3, 0xFA, 0x04, 0xE7, 0xFD, 0xC1, 0x00, 0xD3, 0xFF, 0xFF,
1662 0xFF, 0x02, 0x00, 0xFE, 0xFF, 0x23, 0x00, 0x71, 0xFF, 0x82, 0x01,
1663 0xAB, 0xFC, 0xC4, 0x06, 0x93, 0xF1, 0xFD, 0x33, 0x62, 0x2C, 0xA8,
1664 0xF1, 0x27, 0x07, 0x4A, 0xFC, 0xC7, 0x01, 0x4C, 0xFF, 0x30, 0x00,
1665 0xFD, 0xFF, 0x08, 0x00, 0xE1, 0xFF, 0x23, 0x00, 0x20, 0x00, 0x00,
1666 0xFF, 0x31, 0x03, 0xAD, 0xF6, 0x65, 0x43, 0xDC, 0x16, 0xD1, 0xF5,
1667 0xE1, 0x05, 0x99, 0xFC, 0xC9, 0x01, 0x3E, 0xFF, 0x33, 0x00, 0xFF,
1668 0xFF, 0x00, 0x00, 0x1F, 0x00, 0x83, 0xFF, 0x14, 0x01, 0x2D, 0xFE,
1669 0x9C, 0x02, 0xAD, 0xFC, 0xE9, 0x03, 0xF6, 0x48, 0x73, 0x03, 0xE0,
1670 0xFC, 0x82, 0x02, 0x3B, 0xFE, 0x0E, 0x01, 0x86, 0xFF, 0x1E, 0x00,
1671 0xFE, 0xFF, 0x34, 0x00, 0x3D, 0xFF, 0xCC, 0x01, 0x91, 0xFC, 0xF3,
1672 0x05, 0xA6, 0xF5, 0x70, 0x17, 0x17, 0x43, 0x6D, 0xF6, 0x56, 0x03,
1673 0xEA, 0xFE, 0x2D, 0x00, 0x1D, 0x00, 0xE4, 0xFF, 0x08, 0x00, 0xFD,
1674 0xFF, 0x2F, 0x00, 0x4E, 0xFF, 0xC3, 0x01, 0x4E, 0xFC, 0x24, 0x07,
1675 0x9E, 0xF1, 0xF2, 0x2C, 0x78, 0x33, 0x8C, 0xF1, 0xD0, 0x06, 0xA2,
1676 0xFC, 0x88, 0x01, 0x6D, 0xFF, 0x24, 0x00, 0xFD, 0xFF, 0x03, 0x00,
1677 0xFD, 0xFF, 0xD8, 0xFF, 0xB7, 0x00, 0xF9, 0xFD, 0xDE, 0x04, 0xEF,
1678 0xF3, 0xE4, 0x3E, 0x81, 0x1E, 0xD2, 0xF3, 0xA9, 0x06, 0x4B, 0xFC,
1679 0xE3, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x16, 0x00, 0xA5,
1680 0xFF, 0xBE, 0x00, 0xE2, 0xFE, 0x45, 0x01, 0x33, 0xFF, 0x5A, 0xFE,
1681 0x48, 0x48, 0xC3, 0x09, 0x47, 0xFA, 0xD2, 0x03, 0x90, 0xFD, 0x5E,
1682 0x01, 0x66, 0xFF, 0x27, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2E, 0x00,
1683 0x4F, 0xFF, 0x9A, 0x01, 0x08, 0xFD, 0xEB, 0x04, 0xFC, 0xF7, 0x0A,
1684 0x10, 0x70, 0x46, 0x22, 0xFA, 0x4D, 0x01, 0x19, 0x00, 0x84, 0xFF,
1685 0x70, 0x00, 0xC4, 0xFF, 0x0F, 0x00, 0xFD, 0xFF, 0x35, 0x00, 0x3B,
1686 0xFF, 0xE3, 0x01, 0x31, 0xFC, 0x12, 0x07, 0x79, 0xF2, 0x73, 0x25,
1687 0xDF, 0x39, 0x5A, 0xF2, 0x00, 0x06, 0x3A, 0xFD, 0x28, 0x01, 0x9F,
1688 0xFF, 0x13, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x15, 0x00, 0x99, 0xFF,
1689 0x33, 0x01, 0x29, 0xFD, 0x1A, 0x06, 0x3B, 0xF2, 0x4B, 0x39, 0x30,
1690 0x26, 0x5B, 0xF2, 0x19, 0x07, 0x31, 0xFC, 0xE1, 0x01, 0x3C, 0xFF,
1691 0x35, 0x00, 0xFD, 0xFF, 0x0E, 0x00, 0xC7, 0xFF, 0x68, 0x00, 0x95,
1692 0xFF, 0xFA, 0xFF, 0x83, 0x01, 0xBB, 0xF9, 0x2B, 0x46, 0xBB, 0x10,
1693 0xBF, 0xF7, 0x07, 0x05, 0xFB, 0xFC, 0xA0, 0x01, 0x4D, 0xFF, 0x2F,
1694 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x26, 0x00, 0x69, 0xFF, 0x56, 0x01,
1695 0xA0, 0xFD, 0xB3, 0x03, 0x87, 0xFA, 0x1F, 0x09, 0x6A, 0x48, 0xD9,
1696 0xFE, 0xF6, 0xFE, 0x65, 0x01, 0xD0, 0xFE, 0xC7, 0x00, 0xA2, 0xFF,
1697 0x17, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE2, 0x01, 0x50,
1698 0xFC, 0x99, 0x06, 0xFE, 0xF3, 0xC3, 0x1D, 0x5E, 0x3F, 0x27, 0xF4,
1699 0xB9, 0x04, 0x10, 0xFE, 0xA9, 0x00, 0xDF, 0xFF, 0xFB, 0xFF, 0x03,
1700 0x00, 0xFD, 0xFF, 0x26, 0x00, 0x69, 0xFF, 0x90, 0x01, 0x96, 0xFC,
1701 0xDD, 0x06, 0x85, 0xF1, 0xD0, 0x32, 0xA6, 0x2D, 0x94, 0xF1, 0x20,
1702 0x07, 0x54, 0xFC, 0xBF, 0x01, 0x50, 0xFF, 0x2E, 0x00, 0xFD, 0xFF,
1703 0x07, 0x00, 0xE6, 0xFF, 0x15, 0x00, 0x3C, 0x00, 0xCF, 0xFE, 0x83,
1704 0x03, 0x20, 0xF6, 0xB2, 0x42, 0x2B, 0x18, 0x71, 0xF5, 0x09, 0x06,
1705 0x88, 0xFC, 0xCF, 0x01, 0x3C, 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0x1D,
1706 0x00, 0x89, 0xFF, 0x06, 0x01, 0x4C, 0xFE, 0x60, 0x02, 0x1F, 0xFD,
1707 0xE2, 0x02, 0xF3, 0x48, 0x7D, 0x04, 0x6E, 0xFC, 0xBD, 0x02, 0x1C,
1708 0xFE, 0x1C, 0x01, 0x80, 0xFF, 0x20, 0x00, 0x00, 0x00, 0xFF, 0xFF,
1709 0x33, 0x00, 0x3F, 0xFF, 0xC5, 0x01, 0xA3, 0xFC, 0xCA, 0x05, 0x07,
1710 0xF6, 0x22, 0x16, 0xC3, 0x43, 0xFE, 0xF6, 0x02, 0x03, 0x1B, 0xFF,
1711 0x11, 0x00, 0x2B, 0x00, 0xDE, 0xFF, 0x09, 0x00, 0xFD, 0xFF, 0x31,
1712 0x00, 0x49, 0xFF, 0xCB, 0x01, 0x45, 0xFC, 0x29, 0x07, 0xB6, 0xF1,
1713 0xAD, 0x2B, 0xA2, 0x34, 0x9E, 0xF1, 0xB4, 0x06, 0xB8, 0xFC, 0x7A,
1714 0x01, 0x75, 0xFF, 0x22, 0x00, 0xFE, 0xFF, 0x02, 0x00, 0x02, 0x00,
1715 0xCC, 0xFF, 0xCE, 0x00, 0xD1, 0xFD, 0x1D, 0x05, 0x91, 0xF3, 0xFE,
1716 0x3D, 0xD7, 0x1F, 0x87, 0xF3, 0xC3, 0x06, 0x42, 0xFC, 0xE5, 0x01,
1717 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x14, 0x00, 0xAB, 0xFF, 0xAF,
1718 0x00, 0x01, 0xFF, 0x0A, 0x01, 0x9E, 0xFF, 0x7C, 0xFD, 0x03, 0x48,
1719 0xED, 0x0A, 0xD5, 0xF9, 0x0A, 0x04, 0x74, 0xFD, 0x6A, 0x01, 0x62,
1720 0xFF, 0x28, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x2D, 0x00, 0x53, 0xFF,
1721 0x90, 0x01, 0x20, 0xFD, 0xB8, 0x04, 0x6A, 0xF8, 0xCD, 0x0E, 0xE1,
1722 0x46, 0xE1, 0xFA, 0xEB, 0x00, 0x51, 0x00, 0x65, 0xFF, 0x7F, 0x00,
1723 0xBE, 0xFF, 0x10, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x39, 0xFF, 0xE5,
1724 0x01, 0x33, 0xFC, 0x04, 0x07, 0xB1, 0xF2, 0x21, 0x24, 0xE6, 0x3A,
1725 0x97, 0xF2, 0xD0, 0x05, 0x5B, 0xFD, 0x15, 0x01, 0xA9, 0xFF, 0x0F,
1726 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x18, 0x00, 0x90, 0xFF, 0x45, 0x01,
1727 0x0B, 0xFD, 0x44, 0x06, 0x0A, 0xF2, 0x3B, 0x38, 0x80, 0x27, 0x2B,
1728 0xF2, 0x22, 0x07, 0x33, 0xFC, 0xDE, 0x01, 0x3E, 0xFF, 0x34, 0x00,
1729 0xFD, 0xFF, 0x0D, 0x00, 0xCD, 0xFF, 0x59, 0x00, 0xB3, 0xFF, 0xC4,
1730 0xFF, 0xE2, 0x01, 0x09, 0xF9, 0xAA, 0x45, 0xFE, 0x11, 0x54, 0xF7,
1731 0x38, 0x05, 0xE4, 0xFC, 0xAA, 0x01, 0x49, 0xFF, 0x30, 0x00, 0xFF,
1732 0xFF, 0x00, 0x00, 0x24, 0x00, 0x6E, 0xFF, 0x49, 0x01, 0xBC, 0xFD,
1733 0x7A, 0x03, 0xFA, 0xFA, 0xFD, 0x07, 0x9C, 0x48, 0xC3, 0xFF, 0x89,
1734 0xFE, 0xA1, 0x01, 0xB1, 0xFE, 0xD6, 0x00, 0x9C, 0xFF, 0x18, 0x00,
1735 0xFE, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xDF, 0x01, 0x5B, 0xFC, 0x7B,
1736 0x06, 0x50, 0xF4, 0x6E, 0x1C, 0x36, 0x40, 0x92, 0xF4, 0x75, 0x04,
1737 0x3B, 0xFE, 0x91, 0x00, 0xEB, 0xFF, 0xF6, 0xFF, 0x04, 0x00, 0xFD,
1738 0xFF, 0x28, 0x00, 0x63, 0xFF, 0x9D, 0x01, 0x84, 0xFC, 0xF3, 0x06,
1739 0x7D, 0xF1, 0x9E, 0x31, 0xE6, 0x2E, 0x85, 0xF1, 0x16, 0x07, 0x61,
1740 0xFC, 0xB5, 0x01, 0x55, 0xFF, 0x2D, 0x00, 0xFD, 0xFF, 0x06, 0x00,
1741 0xEC, 0xFF, 0x08, 0x00, 0x57, 0x00, 0x9F, 0xFE, 0xD1, 0x03, 0x9B,
1742 0xF5, 0xF7, 0x41, 0x7C, 0x19, 0x13, 0xF5, 0x2F, 0x06, 0x78, 0xFC,
1743 0xD5, 0x01, 0x3A, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x1C, 0x00, 0x8F,
1744 0xFF, 0xF7, 0x00, 0x6B, 0xFE, 0x25, 0x02, 0x91, 0xFD, 0xE3, 0x01,
1745 0xE5, 0x48, 0x8D, 0x05, 0xFB, 0xFB, 0xF8, 0x02, 0xFE, 0xFD, 0x2B,
1746 0x01, 0x7A, 0xFF, 0x21, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x32, 0x00,
1747 0x42, 0xFF, 0xBD, 0x01, 0xB6, 0xFC, 0x9F, 0x05, 0x6C, 0xF6, 0xD6,
1748 0x14, 0x65, 0x44, 0x98, 0xF7, 0xAC, 0x02, 0x4E, 0xFF, 0xF4, 0xFF,
1749 0x39, 0x00, 0xD9, 0xFF, 0x0A, 0x00, 0xFD, 0xFF, 0x32, 0x00, 0x45,
1750 0xFF, 0xD2, 0x01, 0x3D, 0xFC, 0x2B, 0x07, 0xD4, 0xF1, 0x64, 0x2A,
1751 0xC6, 0x35, 0xB7, 0xF1, 0x96, 0x06, 0xCF, 0xFC, 0x6B, 0x01, 0x7D,
1752 0xFF, 0x1F, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x06, 0x00, 0xC1, 0xFF,
1753 0xE5, 0x00, 0xAA, 0xFD, 0x58, 0x05, 0x3A, 0xF3, 0x11, 0x3D, 0x2C,
1754 0x21, 0x3F, 0xF3, 0xDA, 0x06, 0x3B, 0xFC, 0xE6, 0x01, 0x36, 0xFF,
1755 0x36, 0x00, 0xFD, 0xFF, 0x13, 0x00, 0xB1, 0xFF, 0xA0, 0x00, 0x20,
1756 0xFF, 0xD0, 0x00, 0x07, 0x00, 0xA4, 0xFC, 0xB6, 0x47, 0x1C, 0x0C,
1757 0x63, 0xF9, 0x42, 0x04, 0x59, 0xFD, 0x76, 0x01, 0x5D, 0xFF, 0x2A,
1758 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x57, 0xFF, 0x85, 0x01,
1759 0x39, 0xFD, 0x84, 0x04, 0xD9, 0xF8, 0x95, 0x0D, 0x48, 0x47, 0xA7,
1760 0xFB, 0x86, 0x00, 0x8A, 0x00, 0x46, 0xFF, 0x8E, 0x00, 0xB8, 0xFF,
1761 0x11, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x35,
1762 0xFC, 0xF3, 0x06, 0xEE, 0xF2, 0xCD, 0x22, 0xE4, 0x3B, 0xDC, 0xF2,
1763 0x9C, 0x05, 0x7E, 0xFD, 0x00, 0x01, 0xB4, 0xFF, 0x0B, 0x00, 0x01,
1764 0x00, 0xFE, 0xFF, 0x1B, 0x00, 0x87, 0xFF, 0x57, 0x01, 0xEF, 0xFC,
1765 0x6B, 0x06, 0xE0, 0xF1, 0x23, 0x37, 0xCE, 0x28, 0x01, 0xF2, 0x28,
1766 0x07, 0x36, 0xFC, 0xD9, 0x01, 0x41, 0xFF, 0x33, 0x00, 0xFD, 0xFF,
1767 0x0B, 0x00, 0xD2, 0xFF, 0x4A, 0x00, 0xD0, 0xFF, 0x8E, 0xFF, 0x3F,
1768 0x02, 0x5E, 0xF8, 0x1E, 0x45, 0x44, 0x13, 0xEA, 0xF6, 0x67, 0x05,
1769 0xCF, 0xFC, 0xB3, 0x01, 0x46, 0xFF, 0x31, 0x00, 0xFF, 0xFF, 0x00,
1770 0x00, 0x23, 0x00, 0x74, 0xFF, 0x3C, 0x01, 0xDA, 0xFD, 0x40, 0x03,
1771 0x6E, 0xFB, 0xE1, 0x06, 0xC3, 0x48, 0xB3, 0x00, 0x1A, 0xFE, 0xDC,
1772 0x01, 0x91, 0xFE, 0xE5, 0x00, 0x96, 0xFF, 0x1A, 0x00, 0xFE, 0xFF,
1773 0x36, 0x00, 0x38, 0xFF, 0xDB, 0x01, 0x67, 0xFC, 0x5A, 0x06, 0xA6,
1774 0xF4, 0x1B, 0x1B, 0x07, 0x41, 0x04, 0xF5, 0x2D, 0x04, 0x67, 0xFE,
1775 0x77, 0x00, 0xF8, 0xFF, 0xF2, 0xFF, 0x05, 0x00, 0xFD, 0xFF, 0x2A,
1776 0x00, 0x5C, 0xFF, 0xA8, 0x01, 0x73, 0xFC, 0x05, 0x07, 0x7D, 0xF1,
1777 0x67, 0x30, 0x21, 0x30, 0x7E, 0xF1, 0x08, 0x07, 0x6F, 0xFC, 0xAB,
1778 0x01, 0x5B, 0xFF, 0x2B, 0x00, 0xFD, 0xFF, 0x05, 0x00, 0xF0, 0xFF,
1779 0xFB, 0xFF, 0x71, 0x00, 0x71, 0xFE, 0x1D, 0x04, 0x1F, 0xF5, 0x32,
1780 0x41, 0xCE, 0x1A, 0xBA, 0xF4, 0x53, 0x06, 0x6A, 0xFC, 0xDA, 0x01,
1781 0x38, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x1A, 0x00, 0x95, 0xFF, 0xE8,
1782 0x00, 0x8A, 0xFE, 0xE9, 0x01, 0x01, 0xFE, 0xEA, 0x00, 0xCB, 0x48,
1783 0xA2, 0x06, 0x87, 0xFB, 0x33, 0x03, 0xE0, 0xFD, 0x39, 0x01, 0x75,
1784 0xFF, 0x23, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x31, 0x00, 0x45, 0xFF,
1785 0xB5, 0x01, 0xCA, 0xFC, 0x72, 0x05, 0xD3, 0xF6, 0x8D, 0x13, 0xFD,
1786 0x44, 0x39, 0xF8, 0x53, 0x02, 0x82, 0xFF, 0xD7, 0xFF, 0x47, 0x00,
1787 0xD3, 0xFF, 0x0B, 0x00, 0xFD, 0xFF, 0x33, 0x00, 0x42, 0xFF, 0xD8,
1788 0x01, 0x37, 0xFC, 0x29, 0x07, 0xF8, 0xF1, 0x19, 0x29, 0xE5, 0x36,
1789 0xD8, 0xF1, 0x73, 0x06, 0xE9, 0xFC, 0x5B, 0x01, 0x85, 0xFF, 0x1C,
1790 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x0A, 0x00, 0xB6, 0xFF, 0xFB, 0x00,
1791 0x85, 0xFD, 0x90, 0x05, 0xEC, 0xF2, 0x1C, 0x3C, 0x81, 0x22, 0xFC,
1792 0xF2, 0xEF, 0x06, 0x36, 0xFC, 0xE6, 0x01, 0x37, 0xFF, 0x36, 0x00,
1793 0xFD, 0xFF, 0x12, 0x00, 0xB7, 0xFF, 0x91, 0x00, 0x40, 0xFF, 0x96,
1794 0x00, 0x6F, 0x00, 0xD5, 0xFB, 0x5E, 0x47, 0x50, 0x0D, 0xF2, 0xF8,
1795 0x78, 0x04, 0x3F, 0xFD, 0x82, 0x01, 0x58, 0xFF, 0x2B, 0x00, 0x00,
1796 0x00, 0x00, 0x00, 0x2A, 0x00, 0x5C, 0xFF, 0x79, 0x01, 0x53, 0xFD,
1797 0x4E, 0x04, 0x4A, 0xF9, 0x60, 0x0C, 0xA3, 0x47, 0x76, 0xFC, 0x1F,
1798 0x00, 0xC3, 0x00, 0x27, 0xFF, 0x9D, 0x00, 0xB2, 0xFF, 0x13, 0x00,
1799 0xFD, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x3A, 0xFC, 0xDF,
1800 0x06, 0x30, 0xF3, 0x78, 0x21, 0xDB, 0x3C, 0x28, 0xF3, 0x65, 0x05,
1801 0xA2, 0xFD, 0xEA, 0x00, 0xBE, 0xFF, 0x07, 0x00, 0x01, 0x00, 0xFE,
1802 0xFF, 0x1E, 0x00, 0x7F, 0xFF, 0x67, 0x01, 0xD5, 0xFC, 0x8E, 0x06,
1803 0xBE, 0xF1, 0x06, 0x36, 0x1A, 0x2A, 0xDC, 0xF1, 0x2A, 0x07, 0x3C,
1804 0xFC, 0xD3, 0x01, 0x44, 0xFF, 0x32, 0x00, 0xFD, 0xFF, 0x0A, 0x00,
1805 0xD8, 0xFF, 0x3C, 0x00, 0xEE, 0xFF, 0x5A, 0xFF, 0x98, 0x02, 0xBB,
1806 0xF7, 0x87, 0x44, 0x8C, 0x14, 0x83, 0xF6, 0x95, 0x05, 0xBA, 0xFC,
1807 0xBB, 0x01, 0x43, 0xFF, 0x32, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x21,
1808 0x00, 0x79, 0xFF, 0x2E, 0x01, 0xF7, 0xFD, 0x05, 0x03, 0xE1, 0xFB,
1809 0xCA, 0x05, 0xDF, 0x48, 0xAB, 0x01, 0xAA, 0xFD, 0x18, 0x02, 0x72,
1810 0xFE, 0xF4, 0x00, 0x90, 0xFF, 0x1B, 0x00, 0xFE, 0xFF, 0x35, 0x00,
1811 0x39, 0xFF, 0xD6, 0x01, 0x75, 0xFC, 0x37, 0x06, 0xFF, 0xF4, 0xC7,
1812 0x19, 0xCC, 0x41, 0x7F, 0xF5, 0xE2, 0x03, 0x95, 0xFE, 0x5D, 0x00,
1813 0x05, 0x00, 0xED, 0xFF, 0x06, 0x00, 0xFD, 0xFF, 0x2C, 0x00, 0x57,
1814 0xFF, 0xB3, 0x01, 0x64, 0xFC, 0x13, 0x07, 0x83, 0xF1, 0x2C, 0x2F,
1815 0x5A, 0x31, 0x7D, 0xF1, 0xF7, 0x06, 0x80, 0xFC, 0x9F, 0x01, 0x61,
1816 0xFF, 0x29, 0x00, 0xFD, 0xFF, 0x04, 0x00, 0xF5, 0xFF, 0xEE, 0xFF,
1817 0x8B, 0x00, 0x44, 0xFE, 0x65, 0x04, 0xAA, 0xF4, 0x66, 0x40, 0x23,
1818 0x1C, 0x63, 0xF4, 0x74, 0x06, 0x5D, 0xFC, 0xDE, 0x01, 0x37, 0xFF,
1819 0x36, 0x00, 0xFE, 0xFF, 0x19, 0x00, 0x9A, 0xFF, 0xD9, 0x00, 0xAA,
1820 0xFE, 0xAE, 0x01, 0x70, 0xFE, 0xF8, 0xFF, 0xA6, 0x48, 0xBE, 0x07,
1821 0x14, 0xFB, 0x6D, 0x03, 0xC3, 0xFD, 0x46, 0x01, 0x70, 0xFF, 0x24,
1822 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x30, 0x00, 0x48, 0xFF, 0xAC, 0x01,
1823 0xDF, 0xFC, 0x43, 0x05, 0x3C, 0xF7, 0x46, 0x12, 0x8D, 0x45, 0xE2,
1824 0xF8, 0xF7, 0x01, 0xB8, 0xFF, 0xB9, 0xFF, 0x56, 0x00, 0xCE, 0xFF,
1825 0x0C, 0x00, 0xFD, 0xFF, 0x34, 0x00, 0x3F, 0xFF, 0xDD, 0x01, 0x34,
1826 0xFC, 0x23, 0x07, 0x21, 0xF2, 0xCB, 0x27, 0xFE, 0x37, 0x00, 0xF2,
1827 0x4D, 0x06, 0x04, 0xFD, 0x49, 0x01, 0x8E, 0xFF, 0x19, 0x00, 0xFF,
1828 0xFF, 0x00, 0x00, 0x0E, 0x00, 0xAB, 0xFF, 0x10, 0x01, 0x62, 0xFD,
1829 0xC5, 0x05, 0xA5, 0xF2, 0x1F, 0x3B, 0xD6, 0x23, 0xBE, 0xF2, 0x01,
1830 0x07, 0x33, 0xFC, 0xE5, 0x01, 0x38, 0xFF, 0x36, 0x00, 0xFD, 0xFF,
1831 0x10, 0x00, 0xBD, 0xFF, 0x82, 0x00, 0x5E, 0xFF, 0x5D, 0x00, 0xD4,
1832 0x00, 0x0C, 0xFB, 0xF9, 0x46, 0x87, 0x0E, 0x82, 0xF8, 0xAD, 0x04,
1833 0x26, 0xFD, 0x8D, 0x01, 0x54, 0xFF, 0x2C, 0x00, 0xFF, 0xFF, 0x00,
1834 0x00, 0x29, 0x00, 0x60, 0xFF, 0x6D, 0x01, 0x6E, 0xFD, 0x17, 0x04,
1835 0xBC, 0xF9, 0x30, 0x0B, 0xF4, 0x47, 0x4B, 0xFD, 0xB5, 0xFF, 0xFD,
1836 0x00, 0x08, 0xFF, 0xAC, 0x00, 0xAC, 0xFF, 0x14, 0x00, 0xFD, 0xFF,
1837 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x41, 0xFC, 0xC8, 0x06, 0x76,
1838 0xF3, 0x22, 0x20, 0xCA, 0x3D, 0x7D, 0xF3, 0x2A, 0x05, 0xC8, 0xFD,
1839 0xD4, 0x00, 0xCA, 0xFF, 0x03, 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x21,
1840 0x00, 0x77, 0xFF, 0x77, 0x01, 0xBD, 0xFC, 0xAE, 0x06, 0xA3, 0xF1,
1841 0xE3, 0x34, 0x64, 0x2B, 0xBC, 0xF1, 0x2A, 0x07, 0x43, 0xFC, 0xCD,
1842 0x01, 0x48, 0xFF, 0x31, 0x00, 0xFD, 0xFF, 0x09, 0x00, 0xDD, 0xFF,
1843 0x2E, 0x00, 0x0A, 0x00, 0x27, 0xFF, 0xEF, 0x02, 0x20, 0xF7, 0xE7,
1844 0x43, 0xD8, 0x15, 0x1E, 0xF6, 0xC0, 0x05, 0xA7, 0xFC, 0xC3, 0x01,
1845 0x40, 0xFF, 0x33, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x20, 0x00, 0x7F,
1846 0xFF, 0x20, 0x01, 0x16, 0xFE, 0xCA, 0x02, 0x54, 0xFC, 0xB9, 0x04,
1847 0xF2, 0x48, 0xA9, 0x02, 0x39, 0xFD, 0x53, 0x02, 0x53, 0xFE, 0x03,
1848 0x01, 0x8A, 0xFF, 0x1D, 0x00, 0xFE, 0xFF, 0x34, 0x00, 0x3B, 0xFF,
1849 0xD1, 0x01, 0x84, 0xFC, 0x12, 0x06, 0x5C, 0xF5, 0x76, 0x18, 0x89,
1850 0x42, 0x02, 0xF6, 0x94, 0x03, 0xC4, 0xFE, 0x42, 0x00, 0x12, 0x00,
1851 0xE8, 0xFF, 0x07, 0x00, 0xFD, 0xFF, 0x2E, 0x00, 0x51, 0xFF, 0xBD,
1852 0x01, 0x57, 0xFC, 0x1E, 0x07, 0x90, 0xF1, 0xED, 0x2D, 0x8C, 0x32,
1853 0x83, 0xF1, 0xE2, 0x06, 0x92, 0xFC, 0x93, 0x01, 0x68, 0xFF, 0x26,
1854 0x00, 0xFD, 0xFF, 0x03, 0x00, 0xFA, 0xFF, 0xE2, 0xFF, 0xA4, 0x00,
1855 0x19, 0xFE, 0xAA, 0x04, 0x3E, 0xF4, 0x90, 0x3F, 0x78, 0x1D, 0x10,
1856 0xF4, 0x93, 0x06, 0x52, 0xFC, 0xE1, 0x01, 0x36, 0xFF, 0x36, 0x00,
1857 0xFE, 0xFF, 0x17, 0x00, 0xA0, 0xFF, 0xCA, 0x00, 0xC9, 0xFE, 0x73,
1858 0x01, 0xDE, 0xFE, 0x0C, 0xFF, 0x76, 0x48, 0xDE, 0x08, 0xA1, 0xFA,
1859 0xA6, 0x03, 0xA6, 0xFD, 0x53, 0x01, 0x6A, 0xFF, 0x26, 0x00, 0x00,
1860 0x00, 0xFF, 0xFF, 0x2F, 0x00, 0x4C, 0xFF, 0xA2, 0x01, 0xF6, 0xFC,
1861 0x12, 0x05, 0xA7, 0xF7, 0x03, 0x11, 0x10, 0x46, 0x93, 0xF9, 0x98,
1862 0x01, 0xEE, 0xFF, 0x9B, 0xFF, 0x64, 0x00, 0xC8, 0xFF, 0x0E, 0x00,
1863 0xFD, 0xFF, 0x35, 0x00, 0x3C, 0xFF, 0xE1, 0x01, 0x32, 0xFC, 0x1B,
1864 0x07, 0x50, 0xF2, 0x7B, 0x26, 0x11, 0x39, 0x2F, 0xF2, 0x23, 0x06,
1865 0x22, 0xFD, 0x37, 0x01, 0x97, 0xFF, 0x15, 0x00, 0xFF, 0xFF, 0x00,
1866 0x00, 0x12, 0x00, 0xA1, 0xFF, 0x24, 0x01, 0x41, 0xFD, 0xF6, 0x05,
1867 0x67, 0xF2, 0x1A, 0x3A, 0x29, 0x25, 0x84, 0xF2, 0x0F, 0x07, 0x31,
1868 0xFC, 0xE3, 0x01, 0x3A, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x0F, 0x00,
1869 0xC2, 0xFF, 0x73, 0x00, 0x7D, 0xFF, 0x25, 0x00, 0x38, 0x01, 0x4C,
1870 0xFA, 0x89, 0x46, 0xC3, 0x0F, 0x14, 0xF8, 0xE0, 0x04, 0x0D, 0xFD,
1871 0x98, 0x01, 0x50, 0xFF, 0x2E, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x27,
1872 0x00, 0x65, 0xFF, 0x60, 0x01, 0x8A, 0xFD, 0xDF, 0x03, 0x2E, 0xFA,
1873 0x04, 0x0A, 0x3A, 0x48, 0x28, 0xFE, 0x4B, 0xFF, 0x38, 0x01, 0xE9,
1874 0xFE, 0xBB, 0x00, 0xA6, 0xFF, 0x16, 0x00, 0xFE, 0xFF, 0x36, 0x00,
1875 0x36, 0xFF, 0xE4, 0x01, 0x49, 0xFC, 0xAF, 0x06, 0xC1, 0xF3, 0xCD,
1876 0x1E, 0xB1, 0x3E, 0xD9, 0xF3, 0xEC, 0x04, 0xF0, 0xFD, 0xBC, 0x00,
1877 0xD5, 0xFF, 0xFE, 0xFF, 0x03, 0x00, 0xFD, 0xFF, 0x24, 0x00, 0x6F,
1878 0xFF, 0x85, 0x01, 0xA6, 0xFC, 0xCA, 0x06, 0x8F, 0xF1, 0xBB, 0x33,
1879 0xAB, 0x2C, 0xA3, 0xF1, 0x26, 0x07, 0x4C, 0xFC, 0xC5, 0x01, 0x4D,
1880 0xFF, 0x30, 0x00, 0xFD, 0xFF, 0x08, 0x00, 0xE2, 0xFF, 0x20, 0x00,
1881 0x26, 0x00, 0xF5, 0xFE, 0x43, 0x03, 0x8D, 0xF6, 0x3C, 0x43, 0x25,
1882 0x17, 0xBB, 0xF5, 0xEA, 0x05, 0x95, 0xFC, 0xCA, 0x01, 0x3D, 0xFF,
1883 0x34, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x1E, 0x00, 0x84, 0xFF, 0x11,
1884 0x01, 0x34, 0xFE, 0x8F, 0x02, 0xC7, 0xFC, 0xAE, 0x03, 0xF7, 0x48,
1885 0xAE, 0x03, 0xC7, 0xFC, 0x8F, 0x02, 0x34, 0xFE, 0x11, 0x01, 0x84,
1886 0xFF, 0x1E, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01,
1887 0x3D, 0xFC, 0xD6, 0x06, 0x4C, 0xF3, 0xED, 0x20, 0x3D, 0x3D, 0x4A,
1888 0xF3, 0x4E, 0x05, 0xB1, 0xFD, 0xE1, 0x00, 0xC3, 0xFF, 0x05, 0x00,
1889 0x02, 0x00, 0x02, 0x00, 0x05, 0x00, 0xC3, 0xFF, 0xE1, 0x00, 0xB1,
1890 0xFD, 0x4E, 0x05, 0x4A, 0xF3, 0x3D, 0x3D, 0xED, 0x20, 0x4C, 0xF3,
1891 0xD6, 0x06, 0x3D, 0xFC, 0xE6, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD,
1892 0xFF, 0x00, 0x00, 0x1E, 0x00, 0x84, 0xFF, 0x11, 0x01, 0x34, 0xFE,
1893 0x8F, 0x02, 0xC7, 0xFC, 0xAE, 0x03, 0xF7, 0x48, 0xAE, 0x03, 0xC7,
1894 0xFC, 0x8F, 0x02, 0x34, 0xFE, 0x11, 0x01, 0x84, 0xFF, 0x1E, 0x00,
1895 0xFD, 0xFF, 0x30, 0x00, 0x4D, 0xFF, 0xC5, 0x01, 0x4C, 0xFC, 0x26,
1896 0x07, 0xA3, 0xF1, 0xAB, 0x2C, 0xBB, 0x33, 0x8F, 0xF1, 0xCA, 0x06,
1897 0xA6, 0xFC, 0x85, 0x01, 0x6F, 0xFF, 0x24, 0x00, 0xFD, 0xFF, 0x16,
1898 0x00, 0xA6, 0xFF, 0xBB, 0x00, 0xE9, 0xFE, 0x38, 0x01, 0x4B, 0xFF,
1899 0x28, 0xFE, 0x3A, 0x48, 0x04, 0x0A, 0x2E, 0xFA, 0xDF, 0x03, 0x8A,
1900 0xFD, 0x60, 0x01, 0x65, 0xFF, 0x27, 0x00, 0x00, 0x00, 0xFD, 0xFF,
1901 0x35, 0x00, 0x3A, 0xFF, 0xE3, 0x01, 0x31, 0xFC, 0x0F, 0x07, 0x84,
1902 0xF2, 0x29, 0x25, 0x1A, 0x3A, 0x67, 0xF2, 0xF6, 0x05, 0x41, 0xFD,
1903 0x24, 0x01, 0xA1, 0xFF, 0x12, 0x00, 0x00, 0x00, 0x0E, 0x00, 0xC8,
1904 0xFF, 0x64, 0x00, 0x9B, 0xFF, 0xEE, 0xFF, 0x98, 0x01, 0x93, 0xF9,
1905 0x10, 0x46, 0x03, 0x11, 0xA7, 0xF7, 0x12, 0x05, 0xF6, 0xFC, 0xA2,
1906 0x01, 0x4C, 0xFF, 0x2F, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x36, 0x00,
1907 0x36, 0xFF, 0xE1, 0x01, 0x52, 0xFC, 0x93, 0x06, 0x10, 0xF4, 0x78,
1908 0x1D, 0x90, 0x3F, 0x3E, 0xF4, 0xAA, 0x04, 0x19, 0xFE, 0xA4, 0x00,
1909 0xE2, 0xFF, 0xFA, 0xFF, 0x03, 0x00, 0x07, 0x00, 0xE8, 0xFF, 0x12,
1910 0x00, 0x42, 0x00, 0xC4, 0xFE, 0x94, 0x03, 0x02, 0xF6, 0x89, 0x42,
1911 0x76, 0x18, 0x5C, 0xF5, 0x12, 0x06, 0x84, 0xFC, 0xD1, 0x01, 0x3B,
1912 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x33, 0x00, 0x40, 0xFF,
1913 0xC3, 0x01, 0xA7, 0xFC, 0xC0, 0x05, 0x1E, 0xF6, 0xD8, 0x15, 0xE7,
1914 0x43, 0x20, 0xF7, 0xEF, 0x02, 0x27, 0xFF, 0x0A, 0x00, 0x2E, 0x00,
1915 0xDD, 0xFF, 0x09, 0x00, 0x02, 0x00, 0x03, 0x00, 0xCA, 0xFF, 0xD4,
1916 0x00, 0xC8, 0xFD, 0x2A, 0x05, 0x7D, 0xF3, 0xCA, 0x3D, 0x22, 0x20,
1917 0x76, 0xF3, 0xC8, 0x06, 0x41, 0xFC, 0xE6, 0x01, 0x36, 0xFF, 0x36,
1918 0x00, 0xFD, 0xFF, 0xFF, 0xFF, 0x2C, 0x00, 0x54, 0xFF, 0x8D, 0x01,
1919 0x26, 0xFD, 0xAD, 0x04, 0x82, 0xF8, 0x87, 0x0E, 0xF9, 0x46, 0x0C,
1920 0xFB, 0xD4, 0x00, 0x5D, 0x00, 0x5E, 0xFF, 0x82, 0x00, 0xBD, 0xFF,
1921 0x10, 0x00, 0xFF, 0xFF, 0x19, 0x00, 0x8E, 0xFF, 0x49, 0x01, 0x04,
1922 0xFD, 0x4D, 0x06, 0x00, 0xF2, 0xFE, 0x37, 0xCB, 0x27, 0x21, 0xF2,
1923 0x23, 0x07, 0x34, 0xFC, 0xDD, 0x01, 0x3F, 0xFF, 0x34, 0x00, 0xFD,
1924 0xFF, 0x00, 0x00, 0x24, 0x00, 0x70, 0xFF, 0x46, 0x01, 0xC3, 0xFD,
1925 0x6D, 0x03, 0x14, 0xFB, 0xBE, 0x07, 0xA6, 0x48, 0xF8, 0xFF, 0x70,
1926 0xFE, 0xAE, 0x01, 0xAA, 0xFE, 0xD9, 0x00, 0x9A, 0xFF, 0x19, 0x00,
1927 0xFD, 0xFF, 0x29, 0x00, 0x61, 0xFF, 0x9F, 0x01, 0x80, 0xFC, 0xF7,
1928 0x06, 0x7D, 0xF1, 0x5A, 0x31, 0x2C, 0x2F, 0x83, 0xF1, 0x13, 0x07,
1929 0x64, 0xFC, 0xB3, 0x01, 0x57, 0xFF, 0x2C, 0x00, 0xFD, 0xFF, 0x1B,
1930 0x00, 0x90, 0xFF, 0xF4, 0x00, 0x72, 0xFE, 0x18, 0x02, 0xAA, 0xFD,
1931 0xAB, 0x01, 0xDF, 0x48, 0xCA, 0x05, 0xE1, 0xFB, 0x05, 0x03, 0xF7,
1932 0xFD, 0x2E, 0x01, 0x79, 0xFF, 0x21, 0x00, 0x00, 0x00, 0xFD, 0xFF,
1933 0x32, 0x00, 0x44, 0xFF, 0xD3, 0x01, 0x3C, 0xFC, 0x2A, 0x07, 0xDC,
1934 0xF1, 0x1A, 0x2A, 0x06, 0x36, 0xBE, 0xF1, 0x8E, 0x06, 0xD5, 0xFC,
1935 0x67, 0x01, 0x7F, 0xFF, 0x1E, 0x00, 0xFE, 0xFF, 0x13, 0x00, 0xB2,
1936 0xFF, 0x9D, 0x00, 0x27, 0xFF, 0xC3, 0x00, 0x1F, 0x00, 0x76, 0xFC,
1937 0xA3, 0x47, 0x60, 0x0C, 0x4A, 0xF9, 0x4E, 0x04, 0x53, 0xFD, 0x79,
1938 0x01, 0x5C, 0xFF, 0x2A, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x36, 0x00,
1939 0x37, 0xFF, 0xE6, 0x01, 0x36, 0xFC, 0xEF, 0x06, 0xFC, 0xF2, 0x81,
1940 0x22, 0x1C, 0x3C, 0xEC, 0xF2, 0x90, 0x05, 0x85, 0xFD, 0xFB, 0x00,
1941 0xB6, 0xFF, 0x0A, 0x00, 0x01, 0x00, 0x0B, 0x00, 0xD3, 0xFF, 0x47,
1942 0x00, 0xD7, 0xFF, 0x82, 0xFF, 0x53, 0x02, 0x39, 0xF8, 0xFD, 0x44,
1943 0x8D, 0x13, 0xD3, 0xF6, 0x72, 0x05, 0xCA, 0xFC, 0xB5, 0x01, 0x45,
1944 0xFF, 0x31, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x35, 0x00, 0x38, 0xFF,
1945 0xDA, 0x01, 0x6A, 0xFC, 0x53, 0x06, 0xBA, 0xF4, 0xCE, 0x1A, 0x32,
1946 0x41, 0x1F, 0xF5, 0x1D, 0x04, 0x71, 0xFE, 0x71, 0x00, 0xFB, 0xFF,
1947 0xF0, 0xFF, 0x05, 0x00, 0x05, 0x00, 0xF2, 0xFF, 0xF8, 0xFF, 0x77,
1948 0x00, 0x67, 0xFE, 0x2D, 0x04, 0x04, 0xF5, 0x07, 0x41, 0x1B, 0x1B,
1949 0xA6, 0xF4, 0x5A, 0x06, 0x67, 0xFC, 0xDB, 0x01, 0x38, 0xFF, 0x36,
1950 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x31, 0x00, 0x46, 0xFF, 0xB3, 0x01,
1951 0xCF, 0xFC, 0x67, 0x05, 0xEA, 0xF6, 0x44, 0x13, 0x1E, 0x45, 0x5E,
1952 0xF8, 0x3F, 0x02, 0x8E, 0xFF, 0xD0, 0xFF, 0x4A, 0x00, 0xD2, 0xFF,
1953 0x0B, 0x00, 0x01, 0x00, 0x0B, 0x00, 0xB4, 0xFF, 0x00, 0x01, 0x7E,
1954 0xFD, 0x9C, 0x05, 0xDC, 0xF2, 0xE4, 0x3B, 0xCD, 0x22, 0xEE, 0xF2,
1955 0xF3, 0x06, 0x35, 0xFC, 0xE6, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD,
1956 0xFF, 0x00, 0x00, 0x2A, 0x00, 0x5D, 0xFF, 0x76, 0x01, 0x59, 0xFD,
1957 0x42, 0x04, 0x63, 0xF9, 0x1C, 0x0C, 0xB6, 0x47, 0xA4, 0xFC, 0x07,
1958 0x00, 0xD0, 0x00, 0x20, 0xFF, 0xA0, 0x00, 0xB1, 0xFF, 0x13, 0x00,
1959 0xFE, 0xFF, 0x1F, 0x00, 0x7D, 0xFF, 0x6B, 0x01, 0xCF, 0xFC, 0x96,
1960 0x06, 0xB7, 0xF1, 0xC6, 0x35, 0x64, 0x2A, 0xD4, 0xF1, 0x2B, 0x07,
1961 0x3D, 0xFC, 0xD2, 0x01, 0x45, 0xFF, 0x32, 0x00, 0xFD, 0xFF, 0x00,
1962 0x00, 0x21, 0x00, 0x7A, 0xFF, 0x2B, 0x01, 0xFE, 0xFD, 0xF8, 0x02,
1963 0xFB, 0xFB, 0x8D, 0x05, 0xE5, 0x48, 0xE3, 0x01, 0x91, 0xFD, 0x25,
1964 0x02, 0x6B, 0xFE, 0xF7, 0x00, 0x8F, 0xFF, 0x1C, 0x00, 0xFD, 0xFF,
1965 0x2D, 0x00, 0x55, 0xFF, 0xB5, 0x01, 0x61, 0xFC, 0x16, 0x07, 0x85,
1966 0xF1, 0xE6, 0x2E, 0x9E, 0x31, 0x7D, 0xF1, 0xF3, 0x06, 0x84, 0xFC,
1967 0x9D, 0x01, 0x63, 0xFF, 0x28, 0x00, 0xFD, 0xFF, 0x18, 0x00, 0x9C,
1968 0xFF, 0xD6, 0x00, 0xB1, 0xFE, 0xA1, 0x01, 0x89, 0xFE, 0xC3, 0xFF,
1969 0x9C, 0x48, 0xFD, 0x07, 0xFA, 0xFA, 0x7A, 0x03, 0xBC, 0xFD, 0x49,
1970 0x01, 0x6E, 0xFF, 0x24, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x34, 0x00,
1971 0x3E, 0xFF, 0xDE, 0x01, 0x33, 0xFC, 0x22, 0x07, 0x2B, 0xF2, 0x80,
1972 0x27, 0x3B, 0x38, 0x0A, 0xF2, 0x44, 0x06, 0x0B, 0xFD, 0x45, 0x01,
1973 0x90, 0xFF, 0x18, 0x00, 0xFF, 0xFF, 0x10, 0x00, 0xBE, 0xFF, 0x7F,
1974 0x00, 0x65, 0xFF, 0x51, 0x00, 0xEB, 0x00, 0xE1, 0xFA, 0xE1, 0x46,
1975 0xCD, 0x0E, 0x6A, 0xF8, 0xB8, 0x04, 0x20, 0xFD, 0x90, 0x01, 0x53,
1976 0xFF, 0x2D, 0x00, 0xFF, 0xFF, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF,
1977 0xE5, 0x01, 0x42, 0xFC, 0xC3, 0x06, 0x87, 0xF3, 0xD7, 0x1F, 0xFE,
1978 0x3D, 0x91, 0xF3, 0x1D, 0x05, 0xD1, 0xFD, 0xCE, 0x00, 0xCC, 0xFF,
1979 0x02, 0x00, 0x02, 0x00, 0x09, 0x00, 0xDE, 0xFF, 0x2B, 0x00, 0x11,
1980 0x00, 0x1B, 0xFF, 0x02, 0x03, 0xFE, 0xF6, 0xC3, 0x43, 0x22, 0x16,
1981 0x07, 0xF6, 0xCA, 0x05, 0xA3, 0xFC, 0xC5, 0x01, 0x3F, 0xFF, 0x33,
1982 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x34, 0x00, 0x3C, 0xFF, 0xCF, 0x01,
1983 0x88, 0xFC, 0x09, 0x06, 0x71, 0xF5, 0x2B, 0x18, 0xB2, 0x42, 0x20,
1984 0xF6, 0x83, 0x03, 0xCF, 0xFE, 0x3C, 0x00, 0x15, 0x00, 0xE6, 0xFF,
1985 0x07, 0x00, 0x03, 0x00, 0xFB, 0xFF, 0xDF, 0xFF, 0xA9, 0x00, 0x10,
1986 0xFE, 0xB9, 0x04, 0x27, 0xF4, 0x5E, 0x3F, 0xC3, 0x1D, 0xFE, 0xF3,
1987 0x99, 0x06, 0x50, 0xFC, 0xE2, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFE,
1988 0xFF, 0xFF, 0xFF, 0x2F, 0x00, 0x4D, 0xFF, 0xA0, 0x01, 0xFB, 0xFC,
1989 0x07, 0x05, 0xBF, 0xF7, 0xBB, 0x10, 0x2B, 0x46, 0xBB, 0xF9, 0x83,
1990 0x01, 0xFA, 0xFF, 0x95, 0xFF, 0x68, 0x00, 0xC7, 0xFF, 0x0E, 0x00,
1991 0x00, 0x00, 0x13, 0x00, 0x9F, 0xFF, 0x28, 0x01, 0x3A, 0xFD, 0x00,
1992 0x06, 0x5A, 0xF2, 0xDF, 0x39, 0x73, 0x25, 0x79, 0xF2, 0x12, 0x07,
1993 0x31, 0xFC, 0xE3, 0x01, 0x3B, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x00,
1994 0x00, 0x27, 0x00, 0x66, 0xFF, 0x5E, 0x01, 0x90, 0xFD, 0xD2, 0x03,
1995 0x47, 0xFA, 0xC3, 0x09, 0x48, 0x48, 0x5A, 0xFE, 0x33, 0xFF, 0x45,
1996 0x01, 0xE2, 0xFE, 0xBE, 0x00, 0xA5, 0xFF, 0x16, 0x00, 0xFD, 0xFF,
1997 0x24, 0x00, 0x6D, 0xFF, 0x88, 0x01, 0xA2, 0xFC, 0xD0, 0x06, 0x8C,
1998 0xF1, 0x78, 0x33, 0xF2, 0x2C, 0x9E, 0xF1, 0x24, 0x07, 0x4E, 0xFC,
1999 0xC3, 0x01, 0x4E, 0xFF, 0x2F, 0x00, 0xFD, 0xFF, 0x1E, 0x00, 0x86,
2000 0xFF, 0x0E, 0x01, 0x3B, 0xFE, 0x82, 0x02, 0xE0, 0xFC, 0x73, 0x03,
2001 0xF6, 0x48, 0xE9, 0x03, 0xAD, 0xFC, 0x9C, 0x02, 0x2D, 0xFE, 0x14,
2002 0x01, 0x83, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x30, 0x00,
2003 0x4C, 0xFF, 0xC7, 0x01, 0x4A, 0xFC, 0x27, 0x07, 0xA8, 0xF1, 0x62,
2004 0x2C, 0xFD, 0x33, 0x93, 0xF1, 0xC4, 0x06, 0xAB, 0xFC, 0x82, 0x01,
2005 0x71, 0xFF, 0x23, 0x00, 0xFE, 0xFF, 0x15, 0x00, 0xA8, 0xFF, 0xB8,
2006 0x00, 0xF0, 0xFE, 0x2B, 0x01, 0x63, 0xFF, 0xF6, 0xFD, 0x2C, 0x48,
2007 0x47, 0x0A, 0x14, 0xFA, 0xEB, 0x03, 0x84, 0xFD, 0x63, 0x01, 0x64,
2008 0xFF, 0x27, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x3A, 0xFF,
2009 0xE4, 0x01, 0x32, 0xFC, 0x0C, 0x07, 0x91, 0xF2, 0xDD, 0x24, 0x54,
2010 0x3A, 0x74, 0xF2, 0xEB, 0x05, 0x49, 0xFD, 0x20, 0x01, 0xA3, 0xFF,
2011 0x11, 0x00, 0x00, 0x00, 0x0D, 0x00, 0xC9, 0xFF, 0x61, 0x00, 0xA2,
2012 0xFF, 0xE2, 0xFF, 0xAE, 0x01, 0x6B, 0xF9, 0xF2, 0x45, 0x4A, 0x11,
2013 0x8F, 0xF7, 0x1D, 0x05, 0xF1, 0xFC, 0xA4, 0x01, 0x4B, 0xFF, 0x2F,
2014 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE1, 0x01,
2015 0x55, 0xFC, 0x8C, 0x06, 0x22, 0xF4, 0x2C, 0x1D, 0xC0, 0x3F, 0x55,
2016 0xF4, 0x9B, 0x04, 0x23, 0xFE, 0x9F, 0x00, 0xE4, 0xFF, 0xF9, 0xFF,
2017 0x04, 0x00, 0x07, 0x00, 0xE9, 0xFF, 0x0F, 0x00, 0x48, 0x00, 0xB9,
2018 0xFE, 0xA6, 0x03, 0xE4, 0xF5, 0x60, 0x42, 0xC1, 0x18, 0x47, 0xF5,
2019 0x1A, 0x06, 0x81, 0xFC, 0xD2, 0x01, 0x3B, 0xFF, 0x35, 0x00, 0xFE,
2020 0xFF, 0xFF, 0xFF, 0x33, 0x00, 0x40, 0xFF, 0xC1, 0x01, 0xAB, 0xFC,
2021 0xB7, 0x05, 0x34, 0xF6, 0x8E, 0x15, 0x0B, 0x44, 0x42, 0xF7, 0xDC,
2022 0x02, 0x32, 0xFF, 0x04, 0x00, 0x31, 0x00, 0xDC, 0xFF, 0x09, 0x00,
2023 0x02, 0x00, 0x04, 0x00, 0xC7, 0xFF, 0xD9, 0x00, 0xBF, 0xFD, 0x38,
2024 0x05, 0x69, 0xF3, 0x96, 0x3D, 0x6F, 0x20, 0x66, 0xF3, 0xCE, 0x06,
2025 0x3F, 0xFC, 0xE6, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0xFF,
2026 0xFF, 0x2C, 0x00, 0x55, 0xFF, 0x8B, 0x01, 0x2B, 0xFD, 0xA1, 0x04,
2027 0x9B, 0xF8, 0x42, 0x0E, 0x0F, 0x47, 0x38, 0xFB, 0xBE, 0x00, 0x6A,
2028 0x00, 0x58, 0xFF, 0x85, 0x00, 0xBB, 0xFF, 0x10, 0x00, 0xFF, 0xFF,
2029 0x19, 0x00, 0x8C, 0xFF, 0x4D, 0x01, 0xFE, 0xFC, 0x56, 0x06, 0xF7,
2030 0xF1, 0xBF, 0x37, 0x15, 0x28, 0x18, 0xF2, 0x25, 0x07, 0x34, 0xFC,
2031 0xDC, 0x01, 0x3F, 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x24,
2032 0x00, 0x71, 0xFF, 0x43, 0x01, 0xC9, 0xFD, 0x60, 0x03, 0x2E, 0xFB,
2033 0x7E, 0x07, 0xAF, 0x48, 0x2D, 0x00, 0x58, 0xFE, 0xBB, 0x01, 0xA3,
2034 0xFE, 0xDD, 0x00, 0x99, 0xFF, 0x19, 0x00, 0xFD, 0xFF, 0x29, 0x00,
2035 0x60, 0xFF, 0xA2, 0x01, 0x7C, 0xFC, 0xFB, 0x06, 0x7C, 0xF1, 0x15,
2036 0x31, 0x73, 0x2F, 0x81, 0xF1, 0x10, 0x07, 0x67, 0xFC, 0xB1, 0x01,
2037 0x58, 0xFF, 0x2C, 0x00, 0xFD, 0xFF, 0x1B, 0x00, 0x91, 0xFF, 0xF1,
2038 0x00, 0x79, 0xFE, 0x0A, 0x02, 0xC3, 0xFD, 0x73, 0x01, 0xDB, 0x48,
2039 0x07, 0x06, 0xC7, 0xFB, 0x12, 0x03, 0xF1, 0xFD, 0x31, 0x01, 0x78,
2040 0xFF, 0x22, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x32, 0x00, 0x44, 0xFF,
2041 0xD5, 0x01, 0x3A, 0xFC, 0x2A, 0x07, 0xE3, 0xF1, 0xD1, 0x29, 0x46,
2042 0x36, 0xC5, 0xF1, 0x87, 0x06, 0xDA, 0xFC, 0x64, 0x01, 0x80, 0xFF,
2043 0x1E, 0x00, 0xFE, 0xFF, 0x12, 0x00, 0xB3, 0xFF, 0x99, 0x00, 0x2E,
2044 0xFF, 0xB6, 0x00, 0x36, 0x00, 0x47, 0xFC, 0x90, 0x47, 0xA4, 0x0C,
2045 0x31, 0xF9, 0x5A, 0x04, 0x4E, 0xFD, 0x7C, 0x01, 0x5B, 0xFF, 0x2A,
2046 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01,
2047 0x37, 0xFC, 0xEB, 0x06, 0x0B, 0xF3, 0x35, 0x22, 0x52, 0x3C, 0xFD,
2048 0xF2, 0x84, 0x05, 0x8D, 0xFD, 0xF6, 0x00, 0xB8, 0xFF, 0x09, 0x00,
2049 0x01, 0x00, 0x0B, 0x00, 0xD5, 0xFF, 0x44, 0x00, 0xDD, 0xFF, 0x77,
2050 0xFF, 0x67, 0x02, 0x14, 0xF8, 0xDC, 0x44, 0xD5, 0x13, 0xBC, 0xF6,
2051 0x7C, 0x05, 0xC5, 0xFC, 0xB7, 0x01, 0x44, 0xFF, 0x31, 0x00, 0xFF,
2052 0xFF, 0xFE, 0xFF, 0x35, 0x00, 0x39, 0xFF, 0xD9, 0x01, 0x6D, 0xFC,
2053 0x4B, 0x06, 0xCD, 0xF4, 0x83, 0x1A, 0x5F, 0x41, 0x3A, 0xF5, 0x0C,
2054 0x04, 0x7B, 0xFE, 0x6C, 0x00, 0xFE, 0xFF, 0xEF, 0xFF, 0x05, 0x00,
2055 0x05, 0x00, 0xF3, 0xFF, 0xF5, 0xFF, 0x7D, 0x00, 0x5D, 0xFE, 0x3E,
2056 0x04, 0xEA, 0xF4, 0xD9, 0x40, 0x66, 0x1B, 0x93, 0xF4, 0x62, 0x06,
2057 0x64, 0xFC, 0xDC, 0x01, 0x38, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0xFF,
2058 0xFF, 0x31, 0x00, 0x46, 0xFF, 0xB1, 0x01, 0xD3, 0xFC, 0x5D, 0x05,
2059 0x01, 0xF7, 0xFB, 0x12, 0x3F, 0x45, 0x83, 0xF8, 0x2A, 0x02, 0x9A,
2060 0xFF, 0xCA, 0xFF, 0x4E, 0x00, 0xD1, 0xFF, 0x0C, 0x00, 0x00, 0x00,
2061 0x0C, 0x00, 0xB1, 0xFF, 0x04, 0x01, 0x76, 0xFD, 0xA8, 0x05, 0xCC,
2062 0xF2, 0xAB, 0x3B, 0x18, 0x23, 0xE0, 0xF2, 0xF7, 0x06, 0x35, 0xFC,
2063 0xE6, 0x01, 0x38, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x29,
2064 0x00, 0x5E, 0xFF, 0x74, 0x01, 0x5F, 0xFD, 0x35, 0x04, 0x7C, 0xF9,
2065 0xD8, 0x0B, 0xC9, 0x47, 0xD4, 0xFC, 0xF0, 0xFF, 0xDD, 0x00, 0x19,
2066 0xFF, 0xA4, 0x00, 0xAF, 0xFF, 0x13, 0x00, 0xFE, 0xFF, 0x20, 0x00,
2067 0x7B, 0xFF, 0x6E, 0x01, 0xCA, 0xFC, 0x9D, 0x06, 0xB1, 0xF1, 0x86,
2068 0x35, 0xAE, 0x2A, 0xCD, 0xF1, 0x2B, 0x07, 0x3F, 0xFC, 0xD1, 0x01,
2069 0x46, 0xFF, 0x32, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x21, 0x00, 0x7C,
2070 0xFF, 0x27, 0x01, 0x05, 0xFE, 0xEB, 0x02, 0x14, 0xFC, 0x50, 0x05,
2071 0xEA, 0x48, 0x1B, 0x02, 0x78, 0xFD, 0x32, 0x02, 0x64, 0xFE, 0xFA,
2072 0x00, 0x8D, 0xFF, 0x1C, 0x00, 0xFD, 0xFF, 0x2D, 0x00, 0x54, 0xFF,
2073 0xB7, 0x01, 0x5E, 0xFC, 0x19, 0x07, 0x88, 0xF1, 0x9F, 0x2E, 0xE3,
2074 0x31, 0x7E, 0xF1, 0xEE, 0x06, 0x88, 0xFC, 0x9A, 0x01, 0x64, 0xFF,
2075 0x28, 0x00, 0xFD, 0xFF, 0x18, 0x00, 0x9D, 0xFF, 0xD3, 0x00, 0xB8,
2076 0xFE, 0x93, 0x01, 0xA1, 0xFE, 0x8E, 0xFF, 0x92, 0x48, 0x3D, 0x08,
2077 0xE1, 0xFA, 0x86, 0x03, 0xB6, 0xFD, 0x4C, 0x01, 0x6D, 0xFF, 0x25,
2078 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x34, 0x00, 0x3E, 0xFF, 0xDF, 0x01,
2079 0x33, 0xFC, 0x20, 0x07, 0x35, 0xF2, 0x36, 0x27, 0x78, 0x38, 0x14,
2080 0xF2, 0x3B, 0x06, 0x11, 0xFD, 0x41, 0x01, 0x92, 0xFF, 0x17, 0x00,
2081 0xFF, 0xFF, 0x10, 0x00, 0xBF, 0xFF, 0x7B, 0x00, 0x6C, 0xFF, 0x44,
2082 0x00, 0x01, 0x01, 0xB6, 0xFA, 0xC8, 0x46, 0x13, 0x0F, 0x51, 0xF8,
2083 0xC4, 0x04, 0x1B, 0xFD, 0x92, 0x01, 0x52, 0xFF, 0x2D, 0x00, 0xFF,
2084 0xFF, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE5, 0x01, 0x44, 0xFC,
2085 0xBD, 0x06, 0x97, 0xF3, 0x8A, 0x1F, 0x31, 0x3E, 0xA5, 0xF3, 0x0F,
2086 0x05, 0xDA, 0xFD, 0xC9, 0x00, 0xCF, 0xFF, 0x01, 0x00, 0x02, 0x00,
2087 0x09, 0x00, 0xDF, 0xFF, 0x28, 0x00, 0x17, 0x00, 0x10, 0xFF, 0x15,
2088 0x03, 0xDD, 0xF6, 0x9E, 0x43, 0x6C, 0x16, 0xF1, 0xF5, 0xD3, 0x05,
2089 0x9F, 0xFC, 0xC6, 0x01, 0x3F, 0xFF, 0x33, 0x00, 0xFF, 0xFF, 0xFE,
2090 0xFF, 0x34, 0x00, 0x3C, 0xFF, 0xCE, 0x01, 0x8C, 0xFC, 0x00, 0x06,
2091 0x86, 0xF5, 0xE0, 0x17, 0xDB, 0x42, 0x3F, 0xF6, 0x71, 0x03, 0xD9,
2092 0xFE, 0x36, 0x00, 0x18, 0x00, 0xE5, 0xFF, 0x07, 0x00, 0x03, 0x00,
2093 0xFC, 0xFF, 0xDC, 0xFF, 0xAF, 0x00, 0x07, 0xFE, 0xC8, 0x04, 0x10,
2094 0xF4, 0x2D, 0x3F, 0x0F, 0x1E, 0xED, 0xF3, 0xA0, 0x06, 0x4E, 0xFC,
2095 0xE3, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x2E,
2096 0x00, 0x4E, 0xFF, 0x9E, 0x01, 0x00, 0xFD, 0xFC, 0x04, 0xD7, 0xF7,
2097 0x75, 0x10, 0x48, 0x46, 0xE4, 0xF9, 0x6E, 0x01, 0x06, 0x00, 0x8E,
2098 0xFF, 0x6B, 0x00, 0xC6, 0xFF, 0x0E, 0x00, 0xFF, 0xFF, 0x13, 0x00,
2099 0x9D, 0xFF, 0x2D, 0x01, 0x33, 0xFD, 0x0B, 0x06, 0x4D, 0xF2, 0xA5,
2100 0x39, 0xBF, 0x25, 0x6D, 0xF2, 0x15, 0x07, 0x31, 0xFC, 0xE2, 0x01,
2101 0x3B, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x26, 0x00, 0x68,
2102 0xFF, 0x5B, 0x01, 0x96, 0xFD, 0xC6, 0x03, 0x61, 0xFA, 0x81, 0x09,
2103 0x57, 0x48, 0x8D, 0xFE, 0x1B, 0xFF, 0x52, 0x01, 0xDB, 0xFE, 0xC2,
2104 0x00, 0xA4, 0xFF, 0x16, 0x00, 0xFD, 0xFF, 0x25, 0x00, 0x6C, 0xFF,
2105 0x8B, 0x01, 0x9D, 0xFC, 0xD5, 0x06, 0x89, 0xF1, 0x35, 0x33, 0x3A,
2106 0x2D, 0x9A, 0xF1, 0x23, 0x07, 0x51, 0xFC, 0xC2, 0x01, 0x4F, 0xFF,
2107 0x2F, 0x00, 0xFD, 0xFF, 0x1E, 0x00, 0x87, 0xFF, 0x0B, 0x01, 0x42,
2108 0xFE, 0x74, 0x02, 0xF9, 0xFC, 0x39, 0x03, 0xF5, 0x48, 0x24, 0x04,
2109 0x94, 0xFC, 0xA9, 0x02, 0x27, 0xFE, 0x18, 0x01, 0x82, 0xFF, 0x1F,
2110 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x30, 0x00, 0x4B, 0xFF, 0xC9, 0x01,
2111 0x48, 0xFC, 0x28, 0x07, 0xAD, 0xF1, 0x19, 0x2C, 0x3F, 0x34, 0x97,
2112 0xF1, 0xBE, 0x06, 0xB0, 0xFC, 0x7F, 0x01, 0x72, 0xFF, 0x23, 0x00,
2113 0xFE, 0xFF, 0x15, 0x00, 0xA9, 0xFF, 0xB4, 0x00, 0xF7, 0xFE, 0x1D,
2114 0x01, 0x7A, 0xFF, 0xC5, 0xFD, 0x1D, 0x48, 0x89, 0x0A, 0xFB, 0xF9,
2115 0xF8, 0x03, 0x7D, 0xFD, 0x66, 0x01, 0x63, 0xFF, 0x28, 0x00, 0x00,
2116 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x39, 0xFF, 0xE4, 0x01, 0x32, 0xFC,
2117 0x09, 0x07, 0x9D, 0xF2, 0x92, 0x24, 0x8F, 0x3A, 0x82, 0xF2, 0xE1,
2118 0x05, 0x50, 0xFD, 0x1B, 0x01, 0xA6, 0xFF, 0x10, 0x00, 0x00, 0x00,
2119 0x0D, 0x00, 0xCB, 0xFF, 0x5E, 0x00, 0xA9, 0xFF, 0xD6, 0xFF, 0xC3,
2120 0x01, 0x43, 0xF9, 0xD7, 0x45, 0x92, 0x11, 0x77, 0xF7, 0x28, 0x05,
2121 0xEC, 0xFC, 0xA7, 0x01, 0x4A, 0xFF, 0x2F, 0x00, 0xFF, 0xFF, 0xFE,
2122 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE0, 0x01, 0x57, 0xFC, 0x85, 0x06,
2123 0x34, 0xF4, 0xE0, 0x1C, 0xF0, 0x3F, 0x6D, 0xF4, 0x8C, 0x04, 0x2C,
2124 0xFE, 0x99, 0x00, 0xE7, 0xFF, 0xF8, 0xFF, 0x04, 0x00, 0x06, 0x00,
2125 0xEA, 0xFF, 0x0C, 0x00, 0x4E, 0x00, 0xAF, 0xFE, 0xB8, 0x03, 0xC7,
2126 0xF5, 0x38, 0x42, 0x0C, 0x19, 0x32, 0xF5, 0x23, 0x06, 0x7D, 0xFC,
2127 0xD3, 0x01, 0x3A, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x32,
2128 0x00, 0x41, 0xFF, 0xC0, 0x01, 0xAF, 0xFC, 0xAD, 0x05, 0x4A, 0xF6,
2129 0x44, 0x15, 0x2F, 0x44, 0x64, 0xF7, 0xC9, 0x02, 0x3D, 0xFF, 0xFE,
2130 0xFF, 0x34, 0x00, 0xDB, 0xFF, 0x09, 0x00, 0x02, 0x00, 0x05, 0x00,
2131 0xC5, 0xFF, 0xDE, 0x00, 0xB7, 0xFD, 0x45, 0x05, 0x56, 0xF3, 0x61,
2132 0x3D, 0xBA, 0x20, 0x56, 0xF3, 0xD3, 0x06, 0x3E, 0xFC, 0xE6, 0x01,
2133 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0xFF, 0xFF, 0x2C, 0x00, 0x56,
2134 0xFF, 0x88, 0x01, 0x31, 0xFD, 0x95, 0x04, 0xB4, 0xF8, 0xFC, 0x0D,
2135 0x26, 0x47, 0x64, 0xFB, 0xA7, 0x00, 0x77, 0x00, 0x51, 0xFF, 0x89,
2136 0x00, 0xBA, 0xFF, 0x11, 0x00, 0xFF, 0xFF, 0x1A, 0x00, 0x8A, 0xFF,
2137 0x51, 0x01, 0xF8, 0xFC, 0x5E, 0x06, 0xED, 0xF1, 0x82, 0x37, 0x60,
2138 0x28, 0x0E, 0xF2, 0x26, 0x07, 0x35, 0xFC, 0xDB, 0x01, 0x40, 0xFF,
2139 0x34, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x23, 0x00, 0x72, 0xFF, 0x40,
2140 0x01, 0xD0, 0xFD, 0x53, 0x03, 0x47, 0xFB, 0x3F, 0x07, 0xB8, 0x48,
2141 0x62, 0x00, 0x3F, 0xFE, 0xC8, 0x01, 0x9C, 0xFE, 0xE0, 0x00, 0x98,
2142 0xFF, 0x19, 0x00, 0xFD, 0xFF, 0x29, 0x00, 0x5F, 0xFF, 0xA5, 0x01,
2143 0x78, 0xFC, 0xFF, 0x06, 0x7D, 0xF1, 0xCF, 0x30, 0xB8, 0x2F, 0x80,
2144 0xF1, 0x0D, 0x07, 0x6A, 0xFC, 0xAE, 0x01, 0x59, 0xFF, 0x2B, 0x00,
2145 0xFD, 0xFF, 0x1B, 0x00, 0x93, 0xFF, 0xED, 0x00, 0x80, 0xFE, 0xFD,
2146 0x01, 0xDC, 0xFD, 0x3C, 0x01, 0xD5, 0x48, 0x45, 0x06, 0xAE, 0xFB,
2147 0x1F, 0x03, 0xEA, 0xFD, 0x34, 0x01, 0x77, 0xFF, 0x22, 0x00, 0x00,
2148 0x00, 0xFD, 0xFF, 0x33, 0x00, 0x43, 0xFF, 0xD6, 0x01, 0x39, 0xFC,
2149 0x2A, 0x07, 0xEB, 0xF1, 0x87, 0x29, 0x85, 0x36, 0xCC, 0xF1, 0x7F,
2150 0x06, 0xE0, 0xFC, 0x60, 0x01, 0x82, 0xFF, 0x1D, 0x00, 0xFE, 0xFF,
2151 0x12, 0x00, 0xB5, 0xFF, 0x96, 0x00, 0x35, 0xFF, 0xA9, 0x00, 0x4D,
2152 0x00, 0x19, 0xFC, 0x7C, 0x47, 0xE8, 0x0C, 0x18, 0xF9, 0x66, 0x04,
2153 0x48, 0xFD, 0x7E, 0x01, 0x5A, 0xFF, 0x2B, 0x00, 0x00, 0x00, 0xFD,
2154 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x38, 0xFC, 0xE6, 0x06,
2155 0x19, 0xF3, 0xEA, 0x21, 0x8A, 0x3C, 0x0E, 0xF3, 0x78, 0x05, 0x96,
2156 0xFD, 0xF1, 0x00, 0xBB, 0xFF, 0x08, 0x00, 0x01, 0x00, 0x0B, 0x00,
2157 0xD6, 0xFF, 0x41, 0x00, 0xE4, 0xFF, 0x6B, 0xFF, 0x7B, 0x02, 0xF0,
2158 0xF7, 0xBA, 0x44, 0x1E, 0x14, 0xA5, 0xF6, 0x86, 0x05, 0xC1, 0xFC,
2159 0xB9, 0x01, 0x44, 0xFF, 0x32, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x35,
2160 0x00, 0x39, 0xFF, 0xD8, 0x01, 0x70, 0xFC, 0x43, 0x06, 0xE1, 0xF4,
2161 0x38, 0x1A, 0x8C, 0x41, 0x55, 0xF5, 0xFC, 0x03, 0x85, 0xFE, 0x66,
2162 0x00, 0x01, 0x00, 0xEE, 0xFF, 0x06, 0x00, 0x05, 0x00, 0xF4, 0xFF,
2163 0xF2, 0xFF, 0x83, 0x00, 0x53, 0xFE, 0x4E, 0x04, 0xD0, 0xF4, 0xAB,
2164 0x40, 0xB2, 0x1B, 0x7F, 0xF4, 0x69, 0x06, 0x62, 0xFC, 0xDD, 0x01,
2165 0x38, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x30, 0x00, 0x47,
2166 0xFF, 0xAF, 0x01, 0xD8, 0xFC, 0x52, 0x05, 0x19, 0xF7, 0xB2, 0x12,
2167 0x5C, 0x45, 0xA9, 0xF8, 0x16, 0x02, 0xA6, 0xFF, 0xC3, 0xFF, 0x51,
2168 0x00, 0xD0, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x0D, 0x00, 0xAF, 0xFF,
2169 0x09, 0x01, 0x6E, 0xFD, 0xB4, 0x05, 0xBC, 0xF2, 0x73, 0x3B, 0x64,
2170 0x23, 0xD2, 0xF2, 0xFB, 0x06, 0x34, 0xFC, 0xE6, 0x01, 0x38, 0xFF,
2171 0x36, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x29, 0x00, 0x5F, 0xFF, 0x71,
2172 0x01, 0x65, 0xFD, 0x29, 0x04, 0x96, 0xF9, 0x95, 0x0B, 0xDC, 0x47,
2173 0x03, 0xFD, 0xD9, 0xFF, 0xEA, 0x00, 0x12, 0xFF, 0xA7, 0x00, 0xAE,
2174 0xFF, 0x14, 0x00, 0xFE, 0xFF, 0x20, 0x00, 0x79, 0xFF, 0x72, 0x01,
2175 0xC4, 0xFC, 0xA4, 0x06, 0xAB, 0xF1, 0x46, 0x35, 0xF7, 0x2A, 0xC6,
2176 0xF1, 0x2A, 0x07, 0x40, 0xFC, 0xCF, 0x01, 0x47, 0xFF, 0x31, 0x00,
2177 0xFD, 0xFF, 0x00, 0x00, 0x20, 0x00, 0x7D, 0xFF, 0x24, 0x01, 0x0C,
2178 0xFE, 0xDE, 0x02, 0x2E, 0xFC, 0x13, 0x05, 0xEC, 0x48, 0x54, 0x02,
2179 0x5E, 0xFD, 0x3F, 0x02, 0x5D, 0xFE, 0xFE, 0x00, 0x8C, 0xFF, 0x1C,
2180 0x00, 0xFD, 0xFF, 0x2D, 0x00, 0x53, 0xFF, 0xBA, 0x01, 0x5B, 0xFC,
2181 0x1B, 0x07, 0x8B, 0xF1, 0x58, 0x2E, 0x26, 0x32, 0x80, 0xF1, 0xEA,
2182 0x06, 0x8C, 0xFC, 0x97, 0x01, 0x66, 0xFF, 0x27, 0x00, 0xFD, 0xFF,
2183 0x17, 0x00, 0x9E, 0xFF, 0xCF, 0x00, 0xBF, 0xFE, 0x86, 0x01, 0xBA,
2184 0xFE, 0x5A, 0xFF, 0x86, 0x48, 0x7D, 0x08, 0xC7, 0xFA, 0x93, 0x03,
2185 0xB0, 0xFD, 0x4F, 0x01, 0x6C, 0xFF, 0x25, 0x00, 0x00, 0x00, 0xFD,
2186 0xFF, 0x35, 0x00, 0x3D, 0xFF, 0xDF, 0x01, 0x32, 0xFC, 0x1E, 0x07,
2187 0x40, 0xF2, 0xEB, 0x26, 0xB5, 0x38, 0x1F, 0xF2, 0x32, 0x06, 0x18,
2188 0xFD, 0x3D, 0x01, 0x94, 0xFF, 0x16, 0x00, 0xFF, 0xFF, 0x0F, 0x00,
2189 0xC0, 0xFF, 0x78, 0x00, 0x73, 0xFF, 0x38, 0x00, 0x17, 0x01, 0x8B,
2190 0xFA, 0xAF, 0x46, 0x59, 0x0F, 0x39, 0xF8, 0xCF, 0x04, 0x15, 0xFD,
2191 0x95, 0x01, 0x51, 0xFF, 0x2D, 0x00, 0xFF, 0xFF, 0xFD, 0xFF, 0x36,
2192 0x00, 0x36, 0xFF, 0xE5, 0x01, 0x46, 0xFC, 0xB8, 0x06, 0xA8, 0xF3,
2193 0x3F, 0x1F, 0x64, 0x3E, 0xBA, 0xF3, 0x01, 0x05, 0xE2, 0xFD, 0xC4,
2194 0x00, 0xD2, 0xFF, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0xE1, 0xFF,
2195 0x25, 0x00, 0x1D, 0x00, 0x05, 0xFF, 0x28, 0x03, 0xBD, 0xF6, 0x77,
2196 0x43, 0xB6, 0x16, 0xDC, 0xF5, 0xDD, 0x05, 0x9B, 0xFC, 0xC8, 0x01,
2197 0x3E, 0xFF, 0x33, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x34, 0x00, 0x3D,
2198 0xFF, 0xCC, 0x01, 0x8F, 0xFC, 0xF8, 0x05, 0x9B, 0xF5, 0x96, 0x17,
2199 0x02, 0x43, 0x5E, 0xF6, 0x5F, 0x03, 0xE4, 0xFE, 0x30, 0x00, 0x1B,
2200 0x00, 0xE4, 0xFF, 0x08, 0x00, 0x03, 0x00, 0xFD, 0xFF, 0xD9, 0xFF,
2201 0xB4, 0x00, 0xFD, 0xFD, 0xD7, 0x04, 0xFA, 0xF3, 0xFC, 0x3E, 0x5B,
2202 0x1E, 0xDB, 0xF3, 0xA6, 0x06, 0x4C, 0xFC, 0xE3, 0x01, 0x36, 0xFF,
2203 0x36, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x2E, 0x00, 0x4E, 0xFF, 0x9C,
2204 0x01, 0x05, 0xFD, 0xF1, 0x04, 0xF0, 0xF7, 0x2D, 0x10, 0x61, 0x46,
2205 0x0D, 0xFA, 0x58, 0x01, 0x13, 0x00, 0x87, 0xFF, 0x6E, 0x00, 0xC4,
2206 0xFF, 0x0E, 0x00, 0xFF, 0xFF, 0x14, 0x00, 0x9B, 0xFF, 0x31, 0x01,
2207 0x2C, 0xFD, 0x15, 0x06, 0x41, 0xF2, 0x6A, 0x39, 0x0A, 0x26, 0x61,
2208 0xF2, 0x17, 0x07, 0x31, 0xFC, 0xE2, 0x01, 0x3B, 0xFF, 0x35, 0x00,
2209 0xFD, 0xFF, 0x00, 0x00, 0x26, 0x00, 0x69, 0xFF, 0x58, 0x01, 0x9D,
2210 0xFD, 0xB9, 0x03, 0x7B, 0xFA, 0x40, 0x09, 0x63, 0x48, 0xBF, 0xFE,
2211 0x03, 0xFF, 0x5F, 0x01, 0xD4, 0xFE, 0xC5, 0x00, 0xA2, 0xFF, 0x16,
2212 0x00, 0xFD, 0xFF, 0x25, 0x00, 0x6A, 0xFF, 0x8E, 0x01, 0x99, 0xFC,
2213 0xDB, 0x06, 0x86, 0xF1, 0xF2, 0x32, 0x82, 0x2D, 0x96, 0xF1, 0x21,
2214 0x07, 0x53, 0xFC, 0xC0, 0x01, 0x50, 0xFF, 0x2E, 0x00, 0xFD, 0xFF,
2215 0x1D, 0x00, 0x88, 0xFF, 0x07, 0x01, 0x49, 0xFE, 0x67, 0x02, 0x13,
2216 0xFD, 0xFF, 0x02, 0xF4, 0x48, 0x5F, 0x04, 0x7A, 0xFC, 0xB6, 0x02,
2217 0x20, 0xFE, 0x1B, 0x01, 0x81, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0xFD,
2218 0xFF, 0x30, 0x00, 0x4A, 0xFF, 0xCA, 0x01, 0x46, 0xFC, 0x29, 0x07,
2219 0xB3, 0xF1, 0xD1, 0x2B, 0x81, 0x34, 0x9C, 0xF1, 0xB8, 0x06, 0xB5,
2220 0xFC, 0x7C, 0x01, 0x74, 0xFF, 0x22, 0x00, 0xFE, 0xFF, 0x15, 0x00,
2221 0xAA, 0xFF, 0xB1, 0x00, 0xFE, 0xFE, 0x10, 0x01, 0x92, 0xFF, 0x94,
2222 0xFD, 0x0D, 0x48, 0xCB, 0x0A, 0xE2, 0xF9, 0x04, 0x04, 0x77, 0xFD,
2223 0x69, 0x01, 0x62, 0xFF, 0x28, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x36,
2224 0x00, 0x39, 0xFF, 0xE5, 0x01, 0x32, 0xFC, 0x06, 0x07, 0xAA, 0xF2,
2225 0x46, 0x24, 0xC8, 0x3A, 0x90, 0xF2, 0xD6, 0x05, 0x57, 0xFD, 0x17,
2226 0x01, 0xA8, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x0D, 0x00, 0xCC, 0xFF,
2227 0x5A, 0x00, 0xAF, 0xFF, 0xCA, 0xFF, 0xD8, 0x01, 0x1C, 0xF9, 0xB8,
2228 0x45, 0xDA, 0x11, 0x60, 0xF7, 0x33, 0x05, 0xE7, 0xFC, 0xA9, 0x01,
2229 0x4A, 0xFF, 0x30, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x36, 0x00, 0x37,
2230 0xFF, 0xDF, 0x01, 0x5A, 0xFC, 0x7E, 0x06, 0x47, 0xF4, 0x94, 0x1C,
2231 0x1F, 0x40, 0x85, 0xF4, 0x7D, 0x04, 0x36, 0xFE, 0x93, 0x00, 0xEA,
2232 0xFF, 0xF7, 0xFF, 0x04, 0x00, 0x06, 0x00, 0xEB, 0xFF, 0x09, 0x00,
2233 0x54, 0x00, 0xA4, 0xFE, 0xC9, 0x03, 0xAA, 0xF5, 0x0C, 0x42, 0x56,
2234 0x19, 0x1E, 0xF5, 0x2B, 0x06, 0x7A, 0xFC, 0xD4, 0x01, 0x3A, 0xFF,
2235 0x35, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x32, 0x00, 0x42, 0xFF, 0xBE,
2236 0x01, 0xB4, 0xFC, 0xA4, 0x05, 0x61, 0xF6, 0xFB, 0x14, 0x53, 0x44,
2237 0x86, 0xF7, 0xB6, 0x02, 0x49, 0xFF, 0xF7, 0xFF, 0x37, 0x00, 0xD9,
2238 0xFF, 0x0A, 0x00, 0x01, 0x00, 0x06, 0x00, 0xC2, 0xFF, 0xE3, 0x00,
2239 0xAE, 0xFD, 0x52, 0x05, 0x44, 0xF3, 0x2A, 0x3D, 0x06, 0x21, 0x47,
2240 0xF3, 0xD8, 0x06, 0x3C, 0xFC, 0xE6, 0x01, 0x36, 0xFF, 0x36, 0x00,
2241 0xFD, 0xFF, 0x00, 0x00, 0x2B, 0x00, 0x57, 0xFF, 0x86, 0x01, 0x36,
2242 0xFD, 0x89, 0x04, 0xCD, 0xF8, 0xB7, 0x0D, 0x3D, 0x47, 0x91, 0xFB,
2243 0x91, 0x00, 0x83, 0x00, 0x4A, 0xFF, 0x8C, 0x00, 0xB9, 0xFF, 0x11,
2244 0x00, 0xFE, 0xFF, 0x1B, 0x00, 0x88, 0xFF, 0x55, 0x01, 0xF2, 0xFC,
2245 0x67, 0x06, 0xE4, 0xF1, 0x44, 0x37, 0xAA, 0x28, 0x05, 0xF2, 0x27,
2246 0x07, 0x36, 0xFC, 0xDA, 0x01, 0x41, 0xFF, 0x33, 0x00, 0xFD, 0xFF,
2247 0x00, 0x00, 0x23, 0x00, 0x73, 0xFF, 0x3D, 0x01, 0xD6, 0xFD, 0x46,
2248 0x03, 0x61, 0xFB, 0x00, 0x07, 0xBF, 0x48, 0x98, 0x00, 0x26, 0xFE,
2249 0xD5, 0x01, 0x95, 0xFE, 0xE3, 0x00, 0x96, 0xFF, 0x1A, 0x00, 0xFD,
2250 0xFF, 0x2A, 0x00, 0x5D, 0xFF, 0xA7, 0x01, 0x75, 0xFC, 0x03, 0x07,
2251 0x7D, 0xF1, 0x8A, 0x30, 0xFF, 0x2F, 0x7E, 0xF1, 0x0A, 0x07, 0x6E,
2252 0xFC, 0xAC, 0x01, 0x5A, 0xFF, 0x2B, 0x00, 0xFD, 0xFF, 0x1A, 0x00,
2253 0x94, 0xFF, 0xEA, 0x00, 0x87, 0xFE, 0xF0, 0x01, 0xF5, 0xFD, 0x05,
2254 0x01, 0xCE, 0x48, 0x83, 0x06, 0x94, 0xFB, 0x2C, 0x03, 0xE4, 0xFD,
2255 0x37, 0x01, 0x76, 0xFF, 0x22, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x33,
2256 0x00, 0x42, 0xFF, 0xD7, 0x01, 0x38, 0xFC, 0x29, 0x07, 0xF3, 0xF1,
2257 0x3E, 0x29, 0xC6, 0x36, 0xD4, 0xF1, 0x77, 0x06, 0xE6, 0xFC, 0x5C,
2258 0x01, 0x84, 0xFF, 0x1C, 0x00, 0xFE, 0xFF, 0x12, 0x00, 0xB6, 0xFF,
2259 0x93, 0x00, 0x3C, 0xFF, 0x9D, 0x00, 0x63, 0x00, 0xEB, 0xFB, 0x69,
2260 0x47, 0x2D, 0x0D, 0xFF, 0xF8, 0x72, 0x04, 0x42, 0xFD, 0x81, 0x01,
2261 0x59, 0xFF, 0x2B, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x37,
2262 0xFF, 0xE6, 0x01, 0x3A, 0xFC, 0xE2, 0x06, 0x28, 0xF3, 0x9E, 0x21,
2263 0xC0, 0x3C, 0x1F, 0xF3, 0x6C, 0x05, 0x9E, 0xFD, 0xED, 0x00, 0xBD,
2264 0xFF, 0x07, 0x00, 0x01, 0x00, 0x0A, 0x00, 0xD7, 0xFF, 0x3E, 0x00,
2265 0xEA, 0xFF, 0x60, 0xFF, 0x8F, 0x02, 0xCD, 0xF7, 0x99, 0x44, 0x68,
2266 0x14, 0x8E, 0xF6, 0x90, 0x05, 0xBC, 0xFC, 0xBA, 0x01, 0x43, 0xFF,
2267 0x32, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x35, 0x00, 0x39, 0xFF, 0xD7,
2268 0x01, 0x73, 0xFC, 0x3B, 0x06, 0xF5, 0xF4, 0xED, 0x19, 0xB7, 0x41,
2269 0x71, 0xF5, 0xEB, 0x03, 0x90, 0xFE, 0x60, 0x00, 0x04, 0x00, 0xED,
2270 0xFF, 0x06, 0x00, 0x04, 0x00, 0xF5, 0xFF, 0xEF, 0xFF, 0x88, 0x00,
2271 0x49, 0xFE, 0x5D, 0x04, 0xB7, 0xF4, 0x7D, 0x40, 0xFD, 0x1B, 0x6C,
2272 0xF4, 0x70, 0x06, 0x5F, 0xFC, 0xDE, 0x01, 0x37, 0xFF, 0x36, 0x00,
2273 0xFE, 0xFF, 0xFF, 0xFF, 0x30, 0x00, 0x48, 0xFF, 0xAD, 0x01, 0xDD,
2274 0xFC, 0x48, 0x05, 0x30, 0xF7, 0x6B, 0x12, 0x7D, 0x45, 0xCF, 0xF8,
2275 0x01, 0x02, 0xB2, 0xFF, 0xBD, 0xFF, 0x54, 0x00, 0xCE, 0xFF, 0x0C,
2276 0x00, 0x00, 0x00, 0x0E, 0x00, 0xAC, 0xFF, 0x0E, 0x01, 0x66, 0xFD,
2277 0xBF, 0x05, 0xAD, 0xF2, 0x3B, 0x3B, 0xB0, 0x23, 0xC4, 0xF2, 0xFF,
2278 0x06, 0x33, 0xFC, 0xE5, 0x01, 0x38, 0xFF, 0x36, 0x00, 0xFD, 0xFF,
2279 0x00, 0x00, 0x29, 0x00, 0x60, 0xFF, 0x6E, 0x01, 0x6B, 0xFD, 0x1D,
2280 0x04, 0xAF, 0xF9, 0x51, 0x0B, 0xEC, 0x47, 0x33, 0xFD, 0xC1, 0xFF,
2281 0xF7, 0x00, 0x0C, 0xFF, 0xAA, 0x00, 0xAD, 0xFF, 0x14, 0x00, 0xFE,
2282 0xFF, 0x21, 0x00, 0x77, 0xFF, 0x75, 0x01, 0xBF, 0xFC, 0xAB, 0x06,
2283 0xA6, 0xF1, 0x05, 0x35, 0x40, 0x2B, 0xBF, 0xF1, 0x2A, 0x07, 0x42,
2284 0xFC, 0xCE, 0x01, 0x48, 0xFF, 0x31, 0x00, 0xFD, 0xFF, 0x00, 0x00,
2285 0x20, 0x00, 0x7E, 0xFF, 0x21, 0x01, 0x12, 0xFE, 0xD1, 0x02, 0x47,
2286 0xFC, 0xD7, 0x04, 0xF0, 0x48, 0x8D, 0x02, 0x45, 0xFD, 0x4D, 0x02,
2287 0x56, 0xFE, 0x01, 0x01, 0x8B, 0xFF, 0x1D, 0x00, 0xFD, 0xFF, 0x2E,
2288 0x00, 0x52, 0xFF, 0xBC, 0x01, 0x58, 0xFC, 0x1D, 0x07, 0x8E, 0xF1,
2289 0x11, 0x2E, 0x6B, 0x32, 0x81, 0xF1, 0xE5, 0x06, 0x90, 0xFC, 0x94,
2290 0x01, 0x67, 0xFF, 0x26, 0x00, 0xFD, 0xFF, 0x17, 0x00, 0xA0, 0xFF,
2291 0xCC, 0x00, 0xC6, 0xFE, 0x79, 0x01, 0xD2, 0xFE, 0x26, 0xFF, 0x7C,
2292 0x48, 0xBE, 0x08, 0xAE, 0xFA, 0xA0, 0x03, 0xA9, 0xFD, 0x52, 0x01,
2293 0x6B, 0xFF, 0x25, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x35, 0x00, 0x3C,
2294 0xFF, 0xE0, 0x01, 0x32, 0xFC, 0x1C, 0x07, 0x4B, 0xF2, 0xA0, 0x26,
2295 0xF2, 0x38, 0x2A, 0xF2, 0x28, 0x06, 0x1F, 0xFD, 0x39, 0x01, 0x96,
2296 0xFF, 0x16, 0x00, 0xFF, 0xFF, 0x0F, 0x00, 0xC2, 0xFF, 0x75, 0x00,
2297 0x7A, 0xFF, 0x2B, 0x00, 0x2D, 0x01, 0x61, 0xFA, 0x97, 0x46, 0xA0,
2298 0x0F, 0x20, 0xF8, 0xDA, 0x04, 0x10, 0xFD, 0x97, 0x01, 0x50, 0xFF,
2299 0x2E, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE4,
2300 0x01, 0x48, 0xFC, 0xB2, 0x06, 0xB9, 0xF3, 0xF3, 0x1E, 0x98, 0x3E,
2301 0xCF, 0xF3, 0xF3, 0x04, 0xEB, 0xFD, 0xBF, 0x00, 0xD4, 0xFF, 0xFF,
2302 0xFF, 0x03, 0x00, 0x08, 0x00, 0xE2, 0xFF, 0x21, 0x00, 0x23, 0x00,
2303 0xFA, 0xFE, 0x3A, 0x03, 0x9D, 0xF6, 0x50, 0x43, 0x00, 0x17, 0xC6,
2304 0xF5, 0xE6, 0x05, 0x97, 0xFC, 0xC9, 0x01, 0x3E, 0xFF, 0x34, 0x00,
2305 0xFE, 0xFF, 0xFE, 0xFF, 0x34, 0x00, 0x3D, 0xFF, 0xCB, 0x01, 0x93,
2306 0xFC, 0xEF, 0x05, 0xB0, 0xF5, 0x4B, 0x17, 0x2A, 0x43, 0x7D, 0xF6,
2307 0x4D, 0x03, 0xEF, 0xFE, 0x2A, 0x00, 0x1E, 0x00, 0xE3, 0xFF, 0x08,
2308 0x00, 0x03, 0x00, 0xFE, 0xFF, 0xD7, 0xFF, 0xBA, 0x00, 0xF4, 0xFD,
2309 0xE5, 0x04, 0xE4, 0xF3, 0xCA, 0x3E, 0xA7, 0x1E, 0xCA, 0xF3, 0xAC,
2310 0x06, 0x4A, 0xFC, 0xE4, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFE, 0xFF,
2311 0xFF, 0xFF, 0x2E, 0x00, 0x4F, 0xFF, 0x99, 0x01, 0x0B, 0xFD, 0xE6,
2312 0x04, 0x08, 0xF8, 0xE7, 0x0F, 0x7C, 0x46, 0x37, 0xFA, 0x42, 0x01,
2313 0x1F, 0x00, 0x81, 0xFF, 0x71, 0x00, 0xC3, 0xFF, 0x0F, 0x00, 0xFF,
2314 0xFF, 0x15, 0x00, 0x98, 0xFF, 0x35, 0x01, 0x25, 0xFD, 0x1E, 0x06,
2315 0x35, 0xF2, 0x2E, 0x39, 0x55, 0x26, 0x56, 0xF2, 0x1A, 0x07, 0x31,
2316 0xFC, 0xE1, 0x01, 0x3C, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x00, 0x00,
2317 0x26, 0x00, 0x6A, 0xFF, 0x55, 0x01, 0xA3, 0xFD, 0xAD, 0x03, 0x94,
2318 0xFA, 0xFF, 0x08, 0x70, 0x48, 0xF3, 0xFE, 0xEA, 0xFE, 0x6C, 0x01,
2319 0xCD, 0xFE, 0xC9, 0x00, 0xA1, 0xFF, 0x17, 0x00, 0xFD, 0xFF, 0x26,
2320 0x00, 0x69, 0xFF, 0x91, 0x01, 0x94, 0xFC, 0xE0, 0x06, 0x84, 0xF1,
2321 0xAF, 0x32, 0xCA, 0x2D, 0x92, 0xF1, 0x1F, 0x07, 0x56, 0xFC, 0xBE,
2322 0x01, 0x51, 0xFF, 0x2E, 0x00, 0xFD, 0xFF, 0x1D, 0x00, 0x8A, 0xFF,
2323 0x04, 0x01, 0x50, 0xFE, 0x5A, 0x02, 0x2C, 0xFD, 0xC6, 0x02, 0xF2,
2324 0x48, 0x9B, 0x04, 0x61, 0xFC, 0xC3, 0x02, 0x19, 0xFE, 0x1E, 0x01,
2325 0x7F, 0xFF, 0x20, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x31, 0x00, 0x49,
2326 0xFF, 0xCC, 0x01, 0x44, 0xFC, 0x29, 0x07, 0xB9, 0xF1, 0x89, 0x2B,
2327 0xC3, 0x34, 0xA0, 0xF1, 0xB1, 0x06, 0xBA, 0xFC, 0x79, 0x01, 0x76,
2328 0xFF, 0x21, 0x00, 0xFE, 0xFF, 0x14, 0x00, 0xAC, 0xFF, 0xAE, 0x00,
2329 0x05, 0xFF, 0x03, 0x01, 0xAA, 0xFF, 0x63, 0xFD, 0xFD, 0x47, 0x0E,
2330 0x0B, 0xC8, 0xF9, 0x11, 0x04, 0x71, 0xFD, 0x6C, 0x01, 0x61, 0xFF,
2331 0x28, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x39, 0xFF, 0xE5,
2332 0x01, 0x33, 0xFC, 0x03, 0x07, 0xB7, 0xF2, 0xFC, 0x23, 0x03, 0x3B,
2333 0x9E, 0xF2, 0xCB, 0x05, 0x5F, 0xFD, 0x12, 0x01, 0xAA, 0xFF, 0x0E,
2334 0x00, 0x00, 0x00, 0x0C, 0x00, 0xCD, 0xFF, 0x57, 0x00, 0xB6, 0xFF,
2335 0xBE, 0xFF, 0xED, 0x01, 0xF5, 0xF8, 0x9B, 0x45, 0x22, 0x12, 0x48,
2336 0xF7, 0x3D, 0x05, 0xE2, 0xFC, 0xAB, 0x01, 0x49, 0xFF, 0x30, 0x00,
2337 0xFF, 0xFF, 0xFE, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xDF, 0x01, 0x5C,
2338 0xFC, 0x78, 0x06, 0x5A, 0xF4, 0x49, 0x1C, 0x4E, 0x40, 0x9E, 0xF4,
2339 0x6D, 0x04, 0x3F, 0xFE, 0x8E, 0x00, 0xED, 0xFF, 0xF6, 0xFF, 0x04,
2340 0x00, 0x06, 0x00, 0xEC, 0xFF, 0x06, 0x00, 0x5A, 0x00, 0x9A, 0xFE,
2341 0xDA, 0x03, 0x8D, 0xF5, 0xE1, 0x41, 0xA1, 0x19, 0x09, 0xF5, 0x33,
2342 0x06, 0x77, 0xFC, 0xD6, 0x01, 0x3A, 0xFF, 0x35, 0x00, 0xFE, 0xFF,
2343 0xFF, 0xFF, 0x32, 0x00, 0x42, 0xFF, 0xBC, 0x01, 0xB8, 0xFC, 0x9A,
2344 0x05, 0x77, 0xF6, 0xB1, 0x14, 0x77, 0x44, 0xA9, 0xF7, 0xA2, 0x02,
2345 0x54, 0xFF, 0xF1, 0xFF, 0x3A, 0x00, 0xD8, 0xFF, 0x0A, 0x00, 0x01,
2346 0x00, 0x07, 0x00, 0xC0, 0xFF, 0xE8, 0x00, 0xA6, 0xFD, 0x5F, 0x05,
2347 0x31, 0xF3, 0xF6, 0x3C, 0x52, 0x21, 0x37, 0xF3, 0xDD, 0x06, 0x3B,
2348 0xFC, 0xE6, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x00, 0x00,
2349 0x2B, 0x00, 0x58, 0xFF, 0x83, 0x01, 0x3C, 0xFD, 0x7E, 0x04, 0xE6,
2350 0xF8, 0x72, 0x0D, 0x52, 0x47, 0xBE, 0xFB, 0x7A, 0x00, 0x90, 0x00,
2351 0x43, 0xFF, 0x8F, 0x00, 0xB7, 0xFF, 0x11, 0x00, 0xFE, 0xFF, 0x1C,
2352 0x00, 0x86, 0xFF, 0x59, 0x01, 0xEC, 0xFC, 0x6F, 0x06, 0xDC, 0xF1,
2353 0x04, 0x37, 0xF3, 0x28, 0xFC, 0xF1, 0x28, 0x07, 0x37, 0xFC, 0xD8,
2354 0x01, 0x41, 0xFF, 0x33, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x23, 0x00,
2355 0x74, 0xFF, 0x3A, 0x01, 0xDD, 0xFD, 0x39, 0x03, 0x7B, 0xFB, 0xC1,
2356 0x06, 0xC7, 0x48, 0xCF, 0x00, 0x0D, 0xFE, 0xE3, 0x01, 0x8E, 0xFE,
2357 0xE7, 0x00, 0x95, 0xFF, 0x1A, 0x00, 0xFD, 0xFF, 0x2A, 0x00, 0x5C,
2358 0xFF, 0xAA, 0x01, 0x71, 0xFC, 0x07, 0x07, 0x7E, 0xF1, 0x44, 0x30,
2359 0x44, 0x30, 0x7E, 0xF1, 0x07, 0x07, 0x71, 0xFC, 0xAA, 0x01, 0x5C,
2360 0xFF, 0x2A, 0x00, 0xFD, 0xFF, 0x1A, 0x00, 0x95, 0xFF, 0xE7, 0x00,
2361 0x8E, 0xFE, 0xE3, 0x01, 0x0D, 0xFE, 0xCF, 0x00, 0xC7, 0x48, 0xC1,
2362 0x06, 0x7B, 0xFB, 0x39, 0x03, 0xDD, 0xFD, 0x3A, 0x01, 0x74, 0xFF,
2363 0x23, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x33, 0x00, 0x41, 0xFF, 0xD8,
2364 0x01, 0x37, 0xFC, 0x28, 0x07, 0xFC, 0xF1, 0xF3, 0x28, 0x04, 0x37,
2365 0xDC, 0xF1, 0x6F, 0x06, 0xEC, 0xFC, 0x59, 0x01, 0x86, 0xFF, 0x1C,
2366 0x00, 0xFE, 0xFF, 0x11, 0x00, 0xB7, 0xFF, 0x8F, 0x00, 0x43, 0xFF,
2367 0x90, 0x00, 0x7A, 0x00, 0xBE, 0xFB, 0x52, 0x47, 0x72, 0x0D, 0xE6,
2368 0xF8, 0x7E, 0x04, 0x3C, 0xFD, 0x83, 0x01, 0x58, 0xFF, 0x2B, 0x00,
2369 0x00, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3B,
2370 0xFC, 0xDD, 0x06, 0x37, 0xF3, 0x52, 0x21, 0xF6, 0x3C, 0x31, 0xF3,
2371 0x5F, 0x05, 0xA6, 0xFD, 0xE8, 0x00, 0xC0, 0xFF, 0x07, 0x00, 0x01,
2372 0x00, 0x0A, 0x00, 0xD8, 0xFF, 0x3A, 0x00, 0xF1, 0xFF, 0x54, 0xFF,
2373 0xA2, 0x02, 0xA9, 0xF7, 0x77, 0x44, 0xB1, 0x14, 0x77, 0xF6, 0x9A,
2374 0x05, 0xB8, 0xFC, 0xBC, 0x01, 0x42, 0xFF, 0x32, 0x00, 0xFF, 0xFF,
2375 0xFE, 0xFF, 0x35, 0x00, 0x3A, 0xFF, 0xD6, 0x01, 0x77, 0xFC, 0x33,
2376 0x06, 0x09, 0xF5, 0xA1, 0x19, 0xE1, 0x41, 0x8D, 0xF5, 0xDA, 0x03,
2377 0x9A, 0xFE, 0x5A, 0x00, 0x06, 0x00, 0xEC, 0xFF, 0x06, 0x00, 0x04,
2378 0x00, 0xF6, 0xFF, 0xED, 0xFF, 0x8E, 0x00, 0x3F, 0xFE, 0x6D, 0x04,
2379 0x9E, 0xF4, 0x4E, 0x40, 0x49, 0x1C, 0x5A, 0xF4, 0x78, 0x06, 0x5C,
2380 0xFC, 0xDF, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0xFF, 0xFF,
2381 0x30, 0x00, 0x49, 0xFF, 0xAB, 0x01, 0xE2, 0xFC, 0x3D, 0x05, 0x48,
2382 0xF7, 0x22, 0x12, 0x9B, 0x45, 0xF5, 0xF8, 0xED, 0x01, 0xBE, 0xFF,
2383 0xB6, 0xFF, 0x57, 0x00, 0xCD, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x0E,
2384 0x00, 0xAA, 0xFF, 0x12, 0x01, 0x5F, 0xFD, 0xCB, 0x05, 0x9E, 0xF2,
2385 0x03, 0x3B, 0xFC, 0x23, 0xB7, 0xF2, 0x03, 0x07, 0x33, 0xFC, 0xE5,
2386 0x01, 0x39, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x28, 0x00,
2387 0x61, 0xFF, 0x6C, 0x01, 0x71, 0xFD, 0x11, 0x04, 0xC8, 0xF9, 0x0E,
2388 0x0B, 0xFD, 0x47, 0x63, 0xFD, 0xAA, 0xFF, 0x03, 0x01, 0x05, 0xFF,
2389 0xAE, 0x00, 0xAC, 0xFF, 0x14, 0x00, 0xFE, 0xFF, 0x21, 0x00, 0x76,
2390 0xFF, 0x79, 0x01, 0xBA, 0xFC, 0xB1, 0x06, 0xA0, 0xF1, 0xC3, 0x34,
2391 0x89, 0x2B, 0xB9, 0xF1, 0x29, 0x07, 0x44, 0xFC, 0xCC, 0x01, 0x49,
2392 0xFF, 0x31, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x20, 0x00, 0x7F, 0xFF,
2393 0x1E, 0x01, 0x19, 0xFE, 0xC3, 0x02, 0x61, 0xFC, 0x9B, 0x04, 0xF2,
2394 0x48, 0xC6, 0x02, 0x2C, 0xFD, 0x5A, 0x02, 0x50, 0xFE, 0x04, 0x01,
2395 0x8A, 0xFF, 0x1D, 0x00, 0xFD, 0xFF, 0x2E, 0x00, 0x51, 0xFF, 0xBE,
2396 0x01, 0x56, 0xFC, 0x1F, 0x07, 0x92, 0xF1, 0xCA, 0x2D, 0xAF, 0x32,
2397 0x84, 0xF1, 0xE0, 0x06, 0x94, 0xFC, 0x91, 0x01, 0x69, 0xFF, 0x26,
2398 0x00, 0xFD, 0xFF, 0x17, 0x00, 0xA1, 0xFF, 0xC9, 0x00, 0xCD, 0xFE,
2399 0x6C, 0x01, 0xEA, 0xFE, 0xF3, 0xFE, 0x70, 0x48, 0xFF, 0x08, 0x94,
2400 0xFA, 0xAD, 0x03, 0xA3, 0xFD, 0x55, 0x01, 0x6A, 0xFF, 0x26, 0x00,
2401 0x00, 0x00, 0xFD, 0xFF, 0x35, 0x00, 0x3C, 0xFF, 0xE1, 0x01, 0x31,
2402 0xFC, 0x1A, 0x07, 0x56, 0xF2, 0x55, 0x26, 0x2E, 0x39, 0x35, 0xF2,
2403 0x1E, 0x06, 0x25, 0xFD, 0x35, 0x01, 0x98, 0xFF, 0x15, 0x00, 0xFF,
2404 0xFF, 0x0F, 0x00, 0xC3, 0xFF, 0x71, 0x00, 0x81, 0xFF, 0x1F, 0x00,
2405 0x42, 0x01, 0x37, 0xFA, 0x7C, 0x46, 0xE7, 0x0F, 0x08, 0xF8, 0xE6,
2406 0x04, 0x0B, 0xFD, 0x99, 0x01, 0x4F, 0xFF, 0x2E, 0x00, 0xFF, 0xFF,
2407 0xFE, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE4, 0x01, 0x4A, 0xFC, 0xAC,
2408 0x06, 0xCA, 0xF3, 0xA7, 0x1E, 0xCA, 0x3E, 0xE4, 0xF3, 0xE5, 0x04,
2409 0xF4, 0xFD, 0xBA, 0x00, 0xD7, 0xFF, 0xFE, 0xFF, 0x03, 0x00, 0x08,
2410 0x00, 0xE3, 0xFF, 0x1E, 0x00, 0x2A, 0x00, 0xEF, 0xFE, 0x4D, 0x03,
2411 0x7D, 0xF6, 0x2A, 0x43, 0x4B, 0x17, 0xB0, 0xF5, 0xEF, 0x05, 0x93,
2412 0xFC, 0xCB, 0x01, 0x3D, 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0xFE, 0xFF,
2413 0x34, 0x00, 0x3E, 0xFF, 0xC9, 0x01, 0x97, 0xFC, 0xE6, 0x05, 0xC6,
2414 0xF5, 0x00, 0x17, 0x50, 0x43, 0x9D, 0xF6, 0x3A, 0x03, 0xFA, 0xFE,
2415 0x23, 0x00, 0x21, 0x00, 0xE2, 0xFF, 0x08, 0x00, 0x03, 0x00, 0xFF,
2416 0xFF, 0xD4, 0xFF, 0xBF, 0x00, 0xEB, 0xFD, 0xF3, 0x04, 0xCF, 0xF3,
2417 0x98, 0x3E, 0xF3, 0x1E, 0xB9, 0xF3, 0xB2, 0x06, 0x48, 0xFC, 0xE4,
2418 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x2E, 0x00,
2419 0x50, 0xFF, 0x97, 0x01, 0x10, 0xFD, 0xDA, 0x04, 0x20, 0xF8, 0xA0,
2420 0x0F, 0x97, 0x46, 0x61, 0xFA, 0x2D, 0x01, 0x2B, 0x00, 0x7A, 0xFF,
2421 0x75, 0x00, 0xC2, 0xFF, 0x0F, 0x00, 0xFF, 0xFF, 0x16, 0x00, 0x96,
2422 0xFF, 0x39, 0x01, 0x1F, 0xFD, 0x28, 0x06, 0x2A, 0xF2, 0xF2, 0x38,
2423 0xA0, 0x26, 0x4B, 0xF2, 0x1C, 0x07, 0x32, 0xFC, 0xE0, 0x01, 0x3C,
2424 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x25, 0x00, 0x6B, 0xFF,
2425 0x52, 0x01, 0xA9, 0xFD, 0xA0, 0x03, 0xAE, 0xFA, 0xBE, 0x08, 0x7C,
2426 0x48, 0x26, 0xFF, 0xD2, 0xFE, 0x79, 0x01, 0xC6, 0xFE, 0xCC, 0x00,
2427 0xA0, 0xFF, 0x17, 0x00, 0xFD, 0xFF, 0x26, 0x00, 0x67, 0xFF, 0x94,
2428 0x01, 0x90, 0xFC, 0xE5, 0x06, 0x81, 0xF1, 0x6B, 0x32, 0x11, 0x2E,
2429 0x8E, 0xF1, 0x1D, 0x07, 0x58, 0xFC, 0xBC, 0x01, 0x52, 0xFF, 0x2E,
2430 0x00, 0xFD, 0xFF, 0x1D, 0x00, 0x8B, 0xFF, 0x01, 0x01, 0x56, 0xFE,
2431 0x4D, 0x02, 0x45, 0xFD, 0x8D, 0x02, 0xF0, 0x48, 0xD7, 0x04, 0x47,
2432 0xFC, 0xD1, 0x02, 0x12, 0xFE, 0x21, 0x01, 0x7E, 0xFF, 0x20, 0x00,
2433 0x00, 0x00, 0xFD, 0xFF, 0x31, 0x00, 0x48, 0xFF, 0xCE, 0x01, 0x42,
2434 0xFC, 0x2A, 0x07, 0xBF, 0xF1, 0x40, 0x2B, 0x05, 0x35, 0xA6, 0xF1,
2435 0xAB, 0x06, 0xBF, 0xFC, 0x75, 0x01, 0x77, 0xFF, 0x21, 0x00, 0xFE,
2436 0xFF, 0x14, 0x00, 0xAD, 0xFF, 0xAA, 0x00, 0x0C, 0xFF, 0xF7, 0x00,
2437 0xC1, 0xFF, 0x33, 0xFD, 0xEC, 0x47, 0x51, 0x0B, 0xAF, 0xF9, 0x1D,
2438 0x04, 0x6B, 0xFD, 0x6E, 0x01, 0x60, 0xFF, 0x29, 0x00, 0x00, 0x00,
2439 0xFD, 0xFF, 0x36, 0x00, 0x38, 0xFF, 0xE5, 0x01, 0x33, 0xFC, 0xFF,
2440 0x06, 0xC4, 0xF2, 0xB0, 0x23, 0x3B, 0x3B, 0xAD, 0xF2, 0xBF, 0x05,
2441 0x66, 0xFD, 0x0E, 0x01, 0xAC, 0xFF, 0x0E, 0x00, 0x00, 0x00, 0x0C,
2442 0x00, 0xCE, 0xFF, 0x54, 0x00, 0xBD, 0xFF, 0xB2, 0xFF, 0x01, 0x02,
2443 0xCF, 0xF8, 0x7D, 0x45, 0x6B, 0x12, 0x30, 0xF7, 0x48, 0x05, 0xDD,
2444 0xFC, 0xAD, 0x01, 0x48, 0xFF, 0x30, 0x00, 0xFF, 0xFF, 0xFE, 0xFF,
2445 0x36, 0x00, 0x37, 0xFF, 0xDE, 0x01, 0x5F, 0xFC, 0x70, 0x06, 0x6C,
2446 0xF4, 0xFD, 0x1B, 0x7D, 0x40, 0xB7, 0xF4, 0x5D, 0x04, 0x49, 0xFE,
2447 0x88, 0x00, 0xEF, 0xFF, 0xF5, 0xFF, 0x04, 0x00, 0x06, 0x00, 0xED,
2448 0xFF, 0x04, 0x00, 0x60, 0x00, 0x90, 0xFE, 0xEB, 0x03, 0x71, 0xF5,
2449 0xB7, 0x41, 0xED, 0x19, 0xF5, 0xF4, 0x3B, 0x06, 0x73, 0xFC, 0xD7,
2450 0x01, 0x39, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x32, 0x00,
2451 0x43, 0xFF, 0xBA, 0x01, 0xBC, 0xFC, 0x90, 0x05, 0x8E, 0xF6, 0x68,
2452 0x14, 0x99, 0x44, 0xCD, 0xF7, 0x8F, 0x02, 0x60, 0xFF, 0xEA, 0xFF,
2453 0x3E, 0x00, 0xD7, 0xFF, 0x0A, 0x00, 0x01, 0x00, 0x07, 0x00, 0xBD,
2454 0xFF, 0xED, 0x00, 0x9E, 0xFD, 0x6C, 0x05, 0x1F, 0xF3, 0xC0, 0x3C,
2455 0x9E, 0x21, 0x28, 0xF3, 0xE2, 0x06, 0x3A, 0xFC, 0xE6, 0x01, 0x37,
2456 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x2B, 0x00, 0x59, 0xFF,
2457 0x81, 0x01, 0x42, 0xFD, 0x72, 0x04, 0xFF, 0xF8, 0x2D, 0x0D, 0x69,
2458 0x47, 0xEB, 0xFB, 0x63, 0x00, 0x9D, 0x00, 0x3C, 0xFF, 0x93, 0x00,
2459 0xB6, 0xFF, 0x12, 0x00, 0xFE, 0xFF, 0x1C, 0x00, 0x84, 0xFF, 0x5C,
2460 0x01, 0xE6, 0xFC, 0x77, 0x06, 0xD4, 0xF1, 0xC6, 0x36, 0x3E, 0x29,
2461 0xF3, 0xF1, 0x29, 0x07, 0x38, 0xFC, 0xD7, 0x01, 0x42, 0xFF, 0x33,
2462 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x22, 0x00, 0x76, 0xFF, 0x37, 0x01,
2463 0xE4, 0xFD, 0x2C, 0x03, 0x94, 0xFB, 0x83, 0x06, 0xCE, 0x48, 0x05,
2464 0x01, 0xF5, 0xFD, 0xF0, 0x01, 0x87, 0xFE, 0xEA, 0x00, 0x94, 0xFF,
2465 0x1A, 0x00, 0xFD, 0xFF, 0x2B, 0x00, 0x5A, 0xFF, 0xAC, 0x01, 0x6E,
2466 0xFC, 0x0A, 0x07, 0x7E, 0xF1, 0xFF, 0x2F, 0x8A, 0x30, 0x7D, 0xF1,
2467 0x03, 0x07, 0x75, 0xFC, 0xA7, 0x01, 0x5D, 0xFF, 0x2A, 0x00, 0xFD,
2468 0xFF, 0x1A, 0x00, 0x96, 0xFF, 0xE3, 0x00, 0x95, 0xFE, 0xD5, 0x01,
2469 0x26, 0xFE, 0x98, 0x00, 0xBF, 0x48, 0x00, 0x07, 0x61, 0xFB, 0x46,
2470 0x03, 0xD6, 0xFD, 0x3D, 0x01, 0x73, 0xFF, 0x23, 0x00, 0x00, 0x00,
2471 0xFD, 0xFF, 0x33, 0x00, 0x41, 0xFF, 0xDA, 0x01, 0x36, 0xFC, 0x27,
2472 0x07, 0x05, 0xF2, 0xAA, 0x28, 0x44, 0x37, 0xE4, 0xF1, 0x67, 0x06,
2473 0xF2, 0xFC, 0x55, 0x01, 0x88, 0xFF, 0x1B, 0x00, 0xFE, 0xFF, 0x11,
2474 0x00, 0xB9, 0xFF, 0x8C, 0x00, 0x4A, 0xFF, 0x83, 0x00, 0x91, 0x00,
2475 0x91, 0xFB, 0x3D, 0x47, 0xB7, 0x0D, 0xCD, 0xF8, 0x89, 0x04, 0x36,
2476 0xFD, 0x86, 0x01, 0x57, 0xFF, 0x2B, 0x00, 0x00, 0x00, 0xFD, 0xFF,
2477 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3C, 0xFC, 0xD8, 0x06, 0x47,
2478 0xF3, 0x06, 0x21, 0x2A, 0x3D, 0x44, 0xF3, 0x52, 0x05, 0xAE, 0xFD,
2479 0xE3, 0x00, 0xC2, 0xFF, 0x06, 0x00, 0x01, 0x00, 0x0A, 0x00, 0xD9,
2480 0xFF, 0x37, 0x00, 0xF7, 0xFF, 0x49, 0xFF, 0xB6, 0x02, 0x86, 0xF7,
2481 0x53, 0x44, 0xFB, 0x14, 0x61, 0xF6, 0xA4, 0x05, 0xB4, 0xFC, 0xBE,
2482 0x01, 0x42, 0xFF, 0x32, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x35, 0x00,
2483 0x3A, 0xFF, 0xD4, 0x01, 0x7A, 0xFC, 0x2B, 0x06, 0x1E, 0xF5, 0x56,
2484 0x19, 0x0C, 0x42, 0xAA, 0xF5, 0xC9, 0x03, 0xA4, 0xFE, 0x54, 0x00,
2485 0x09, 0x00, 0xEB, 0xFF, 0x06, 0x00, 0x04, 0x00, 0xF7, 0xFF, 0xEA,
2486 0xFF, 0x93, 0x00, 0x36, 0xFE, 0x7D, 0x04, 0x85, 0xF4, 0x1F, 0x40,
2487 0x94, 0x1C, 0x47, 0xF4, 0x7E, 0x06, 0x5A, 0xFC, 0xDF, 0x01, 0x37,
2488 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x30, 0x00, 0x4A, 0xFF,
2489 0xA9, 0x01, 0xE7, 0xFC, 0x33, 0x05, 0x60, 0xF7, 0xDA, 0x11, 0xB8,
2490 0x45, 0x1C, 0xF9, 0xD8, 0x01, 0xCA, 0xFF, 0xAF, 0xFF, 0x5A, 0x00,
2491 0xCC, 0xFF, 0x0D, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xA8, 0xFF, 0x17,
2492 0x01, 0x57, 0xFD, 0xD6, 0x05, 0x90, 0xF2, 0xC8, 0x3A, 0x46, 0x24,
2493 0xAA, 0xF2, 0x06, 0x07, 0x32, 0xFC, 0xE5, 0x01, 0x39, 0xFF, 0x36,
2494 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x28, 0x00, 0x62, 0xFF, 0x69, 0x01,
2495 0x77, 0xFD, 0x04, 0x04, 0xE2, 0xF9, 0xCB, 0x0A, 0x0D, 0x48, 0x94,
2496 0xFD, 0x92, 0xFF, 0x10, 0x01, 0xFE, 0xFE, 0xB1, 0x00, 0xAA, 0xFF,
2497 0x15, 0x00, 0xFE, 0xFF, 0x22, 0x00, 0x74, 0xFF, 0x7C, 0x01, 0xB5,
2498 0xFC, 0xB8, 0x06, 0x9C, 0xF1, 0x81, 0x34, 0xD1, 0x2B, 0xB3, 0xF1,
2499 0x29, 0x07, 0x46, 0xFC, 0xCA, 0x01, 0x4A, 0xFF, 0x30, 0x00, 0xFD,
2500 0xFF, 0x00, 0x00, 0x1F, 0x00, 0x81, 0xFF, 0x1B, 0x01, 0x20, 0xFE,
2501 0xB6, 0x02, 0x7A, 0xFC, 0x5F, 0x04, 0xF4, 0x48, 0xFF, 0x02, 0x13,
2502 0xFD, 0x67, 0x02, 0x49, 0xFE, 0x07, 0x01, 0x88, 0xFF, 0x1D, 0x00,
2503 0xFD, 0xFF, 0x2E, 0x00, 0x50, 0xFF, 0xC0, 0x01, 0x53, 0xFC, 0x21,
2504 0x07, 0x96, 0xF1, 0x82, 0x2D, 0xF2, 0x32, 0x86, 0xF1, 0xDB, 0x06,
2505 0x99, 0xFC, 0x8E, 0x01, 0x6A, 0xFF, 0x25, 0x00, 0xFD, 0xFF, 0x16,
2506 0x00, 0xA2, 0xFF, 0xC5, 0x00, 0xD4, 0xFE, 0x5F, 0x01, 0x03, 0xFF,
2507 0xBF, 0xFE, 0x63, 0x48, 0x40, 0x09, 0x7B, 0xFA, 0xB9, 0x03, 0x9D,
2508 0xFD, 0x58, 0x01, 0x69, 0xFF, 0x26, 0x00, 0x00, 0x00, 0xFD, 0xFF,
2509 0x35, 0x00, 0x3B, 0xFF, 0xE2, 0x01, 0x31, 0xFC, 0x17, 0x07, 0x61,
2510 0xF2, 0x0A, 0x26, 0x6A, 0x39, 0x41, 0xF2, 0x15, 0x06, 0x2C, 0xFD,
2511 0x31, 0x01, 0x9B, 0xFF, 0x14, 0x00, 0xFF, 0xFF, 0x0E, 0x00, 0xC4,
2512 0xFF, 0x6E, 0x00, 0x87, 0xFF, 0x13, 0x00, 0x58, 0x01, 0x0D, 0xFA,
2513 0x61, 0x46, 0x2D, 0x10, 0xF0, 0xF7, 0xF1, 0x04, 0x05, 0xFD, 0x9C,
2514 0x01, 0x4E, 0xFF, 0x2E, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x36, 0x00,
2515 0x36, 0xFF, 0xE3, 0x01, 0x4C, 0xFC, 0xA6, 0x06, 0xDB, 0xF3, 0x5B,
2516 0x1E, 0xFC, 0x3E, 0xFA, 0xF3, 0xD7, 0x04, 0xFD, 0xFD, 0xB4, 0x00,
2517 0xD9, 0xFF, 0xFD, 0xFF, 0x03, 0x00, 0x08, 0x00, 0xE4, 0xFF, 0x1B,
2518 0x00, 0x30, 0x00, 0xE4, 0xFE, 0x5F, 0x03, 0x5E, 0xF6, 0x02, 0x43,
2519 0x96, 0x17, 0x9B, 0xF5, 0xF8, 0x05, 0x8F, 0xFC, 0xCC, 0x01, 0x3D,
2520 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x33, 0x00, 0x3E, 0xFF,
2521 0xC8, 0x01, 0x9B, 0xFC, 0xDD, 0x05, 0xDC, 0xF5, 0xB6, 0x16, 0x77,
2522 0x43, 0xBD, 0xF6, 0x28, 0x03, 0x05, 0xFF, 0x1D, 0x00, 0x25, 0x00,
2523 0xE1, 0xFF, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0xD2, 0xFF, 0xC4,
2524 0x00, 0xE2, 0xFD, 0x01, 0x05, 0xBA, 0xF3, 0x64, 0x3E, 0x3F, 0x1F,
2525 0xA8, 0xF3, 0xB8, 0x06, 0x46, 0xFC, 0xE5, 0x01, 0x36, 0xFF, 0x36,
2526 0x00, 0xFD, 0xFF, 0xFF, 0xFF, 0x2D, 0x00, 0x51, 0xFF, 0x95, 0x01,
2527 0x15, 0xFD, 0xCF, 0x04, 0x39, 0xF8, 0x59, 0x0F, 0xAF, 0x46, 0x8B,
2528 0xFA, 0x17, 0x01, 0x38, 0x00, 0x73, 0xFF, 0x78, 0x00, 0xC0, 0xFF,
2529 0x0F, 0x00, 0xFF, 0xFF, 0x16, 0x00, 0x94, 0xFF, 0x3D, 0x01, 0x18,
2530 0xFD, 0x32, 0x06, 0x1F, 0xF2, 0xB5, 0x38, 0xEB, 0x26, 0x40, 0xF2,
2531 0x1E, 0x07, 0x32, 0xFC, 0xDF, 0x01, 0x3D, 0xFF, 0x35, 0x00, 0xFD,
2532 0xFF, 0x00, 0x00, 0x25, 0x00, 0x6C, 0xFF, 0x4F, 0x01, 0xB0, 0xFD,
2533 0x93, 0x03, 0xC7, 0xFA, 0x7D, 0x08, 0x86, 0x48, 0x5A, 0xFF, 0xBA,
2534 0xFE, 0x86, 0x01, 0xBF, 0xFE, 0xCF, 0x00, 0x9E, 0xFF, 0x17, 0x00,
2535 0xFD, 0xFF, 0x27, 0x00, 0x66, 0xFF, 0x97, 0x01, 0x8C, 0xFC, 0xEA,
2536 0x06, 0x80, 0xF1, 0x26, 0x32, 0x58, 0x2E, 0x8B, 0xF1, 0x1B, 0x07,
2537 0x5B, 0xFC, 0xBA, 0x01, 0x53, 0xFF, 0x2D, 0x00, 0xFD, 0xFF, 0x1C,
2538 0x00, 0x8C, 0xFF, 0xFE, 0x00, 0x5D, 0xFE, 0x3F, 0x02, 0x5E, 0xFD,
2539 0x54, 0x02, 0xEC, 0x48, 0x13, 0x05, 0x2E, 0xFC, 0xDE, 0x02, 0x0C,
2540 0xFE, 0x24, 0x01, 0x7D, 0xFF, 0x20, 0x00, 0x00, 0x00, 0xFD, 0xFF,
2541 0x31, 0x00, 0x47, 0xFF, 0xCF, 0x01, 0x40, 0xFC, 0x2A, 0x07, 0xC6,
2542 0xF1, 0xF7, 0x2A, 0x46, 0x35, 0xAB, 0xF1, 0xA4, 0x06, 0xC4, 0xFC,
2543 0x72, 0x01, 0x79, 0xFF, 0x20, 0x00, 0xFE, 0xFF, 0x14, 0x00, 0xAE,
2544 0xFF, 0xA7, 0x00, 0x12, 0xFF, 0xEA, 0x00, 0xD9, 0xFF, 0x03, 0xFD,
2545 0xDC, 0x47, 0x95, 0x0B, 0x96, 0xF9, 0x29, 0x04, 0x65, 0xFD, 0x71,
2546 0x01, 0x5F, 0xFF, 0x29, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x36, 0x00,
2547 0x38, 0xFF, 0xE6, 0x01, 0x34, 0xFC, 0xFB, 0x06, 0xD2, 0xF2, 0x64,
2548 0x23, 0x73, 0x3B, 0xBC, 0xF2, 0xB4, 0x05, 0x6E, 0xFD, 0x09, 0x01,
2549 0xAF, 0xFF, 0x0D, 0x00, 0x00, 0x00, 0x0C, 0x00, 0xD0, 0xFF, 0x51,
2550 0x00, 0xC3, 0xFF, 0xA6, 0xFF, 0x16, 0x02, 0xA9, 0xF8, 0x5C, 0x45,
2551 0xB2, 0x12, 0x19, 0xF7, 0x52, 0x05, 0xD8, 0xFC, 0xAF, 0x01, 0x47,
2552 0xFF, 0x30, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x36, 0x00, 0x38, 0xFF,
2553 0xDD, 0x01, 0x62, 0xFC, 0x69, 0x06, 0x7F, 0xF4, 0xB2, 0x1B, 0xAB,
2554 0x40, 0xD0, 0xF4, 0x4E, 0x04, 0x53, 0xFE, 0x83, 0x00, 0xF2, 0xFF,
2555 0xF4, 0xFF, 0x05, 0x00, 0x06, 0x00, 0xEE, 0xFF, 0x01, 0x00, 0x66,
2556 0x00, 0x85, 0xFE, 0xFC, 0x03, 0x55, 0xF5, 0x8C, 0x41, 0x38, 0x1A,
2557 0xE1, 0xF4, 0x43, 0x06, 0x70, 0xFC, 0xD8, 0x01, 0x39, 0xFF, 0x35,
2558 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x32, 0x00, 0x44, 0xFF, 0xB9, 0x01,
2559 0xC1, 0xFC, 0x86, 0x05, 0xA5, 0xF6, 0x1E, 0x14, 0xBA, 0x44, 0xF0,
2560 0xF7, 0x7B, 0x02, 0x6B, 0xFF, 0xE4, 0xFF, 0x41, 0x00, 0xD6, 0xFF,
2561 0x0B, 0x00, 0x01, 0x00, 0x08, 0x00, 0xBB, 0xFF, 0xF1, 0x00, 0x96,
2562 0xFD, 0x78, 0x05, 0x0E, 0xF3, 0x8A, 0x3C, 0xEA, 0x21, 0x19, 0xF3,
2563 0xE6, 0x06, 0x38, 0xFC, 0xE6, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD,
2564 0xFF, 0x00, 0x00, 0x2B, 0x00, 0x5A, 0xFF, 0x7E, 0x01, 0x48, 0xFD,
2565 0x66, 0x04, 0x18, 0xF9, 0xE8, 0x0C, 0x7C, 0x47, 0x19, 0xFC, 0x4D,
2566 0x00, 0xA9, 0x00, 0x35, 0xFF, 0x96, 0x00, 0xB5, 0xFF, 0x12, 0x00,
2567 0xFE, 0xFF, 0x1D, 0x00, 0x82, 0xFF, 0x60, 0x01, 0xE0, 0xFC, 0x7F,
2568 0x06, 0xCC, 0xF1, 0x85, 0x36, 0x87, 0x29, 0xEB, 0xF1, 0x2A, 0x07,
2569 0x39, 0xFC, 0xD6, 0x01, 0x43, 0xFF, 0x33, 0x00, 0xFD, 0xFF, 0x00,
2570 0x00, 0x22, 0x00, 0x77, 0xFF, 0x34, 0x01, 0xEA, 0xFD, 0x1F, 0x03,
2571 0xAE, 0xFB, 0x45, 0x06, 0xD5, 0x48, 0x3C, 0x01, 0xDC, 0xFD, 0xFD,
2572 0x01, 0x80, 0xFE, 0xED, 0x00, 0x93, 0xFF, 0x1B, 0x00, 0xFD, 0xFF,
2573 0x2B, 0x00, 0x59, 0xFF, 0xAE, 0x01, 0x6A, 0xFC, 0x0D, 0x07, 0x80,
2574 0xF1, 0xB8, 0x2F, 0xCF, 0x30, 0x7D, 0xF1, 0xFF, 0x06, 0x78, 0xFC,
2575 0xA5, 0x01, 0x5F, 0xFF, 0x29, 0x00, 0xFD, 0xFF, 0x19, 0x00, 0x98,
2576 0xFF, 0xE0, 0x00, 0x9C, 0xFE, 0xC8, 0x01, 0x3F, 0xFE, 0x62, 0x00,
2577 0xB8, 0x48, 0x3F, 0x07, 0x47, 0xFB, 0x53, 0x03, 0xD0, 0xFD, 0x40,
2578 0x01, 0x72, 0xFF, 0x23, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x34, 0x00,
2579 0x40, 0xFF, 0xDB, 0x01, 0x35, 0xFC, 0x26, 0x07, 0x0E, 0xF2, 0x60,
2580 0x28, 0x82, 0x37, 0xED, 0xF1, 0x5E, 0x06, 0xF8, 0xFC, 0x51, 0x01,
2581 0x8A, 0xFF, 0x1A, 0x00, 0xFF, 0xFF, 0x11, 0x00, 0xBA, 0xFF, 0x89,
2582 0x00, 0x51, 0xFF, 0x77, 0x00, 0xA7, 0x00, 0x64, 0xFB, 0x26, 0x47,
2583 0xFC, 0x0D, 0xB4, 0xF8, 0x95, 0x04, 0x31, 0xFD, 0x88, 0x01, 0x56,
2584 0xFF, 0x2C, 0x00, 0xFF, 0xFF, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF,
2585 0xE6, 0x01, 0x3E, 0xFC, 0xD3, 0x06, 0x56, 0xF3, 0xBA, 0x20, 0x61,
2586 0x3D, 0x56, 0xF3, 0x45, 0x05, 0xB7, 0xFD, 0xDE, 0x00, 0xC5, 0xFF,
2587 0x05, 0x00, 0x02, 0x00, 0x09, 0x00, 0xDB, 0xFF, 0x34, 0x00, 0xFE,
2588 0xFF, 0x3D, 0xFF, 0xC9, 0x02, 0x64, 0xF7, 0x2F, 0x44, 0x44, 0x15,
2589 0x4A, 0xF6, 0xAD, 0x05, 0xAF, 0xFC, 0xC0, 0x01, 0x41, 0xFF, 0x32,
2590 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x35, 0x00, 0x3A, 0xFF, 0xD3, 0x01,
2591 0x7D, 0xFC, 0x23, 0x06, 0x32, 0xF5, 0x0C, 0x19, 0x38, 0x42, 0xC7,
2592 0xF5, 0xB8, 0x03, 0xAF, 0xFE, 0x4E, 0x00, 0x0C, 0x00, 0xEA, 0xFF,
2593 0x06, 0x00, 0x04, 0x00, 0xF8, 0xFF, 0xE7, 0xFF, 0x99, 0x00, 0x2C,
2594 0xFE, 0x8C, 0x04, 0x6D, 0xF4, 0xF0, 0x3F, 0xE0, 0x1C, 0x34, 0xF4,
2595 0x85, 0x06, 0x57, 0xFC, 0xE0, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFE,
2596 0xFF, 0xFF, 0xFF, 0x2F, 0x00, 0x4A, 0xFF, 0xA7, 0x01, 0xEC, 0xFC,
2597 0x28, 0x05, 0x77, 0xF7, 0x92, 0x11, 0xD7, 0x45, 0x43, 0xF9, 0xC3,
2598 0x01, 0xD6, 0xFF, 0xA9, 0xFF, 0x5E, 0x00, 0xCB, 0xFF, 0x0D, 0x00,
2599 0x00, 0x00, 0x10, 0x00, 0xA6, 0xFF, 0x1B, 0x01, 0x50, 0xFD, 0xE1,
2600 0x05, 0x82, 0xF2, 0x8F, 0x3A, 0x92, 0x24, 0x9D, 0xF2, 0x09, 0x07,
2601 0x32, 0xFC, 0xE4, 0x01, 0x39, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x00,
2602 0x00, 0x28, 0x00, 0x63, 0xFF, 0x66, 0x01, 0x7D, 0xFD, 0xF8, 0x03,
2603 0xFB, 0xF9, 0x89, 0x0A, 0x1D, 0x48, 0xC5, 0xFD, 0x7A, 0xFF, 0x1D,
2604 0x01, 0xF7, 0xFE, 0xB4, 0x00, 0xA9, 0xFF, 0x15, 0x00, 0xFE, 0xFF,
2605 0x23, 0x00, 0x72, 0xFF, 0x7F, 0x01, 0xB0, 0xFC, 0xBE, 0x06, 0x97,
2606 0xF1, 0x3F, 0x34, 0x19, 0x2C, 0xAD, 0xF1, 0x28, 0x07, 0x48, 0xFC,
2607 0xC9, 0x01, 0x4B, 0xFF, 0x30, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x1F,
2608 0x00, 0x82, 0xFF, 0x18, 0x01, 0x27, 0xFE, 0xA9, 0x02, 0x94, 0xFC,
2609 0x24, 0x04, 0xF5, 0x48, 0x39, 0x03, 0xF9, 0xFC, 0x74, 0x02, 0x42,
2610 0xFE, 0x0B, 0x01, 0x87, 0xFF, 0x1E, 0x00, 0xFD, 0xFF, 0x2F, 0x00,
2611 0x4F, 0xFF, 0xC2, 0x01, 0x51, 0xFC, 0x23, 0x07, 0x9A, 0xF1, 0x3A,
2612 0x2D, 0x35, 0x33, 0x89, 0xF1, 0xD5, 0x06, 0x9D, 0xFC, 0x8B, 0x01,
2613 0x6C, 0xFF, 0x25, 0x00, 0xFD, 0xFF, 0x16, 0x00, 0xA4, 0xFF, 0xC2,
2614 0x00, 0xDB, 0xFE, 0x52, 0x01, 0x1B, 0xFF, 0x8D, 0xFE, 0x57, 0x48,
2615 0x81, 0x09, 0x61, 0xFA, 0xC6, 0x03, 0x96, 0xFD, 0x5B, 0x01, 0x68,
2616 0xFF, 0x26, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x35, 0x00, 0x3B, 0xFF,
2617 0xE2, 0x01, 0x31, 0xFC, 0x15, 0x07, 0x6D, 0xF2, 0xBF, 0x25, 0xA5,
2618 0x39, 0x4D, 0xF2, 0x0B, 0x06, 0x33, 0xFD, 0x2D, 0x01, 0x9D, 0xFF,
2619 0x13, 0x00, 0xFF, 0xFF, 0x0E, 0x00, 0xC6, 0xFF, 0x6B, 0x00, 0x8E,
2620 0xFF, 0x06, 0x00, 0x6E, 0x01, 0xE4, 0xF9, 0x48, 0x46, 0x75, 0x10,
2621 0xD7, 0xF7, 0xFC, 0x04, 0x00, 0xFD, 0x9E, 0x01, 0x4E, 0xFF, 0x2E,
2622 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE3, 0x01,
2623 0x4E, 0xFC, 0xA0, 0x06, 0xED, 0xF3, 0x0F, 0x1E, 0x2D, 0x3F, 0x10,
2624 0xF4, 0xC8, 0x04, 0x07, 0xFE, 0xAF, 0x00, 0xDC, 0xFF, 0xFC, 0xFF,
2625 0x03, 0x00, 0x07, 0x00, 0xE5, 0xFF, 0x18, 0x00, 0x36, 0x00, 0xD9,
2626 0xFE, 0x71, 0x03, 0x3F, 0xF6, 0xDB, 0x42, 0xE0, 0x17, 0x86, 0xF5,
2627 0x00, 0x06, 0x8C, 0xFC, 0xCE, 0x01, 0x3C, 0xFF, 0x34, 0x00, 0xFE,
2628 0xFF, 0xFF, 0xFF, 0x33, 0x00, 0x3F, 0xFF, 0xC6, 0x01, 0x9F, 0xFC,
2629 0xD3, 0x05, 0xF1, 0xF5, 0x6C, 0x16, 0x9E, 0x43, 0xDD, 0xF6, 0x15,
2630 0x03, 0x10, 0xFF, 0x17, 0x00, 0x28, 0x00, 0xDF, 0xFF, 0x09, 0x00,
2631 0x02, 0x00, 0x01, 0x00, 0xCF, 0xFF, 0xC9, 0x00, 0xDA, 0xFD, 0x0F,
2632 0x05, 0xA5, 0xF3, 0x31, 0x3E, 0x8A, 0x1F, 0x97, 0xF3, 0xBD, 0x06,
2633 0x44, 0xFC, 0xE5, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0xFF,
2634 0xFF, 0x2D, 0x00, 0x52, 0xFF, 0x92, 0x01, 0x1B, 0xFD, 0xC4, 0x04,
2635 0x51, 0xF8, 0x13, 0x0F, 0xC8, 0x46, 0xB6, 0xFA, 0x01, 0x01, 0x44,
2636 0x00, 0x6C, 0xFF, 0x7B, 0x00, 0xBF, 0xFF, 0x10, 0x00, 0xFF, 0xFF,
2637 0x17, 0x00, 0x92, 0xFF, 0x41, 0x01, 0x11, 0xFD, 0x3B, 0x06, 0x14,
2638 0xF2, 0x78, 0x38, 0x36, 0x27, 0x35, 0xF2, 0x20, 0x07, 0x33, 0xFC,
2639 0xDF, 0x01, 0x3E, 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x25,
2640 0x00, 0x6D, 0xFF, 0x4C, 0x01, 0xB6, 0xFD, 0x86, 0x03, 0xE1, 0xFA,
2641 0x3D, 0x08, 0x92, 0x48, 0x8E, 0xFF, 0xA1, 0xFE, 0x93, 0x01, 0xB8,
2642 0xFE, 0xD3, 0x00, 0x9D, 0xFF, 0x18, 0x00, 0xFD, 0xFF, 0x28, 0x00,
2643 0x64, 0xFF, 0x9A, 0x01, 0x88, 0xFC, 0xEE, 0x06, 0x7E, 0xF1, 0xE3,
2644 0x31, 0x9F, 0x2E, 0x88, 0xF1, 0x19, 0x07, 0x5E, 0xFC, 0xB7, 0x01,
2645 0x54, 0xFF, 0x2D, 0x00, 0xFD, 0xFF, 0x1C, 0x00, 0x8D, 0xFF, 0xFA,
2646 0x00, 0x64, 0xFE, 0x32, 0x02, 0x78, 0xFD, 0x1B, 0x02, 0xEA, 0x48,
2647 0x50, 0x05, 0x14, 0xFC, 0xEB, 0x02, 0x05, 0xFE, 0x27, 0x01, 0x7C,
2648 0xFF, 0x21, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x32, 0x00, 0x46, 0xFF,
2649 0xD1, 0x01, 0x3F, 0xFC, 0x2B, 0x07, 0xCD, 0xF1, 0xAE, 0x2A, 0x86,
2650 0x35, 0xB1, 0xF1, 0x9D, 0x06, 0xCA, 0xFC, 0x6E, 0x01, 0x7B, 0xFF,
2651 0x20, 0x00, 0xFE, 0xFF, 0x13, 0x00, 0xAF, 0xFF, 0xA4, 0x00, 0x19,
2652 0xFF, 0xDD, 0x00, 0xF0, 0xFF, 0xD4, 0xFC, 0xC9, 0x47, 0xD8, 0x0B,
2653 0x7C, 0xF9, 0x35, 0x04, 0x5F, 0xFD, 0x74, 0x01, 0x5E, 0xFF, 0x29,
2654 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x36, 0x00, 0x38, 0xFF, 0xE6, 0x01,
2655 0x35, 0xFC, 0xF7, 0x06, 0xE0, 0xF2, 0x18, 0x23, 0xAB, 0x3B, 0xCC,
2656 0xF2, 0xA8, 0x05, 0x76, 0xFD, 0x04, 0x01, 0xB1, 0xFF, 0x0C, 0x00,
2657 0x00, 0x00, 0x0C, 0x00, 0xD1, 0xFF, 0x4E, 0x00, 0xCA, 0xFF, 0x9A,
2658 0xFF, 0x2A, 0x02, 0x83, 0xF8, 0x3F, 0x45, 0xFB, 0x12, 0x01, 0xF7,
2659 0x5D, 0x05, 0xD3, 0xFC, 0xB1, 0x01, 0x46, 0xFF, 0x31, 0x00, 0xFF,
2660 0xFF, 0xFE, 0xFF, 0x36, 0x00, 0x38, 0xFF, 0xDC, 0x01, 0x64, 0xFC,
2661 0x62, 0x06, 0x93, 0xF4, 0x66, 0x1B, 0xD9, 0x40, 0xEA, 0xF4, 0x3E,
2662 0x04, 0x5D, 0xFE, 0x7D, 0x00, 0xF5, 0xFF, 0xF3, 0xFF, 0x05, 0x00,
2663 0x05, 0x00, 0xEF, 0xFF, 0xFE, 0xFF, 0x6C, 0x00, 0x7B, 0xFE, 0x0C,
2664 0x04, 0x3A, 0xF5, 0x5F, 0x41, 0x83, 0x1A, 0xCD, 0xF4, 0x4B, 0x06,
2665 0x6D, 0xFC, 0xD9, 0x01, 0x39, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0xFF,
2666 0xFF, 0x31, 0x00, 0x44, 0xFF, 0xB7, 0x01, 0xC5, 0xFC, 0x7C, 0x05,
2667 0xBC, 0xF6, 0xD5, 0x13, 0xDC, 0x44, 0x14, 0xF8, 0x67, 0x02, 0x77,
2668 0xFF, 0xDD, 0xFF, 0x44, 0x00, 0xD5, 0xFF, 0x0B, 0x00, 0x01, 0x00,
2669 0x09, 0x00, 0xB8, 0xFF, 0xF6, 0x00, 0x8D, 0xFD, 0x84, 0x05, 0xFD,
2670 0xF2, 0x52, 0x3C, 0x35, 0x22, 0x0B, 0xF3, 0xEB, 0x06, 0x37, 0xFC,
2671 0xE6, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x2A,
2672 0x00, 0x5B, 0xFF, 0x7C, 0x01, 0x4E, 0xFD, 0x5A, 0x04, 0x31, 0xF9,
2673 0xA4, 0x0C, 0x90, 0x47, 0x47, 0xFC, 0x36, 0x00, 0xB6, 0x00, 0x2E,
2674 0xFF, 0x99, 0x00, 0xB3, 0xFF, 0x12, 0x00, 0xFE, 0xFF, 0x1E, 0x00,
2675 0x80, 0xFF, 0x64, 0x01, 0xDA, 0xFC, 0x87, 0x06, 0xC5, 0xF1, 0x46,
2676 0x36, 0xD1, 0x29, 0xE3, 0xF1, 0x2A, 0x07, 0x3A, 0xFC, 0xD5, 0x01,
2677 0x44, 0xFF, 0x32, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x22, 0x00, 0x78,
2678 0xFF, 0x31, 0x01, 0xF1, 0xFD, 0x12, 0x03, 0xC7, 0xFB, 0x07, 0x06,
2679 0xDB, 0x48, 0x73, 0x01, 0xC3, 0xFD, 0x0A, 0x02, 0x79, 0xFE, 0xF1,
2680 0x00, 0x91, 0xFF, 0x1B, 0x00, 0xFD, 0xFF, 0x2C, 0x00, 0x58, 0xFF,
2681 0xB1, 0x01, 0x67, 0xFC, 0x10, 0x07, 0x81, 0xF1, 0x73, 0x2F, 0x15,
2682 0x31, 0x7C, 0xF1, 0xFB, 0x06, 0x7C, 0xFC, 0xA2, 0x01, 0x60, 0xFF,
2683 0x29, 0x00, 0xFD, 0xFF, 0x19, 0x00, 0x99, 0xFF, 0xDD, 0x00, 0xA3,
2684 0xFE, 0xBB, 0x01, 0x58, 0xFE, 0x2D, 0x00, 0xAF, 0x48, 0x7E, 0x07,
2685 0x2E, 0xFB, 0x60, 0x03, 0xC9, 0xFD, 0x43, 0x01, 0x71, 0xFF, 0x24,
2686 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x34, 0x00, 0x3F, 0xFF, 0xDC, 0x01,
2687 0x34, 0xFC, 0x25, 0x07, 0x18, 0xF2, 0x15, 0x28, 0xBF, 0x37, 0xF7,
2688 0xF1, 0x56, 0x06, 0xFE, 0xFC, 0x4D, 0x01, 0x8C, 0xFF, 0x19, 0x00,
2689 0xFF, 0xFF, 0x10, 0x00, 0xBB, 0xFF, 0x85, 0x00, 0x58, 0xFF, 0x6A,
2690 0x00, 0xBE, 0x00, 0x38, 0xFB, 0x0F, 0x47, 0x42, 0x0E, 0x9B, 0xF8,
2691 0xA1, 0x04, 0x2B, 0xFD, 0x8B, 0x01, 0x55, 0xFF, 0x2C, 0x00, 0xFF,
2692 0xFF, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3F, 0xFC,
2693 0xCE, 0x06, 0x66, 0xF3, 0x6F, 0x20, 0x96, 0x3D, 0x69, 0xF3, 0x38,
2694 0x05, 0xBF, 0xFD, 0xD9, 0x00, 0xC7, 0xFF, 0x04, 0x00, 0x02, 0x00,
2695 0x09, 0x00, 0xDC, 0xFF, 0x31, 0x00, 0x04, 0x00, 0x32, 0xFF, 0xDC,
2696 0x02, 0x42, 0xF7, 0x0B, 0x44, 0x8E, 0x15, 0x34, 0xF6, 0xB7, 0x05,
2697 0xAB, 0xFC, 0xC1, 0x01, 0x40, 0xFF, 0x33, 0x00, 0xFF, 0xFF, 0xFE,
2698 0xFF, 0x35, 0x00, 0x3B, 0xFF, 0xD2, 0x01, 0x81, 0xFC, 0x1A, 0x06,
2699 0x47, 0xF5, 0xC1, 0x18, 0x60, 0x42, 0xE4, 0xF5, 0xA6, 0x03, 0xB9,
2700 0xFE, 0x48, 0x00, 0x0F, 0x00, 0xE9, 0xFF, 0x07, 0x00, 0x04, 0x00,
2701 0xF9, 0xFF, 0xE4, 0xFF, 0x9F, 0x00, 0x23, 0xFE, 0x9B, 0x04, 0x55,
2702 0xF4, 0xC0, 0x3F, 0x2C, 0x1D, 0x22, 0xF4, 0x8C, 0x06, 0x55, 0xFC,
2703 0xE1, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x2F,
2704 0x00, 0x4B, 0xFF, 0xA4, 0x01, 0xF1, 0xFC, 0x1D, 0x05, 0x8F, 0xF7,
2705 0x4A, 0x11, 0xF2, 0x45, 0x6B, 0xF9, 0xAE, 0x01, 0xE2, 0xFF, 0xA2,
2706 0xFF, 0x61, 0x00, 0xC9, 0xFF, 0x0D, 0x00, 0x00, 0x00, 0x11, 0x00,
2707 0xA3, 0xFF, 0x20, 0x01, 0x49, 0xFD, 0xEB, 0x05, 0x74, 0xF2, 0x54,
2708 0x3A, 0xDD, 0x24, 0x91, 0xF2, 0x0C, 0x07, 0x32, 0xFC, 0xE4, 0x01,
2709 0x3A, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x27, 0x00, 0x64,
2710 0xFF, 0x63, 0x01, 0x84, 0xFD, 0xEB, 0x03, 0x14, 0xFA, 0x47, 0x0A,
2711 0x2C, 0x48, 0xF6, 0xFD, 0x63, 0xFF, 0x2B, 0x01, 0xF0, 0xFE, 0xB8,
2712 0x00, 0xA8, 0xFF, 0x15, 0x00, 0xFE, 0xFF, 0x23, 0x00, 0x71, 0xFF,
2713 0x82, 0x01, 0xAB, 0xFC, 0xC4, 0x06, 0x93, 0xF1, 0xFD, 0x33, 0x62,
2714 0x2C, 0xA8, 0xF1, 0x27, 0x07, 0x4A, 0xFC, 0xC7, 0x01, 0x4C, 0xFF,
2715 0x30, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x1F, 0x00, 0x83, 0xFF, 0x14,
2716 0x01, 0x2D, 0xFE, 0x9C, 0x02, 0xAD, 0xFC, 0xE9, 0x03, 0xF6, 0x48,
2717 0x73, 0x03, 0xE0, 0xFC, 0x82, 0x02, 0x3B, 0xFE, 0x0E, 0x01, 0x86,
2718 0xFF, 0x1E, 0x00, 0xFD, 0xFF, 0x2F, 0x00, 0x4E, 0xFF, 0xC3, 0x01,
2719 0x4E, 0xFC, 0x24, 0x07, 0x9E, 0xF1, 0xF2, 0x2C, 0x78, 0x33, 0x8C,
2720 0xF1, 0xD0, 0x06, 0xA2, 0xFC, 0x88, 0x01, 0x6D, 0xFF, 0x24, 0x00,
2721 0xFD, 0xFF, 0x16, 0x00, 0xA5, 0xFF, 0xBE, 0x00, 0xE2, 0xFE, 0x45,
2722 0x01, 0x33, 0xFF, 0x5A, 0xFE, 0x48, 0x48, 0xC3, 0x09, 0x47, 0xFA,
2723 0xD2, 0x03, 0x90, 0xFD, 0x5E, 0x01, 0x66, 0xFF, 0x27, 0x00, 0x00,
2724 0x00, 0xFD, 0xFF, 0x35, 0x00, 0x3B, 0xFF, 0xE3, 0x01, 0x31, 0xFC,
2725 0x12, 0x07, 0x79, 0xF2, 0x73, 0x25, 0xDF, 0x39, 0x5A, 0xF2, 0x00,
2726 0x06, 0x3A, 0xFD, 0x28, 0x01, 0x9F, 0xFF, 0x13, 0x00, 0x00, 0x00,
2727 0x0E, 0x00, 0xC7, 0xFF, 0x68, 0x00, 0x95, 0xFF, 0xFA, 0xFF, 0x83,
2728 0x01, 0xBB, 0xF9, 0x2B, 0x46, 0xBB, 0x10, 0xBF, 0xF7, 0x07, 0x05,
2729 0xFB, 0xFC, 0xA0, 0x01, 0x4D, 0xFF, 0x2F, 0x00, 0xFF, 0xFF, 0xFE,
2730 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE2, 0x01, 0x50, 0xFC, 0x99, 0x06,
2731 0xFE, 0xF3, 0xC3, 0x1D, 0x5E, 0x3F, 0x27, 0xF4, 0xB9, 0x04, 0x10,
2732 0xFE, 0xA9, 0x00, 0xDF, 0xFF, 0xFB, 0xFF, 0x03, 0x00, 0x07, 0x00,
2733 0xE6, 0xFF, 0x15, 0x00, 0x3C, 0x00, 0xCF, 0xFE, 0x83, 0x03, 0x20,
2734 0xF6, 0xB2, 0x42, 0x2B, 0x18, 0x71, 0xF5, 0x09, 0x06, 0x88, 0xFC,
2735 0xCF, 0x01, 0x3C, 0xFF, 0x34, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x33,
2736 0x00, 0x3F, 0xFF, 0xC5, 0x01, 0xA3, 0xFC, 0xCA, 0x05, 0x07, 0xF6,
2737 0x22, 0x16, 0xC3, 0x43, 0xFE, 0xF6, 0x02, 0x03, 0x1B, 0xFF, 0x11,
2738 0x00, 0x2B, 0x00, 0xDE, 0xFF, 0x09, 0x00, 0x02, 0x00, 0x02, 0x00,
2739 0xCC, 0xFF, 0xCE, 0x00, 0xD1, 0xFD, 0x1D, 0x05, 0x91, 0xF3, 0xFE,
2740 0x3D, 0xD7, 0x1F, 0x87, 0xF3, 0xC3, 0x06, 0x42, 0xFC, 0xE5, 0x01,
2741 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0xFF, 0xFF, 0x2D, 0x00, 0x53,
2742 0xFF, 0x90, 0x01, 0x20, 0xFD, 0xB8, 0x04, 0x6A, 0xF8, 0xCD, 0x0E,
2743 0xE1, 0x46, 0xE1, 0xFA, 0xEB, 0x00, 0x51, 0x00, 0x65, 0xFF, 0x7F,
2744 0x00, 0xBE, 0xFF, 0x10, 0x00, 0xFF, 0xFF, 0x18, 0x00, 0x90, 0xFF,
2745 0x45, 0x01, 0x0B, 0xFD, 0x44, 0x06, 0x0A, 0xF2, 0x3B, 0x38, 0x80,
2746 0x27, 0x2B, 0xF2, 0x22, 0x07, 0x33, 0xFC, 0xDE, 0x01, 0x3E, 0xFF,
2747 0x34, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x24, 0x00, 0x6E, 0xFF, 0x49,
2748 0x01, 0xBC, 0xFD, 0x7A, 0x03, 0xFA, 0xFA, 0xFD, 0x07, 0x9C, 0x48,
2749 0xC3, 0xFF, 0x89, 0xFE, 0xA1, 0x01, 0xB1, 0xFE, 0xD6, 0x00, 0x9C,
2750 0xFF, 0x18, 0x00, 0xFD, 0xFF, 0x28, 0x00, 0x63, 0xFF, 0x9D, 0x01,
2751 0x84, 0xFC, 0xF3, 0x06, 0x7D, 0xF1, 0x9E, 0x31, 0xE6, 0x2E, 0x85,
2752 0xF1, 0x16, 0x07, 0x61, 0xFC, 0xB5, 0x01, 0x55, 0xFF, 0x2D, 0x00,
2753 0xFD, 0xFF, 0x1C, 0x00, 0x8F, 0xFF, 0xF7, 0x00, 0x6B, 0xFE, 0x25,
2754 0x02, 0x91, 0xFD, 0xE3, 0x01, 0xE5, 0x48, 0x8D, 0x05, 0xFB, 0xFB,
2755 0xF8, 0x02, 0xFE, 0xFD, 0x2B, 0x01, 0x7A, 0xFF, 0x21, 0x00, 0x00,
2756 0x00, 0xFD, 0xFF, 0x32, 0x00, 0x45, 0xFF, 0xD2, 0x01, 0x3D, 0xFC,
2757 0x2B, 0x07, 0xD4, 0xF1, 0x64, 0x2A, 0xC6, 0x35, 0xB7, 0xF1, 0x96,
2758 0x06, 0xCF, 0xFC, 0x6B, 0x01, 0x7D, 0xFF, 0x1F, 0x00, 0xFE, 0xFF,
2759 0x13, 0x00, 0xB1, 0xFF, 0xA0, 0x00, 0x20, 0xFF, 0xD0, 0x00, 0x07,
2760 0x00, 0xA4, 0xFC, 0xB6, 0x47, 0x1C, 0x0C, 0x63, 0xF9, 0x42, 0x04,
2761 0x59, 0xFD, 0x76, 0x01, 0x5D, 0xFF, 0x2A, 0x00, 0x00, 0x00, 0xFD,
2762 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x35, 0xFC, 0xF3, 0x06,
2763 0xEE, 0xF2, 0xCD, 0x22, 0xE4, 0x3B, 0xDC, 0xF2, 0x9C, 0x05, 0x7E,
2764 0xFD, 0x00, 0x01, 0xB4, 0xFF, 0x0B, 0x00, 0x01, 0x00, 0x0B, 0x00,
2765 0xD2, 0xFF, 0x4A, 0x00, 0xD0, 0xFF, 0x8E, 0xFF, 0x3F, 0x02, 0x5E,
2766 0xF8, 0x1E, 0x45, 0x44, 0x13, 0xEA, 0xF6, 0x67, 0x05, 0xCF, 0xFC,
2767 0xB3, 0x01, 0x46, 0xFF, 0x31, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x36,
2768 0x00, 0x38, 0xFF, 0xDB, 0x01, 0x67, 0xFC, 0x5A, 0x06, 0xA6, 0xF4,
2769 0x1B, 0x1B, 0x07, 0x41, 0x04, 0xF5, 0x2D, 0x04, 0x67, 0xFE, 0x77,
2770 0x00, 0xF8, 0xFF, 0xF2, 0xFF, 0x05, 0x00, 0x05, 0x00, 0xF0, 0xFF,
2771 0xFB, 0xFF, 0x71, 0x00, 0x71, 0xFE, 0x1D, 0x04, 0x1F, 0xF5, 0x32,
2772 0x41, 0xCE, 0x1A, 0xBA, 0xF4, 0x53, 0x06, 0x6A, 0xFC, 0xDA, 0x01,
2773 0x38, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x31, 0x00, 0x45,
2774 0xFF, 0xB5, 0x01, 0xCA, 0xFC, 0x72, 0x05, 0xD3, 0xF6, 0x8D, 0x13,
2775 0xFD, 0x44, 0x39, 0xF8, 0x53, 0x02, 0x82, 0xFF, 0xD7, 0xFF, 0x47,
2776 0x00, 0xD3, 0xFF, 0x0B, 0x00, 0x01, 0x00, 0x0A, 0x00, 0xB6, 0xFF,
2777 0xFB, 0x00, 0x85, 0xFD, 0x90, 0x05, 0xEC, 0xF2, 0x1C, 0x3C, 0x81,
2778 0x22, 0xFC, 0xF2, 0xEF, 0x06, 0x36, 0xFC, 0xE6, 0x01, 0x37, 0xFF,
2779 0x36, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x2A, 0x00, 0x5C, 0xFF, 0x79,
2780 0x01, 0x53, 0xFD, 0x4E, 0x04, 0x4A, 0xF9, 0x60, 0x0C, 0xA3, 0x47,
2781 0x76, 0xFC, 0x1F, 0x00, 0xC3, 0x00, 0x27, 0xFF, 0x9D, 0x00, 0xB2,
2782 0xFF, 0x13, 0x00, 0xFE, 0xFF, 0x1E, 0x00, 0x7F, 0xFF, 0x67, 0x01,
2783 0xD5, 0xFC, 0x8E, 0x06, 0xBE, 0xF1, 0x06, 0x36, 0x1A, 0x2A, 0xDC,
2784 0xF1, 0x2A, 0x07, 0x3C, 0xFC, 0xD3, 0x01, 0x44, 0xFF, 0x32, 0x00,
2785 0xFD, 0xFF, 0x00, 0x00, 0x21, 0x00, 0x79, 0xFF, 0x2E, 0x01, 0xF7,
2786 0xFD, 0x05, 0x03, 0xE1, 0xFB, 0xCA, 0x05, 0xDF, 0x48, 0xAB, 0x01,
2787 0xAA, 0xFD, 0x18, 0x02, 0x72, 0xFE, 0xF4, 0x00, 0x90, 0xFF, 0x1B,
2788 0x00, 0xFD, 0xFF, 0x2C, 0x00, 0x57, 0xFF, 0xB3, 0x01, 0x64, 0xFC,
2789 0x13, 0x07, 0x83, 0xF1, 0x2C, 0x2F, 0x5A, 0x31, 0x7D, 0xF1, 0xF7,
2790 0x06, 0x80, 0xFC, 0x9F, 0x01, 0x61, 0xFF, 0x29, 0x00, 0xFD, 0xFF,
2791 0x19, 0x00, 0x9A, 0xFF, 0xD9, 0x00, 0xAA, 0xFE, 0xAE, 0x01, 0x70,
2792 0xFE, 0xF8, 0xFF, 0xA6, 0x48, 0xBE, 0x07, 0x14, 0xFB, 0x6D, 0x03,
2793 0xC3, 0xFD, 0x46, 0x01, 0x70, 0xFF, 0x24, 0x00, 0x00, 0x00, 0xFD,
2794 0xFF, 0x34, 0x00, 0x3F, 0xFF, 0xDD, 0x01, 0x34, 0xFC, 0x23, 0x07,
2795 0x21, 0xF2, 0xCB, 0x27, 0xFE, 0x37, 0x00, 0xF2, 0x4D, 0x06, 0x04,
2796 0xFD, 0x49, 0x01, 0x8E, 0xFF, 0x19, 0x00, 0xFF, 0xFF, 0x10, 0x00,
2797 0xBD, 0xFF, 0x82, 0x00, 0x5E, 0xFF, 0x5D, 0x00, 0xD4, 0x00, 0x0C,
2798 0xFB, 0xF9, 0x46, 0x87, 0x0E, 0x82, 0xF8, 0xAD, 0x04, 0x26, 0xFD,
2799 0x8D, 0x01, 0x54, 0xFF, 0x2C, 0x00, 0xFF, 0xFF, 0xFD, 0xFF, 0x36,
2800 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x41, 0xFC, 0xC8, 0x06, 0x76, 0xF3,
2801 0x22, 0x20, 0xCA, 0x3D, 0x7D, 0xF3, 0x2A, 0x05, 0xC8, 0xFD, 0xD4,
2802 0x00, 0xCA, 0xFF, 0x03, 0x00, 0x02, 0x00, 0x09, 0x00, 0xDD, 0xFF,
2803 0x2E, 0x00, 0x0A, 0x00, 0x27, 0xFF, 0xEF, 0x02, 0x20, 0xF7, 0xE7,
2804 0x43, 0xD8, 0x15, 0x1E, 0xF6, 0xC0, 0x05, 0xA7, 0xFC, 0xC3, 0x01,
2805 0x40, 0xFF, 0x33, 0x00, 0xFF, 0xFF, 0xFE, 0xFF, 0x34, 0x00, 0x3B,
2806 0xFF, 0xD1, 0x01, 0x84, 0xFC, 0x12, 0x06, 0x5C, 0xF5, 0x76, 0x18,
2807 0x89, 0x42, 0x02, 0xF6, 0x94, 0x03, 0xC4, 0xFE, 0x42, 0x00, 0x12,
2808 0x00, 0xE8, 0xFF, 0x07, 0x00, 0x03, 0x00, 0xFA, 0xFF, 0xE2, 0xFF,
2809 0xA4, 0x00, 0x19, 0xFE, 0xAA, 0x04, 0x3E, 0xF4, 0x90, 0x3F, 0x78,
2810 0x1D, 0x10, 0xF4, 0x93, 0x06, 0x52, 0xFC, 0xE1, 0x01, 0x36, 0xFF,
2811 0x36, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x2F, 0x00, 0x4C, 0xFF, 0xA2,
2812 0x01, 0xF6, 0xFC, 0x12, 0x05, 0xA7, 0xF7, 0x03, 0x11, 0x10, 0x46,
2813 0x93, 0xF9, 0x98, 0x01, 0xEE, 0xFF, 0x9B, 0xFF, 0x64, 0x00, 0xC8,
2814 0xFF, 0x0E, 0x00, 0x00, 0x00, 0x12, 0x00, 0xA1, 0xFF, 0x24, 0x01,
2815 0x41, 0xFD, 0xF6, 0x05, 0x67, 0xF2, 0x1A, 0x3A, 0x29, 0x25, 0x84,
2816 0xF2, 0x0F, 0x07, 0x31, 0xFC, 0xE3, 0x01, 0x3A, 0xFF, 0x35, 0x00,
2817 0xFD, 0xFF, 0x00, 0x00, 0x27, 0x00, 0x65, 0xFF, 0x60, 0x01, 0x8A,
2818 0xFD, 0xDF, 0x03, 0x2E, 0xFA, 0x04, 0x0A, 0x3A, 0x48, 0x28, 0xFE,
2819 0x4B, 0xFF, 0x38, 0x01, 0xE9, 0xFE, 0xBB, 0x00, 0xA6, 0xFF, 0x16,
2820 0x00, 0xFD, 0xFF, 0x24, 0x00, 0x6F, 0xFF, 0x85, 0x01, 0xA6, 0xFC,
2821 0xCA, 0x06, 0x8F, 0xF1, 0xBB, 0x33, 0xAB, 0x2C, 0xA3, 0xF1, 0x26,
2822 0x07, 0x4C, 0xFC, 0xC5, 0x01, 0x4D, 0xFF, 0x30, 0x00, 0xFD, 0xFF,
2823 0x00, 0x00, 0x1E, 0x00, 0x84, 0xFF, 0x11, 0x01, 0x34, 0xFE, 0x8F,
2824 0x02, 0xC7, 0xFC, 0xAE, 0x03, 0xF7, 0x48, 0xAE, 0x03, 0xC7, 0xFC,
2825 0x8F, 0x02, 0x34, 0xFE, 0x11, 0x01, 0x84, 0xFF, 0x1E, 0x00, 0xFD,
2826 0xFF, 0x2A, 0x00, 0x5C, 0xFF, 0xAA, 0x01, 0x71, 0xFC, 0x07, 0x07,
2827 0x7E, 0xF1, 0x44, 0x30, 0x44, 0x30, 0x7E, 0xF1, 0x07, 0x07, 0x71,
2828 0xFC, 0xAA, 0x01, 0x5C, 0xFF, 0x2A, 0x00, 0xFD, 0xFF, 0x00, 0x00,
2829 0x1E, 0x00, 0x84, 0xFF, 0x11, 0x01, 0x34, 0xFE, 0x8F, 0x02, 0xC7,
2830 0xFC, 0xAE, 0x03, 0xF7, 0x48, 0xAE, 0x03, 0xC7, 0xFC, 0x8F, 0x02,
2831 0x34, 0xFE, 0x11, 0x01, 0x84, 0xFF, 0x1E, 0x00, 0x02, 0x00, 0x05,
2832 0x00, 0xC3, 0xFF, 0xE1, 0x00, 0xB1, 0xFD, 0x4E, 0x05, 0x4A, 0xF3,
2833 0x3D, 0x3D, 0xED, 0x20, 0x4C, 0xF3, 0xD6, 0x06, 0x3D, 0xFC, 0xE6,
2834 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x36, 0x00,
2835 0x36, 0xFF, 0xE6, 0x01, 0x3D, 0xFC, 0xD6, 0x06, 0x4C, 0xF3, 0xED,
2836 0x20, 0x3D, 0x3D, 0x4A, 0xF3, 0x4E, 0x05, 0xB1, 0xFD, 0xE1, 0x00,
2837 0xC3, 0xFF, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x84,
2838 0xFF, 0x11, 0x01, 0x34, 0xFE, 0x8F, 0x02, 0xC7, 0xFC, 0xAE, 0x03,
2839 0xF7, 0x48, 0xAE, 0x03, 0xC7, 0xFC, 0x8F, 0x02, 0x34, 0xFE, 0x11,
2840 0x01, 0x84, 0xFF, 0x1E, 0x00, 0x16, 0x00, 0xA6, 0xFF, 0xBB, 0x00,
2841 0xE9, 0xFE, 0x38, 0x01, 0x4B, 0xFF, 0x28, 0xFE, 0x3A, 0x48, 0x04,
2842 0x0A, 0x2E, 0xFA, 0xDF, 0x03, 0x8A, 0xFD, 0x60, 0x01, 0x65, 0xFF,
2843 0x27, 0x00, 0x00, 0x00, 0x0E, 0x00, 0xC8, 0xFF, 0x64, 0x00, 0x9B,
2844 0xFF, 0xEE, 0xFF, 0x98, 0x01, 0x93, 0xF9, 0x10, 0x46, 0x03, 0x11,
2845 0xA7, 0xF7, 0x12, 0x05, 0xF6, 0xFC, 0xA2, 0x01, 0x4C, 0xFF, 0x2F,
2846 0x00, 0xFF, 0xFF, 0x07, 0x00, 0xE8, 0xFF, 0x12, 0x00, 0x42, 0x00,
2847 0xC4, 0xFE, 0x94, 0x03, 0x02, 0xF6, 0x89, 0x42, 0x76, 0x18, 0x5C,
2848 0xF5, 0x12, 0x06, 0x84, 0xFC, 0xD1, 0x01, 0x3B, 0xFF, 0x34, 0x00,
2849 0xFE, 0xFF, 0x02, 0x00, 0x03, 0x00, 0xCA, 0xFF, 0xD4, 0x00, 0xC8,
2850 0xFD, 0x2A, 0x05, 0x7D, 0xF3, 0xCA, 0x3D, 0x22, 0x20, 0x76, 0xF3,
2851 0xC8, 0x06, 0x41, 0xFC, 0xE6, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD,
2852 0xFF, 0xFF, 0xFF, 0x19, 0x00, 0x8E, 0xFF, 0x49, 0x01, 0x04, 0xFD,
2853 0x4D, 0x06, 0x00, 0xF2, 0xFE, 0x37, 0xCB, 0x27, 0x21, 0xF2, 0x23,
2854 0x07, 0x34, 0xFC, 0xDD, 0x01, 0x3F, 0xFF, 0x34, 0x00, 0xFD, 0xFF,
2855 0xFD, 0xFF, 0x29, 0x00, 0x61, 0xFF, 0x9F, 0x01, 0x80, 0xFC, 0xF7,
2856 0x06, 0x7D, 0xF1, 0x5A, 0x31, 0x2C, 0x2F, 0x83, 0xF1, 0x13, 0x07,
2857 0x64, 0xFC, 0xB3, 0x01, 0x57, 0xFF, 0x2C, 0x00, 0xFD, 0xFF, 0xFD,
2858 0xFF, 0x32, 0x00, 0x44, 0xFF, 0xD3, 0x01, 0x3C, 0xFC, 0x2A, 0x07,
2859 0xDC, 0xF1, 0x1A, 0x2A, 0x06, 0x36, 0xBE, 0xF1, 0x8E, 0x06, 0xD5,
2860 0xFC, 0x67, 0x01, 0x7F, 0xFF, 0x1E, 0x00, 0xFE, 0xFF, 0xFD, 0xFF,
2861 0x36, 0x00, 0x37, 0xFF, 0xE6, 0x01, 0x36, 0xFC, 0xEF, 0x06, 0xFC,
2862 0xF2, 0x81, 0x22, 0x1C, 0x3C, 0xEC, 0xF2, 0x90, 0x05, 0x85, 0xFD,
2863 0xFB, 0x00, 0xB6, 0xFF, 0x0A, 0x00, 0x01, 0x00, 0xFE, 0xFF, 0x35,
2864 0x00, 0x38, 0xFF, 0xDA, 0x01, 0x6A, 0xFC, 0x53, 0x06, 0xBA, 0xF4,
2865 0xCE, 0x1A, 0x32, 0x41, 0x1F, 0xF5, 0x1D, 0x04, 0x71, 0xFE, 0x71,
2866 0x00, 0xFB, 0xFF, 0xF0, 0xFF, 0x05, 0x00, 0xFF, 0xFF, 0x31, 0x00,
2867 0x46, 0xFF, 0xB3, 0x01, 0xCF, 0xFC, 0x67, 0x05, 0xEA, 0xF6, 0x44,
2868 0x13, 0x1E, 0x45, 0x5E, 0xF8, 0x3F, 0x02, 0x8E, 0xFF, 0xD0, 0xFF,
2869 0x4A, 0x00, 0xD2, 0xFF, 0x0B, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x5D,
2870 0xFF, 0x76, 0x01, 0x59, 0xFD, 0x42, 0x04, 0x63, 0xF9, 0x1C, 0x0C,
2871 0xB6, 0x47, 0xA4, 0xFC, 0x07, 0x00, 0xD0, 0x00, 0x20, 0xFF, 0xA0,
2872 0x00, 0xB1, 0xFF, 0x13, 0x00, 0x00, 0x00, 0x21, 0x00, 0x7A, 0xFF,
2873 0x2B, 0x01, 0xFE, 0xFD, 0xF8, 0x02, 0xFB, 0xFB, 0x8D, 0x05, 0xE5,
2874 0x48, 0xE3, 0x01, 0x91, 0xFD, 0x25, 0x02, 0x6B, 0xFE, 0xF7, 0x00,
2875 0x8F, 0xFF, 0x1C, 0x00, 0x18, 0x00, 0x9C, 0xFF, 0xD6, 0x00, 0xB1,
2876 0xFE, 0xA1, 0x01, 0x89, 0xFE, 0xC3, 0xFF, 0x9C, 0x48, 0xFD, 0x07,
2877 0xFA, 0xFA, 0x7A, 0x03, 0xBC, 0xFD, 0x49, 0x01, 0x6E, 0xFF, 0x24,
2878 0x00, 0x00, 0x00, 0x10, 0x00, 0xBE, 0xFF, 0x7F, 0x00, 0x65, 0xFF,
2879 0x51, 0x00, 0xEB, 0x00, 0xE1, 0xFA, 0xE1, 0x46, 0xCD, 0x0E, 0x6A,
2880 0xF8, 0xB8, 0x04, 0x20, 0xFD, 0x90, 0x01, 0x53, 0xFF, 0x2D, 0x00,
2881 0xFF, 0xFF, 0x09, 0x00, 0xDE, 0xFF, 0x2B, 0x00, 0x11, 0x00, 0x1B,
2882 0xFF, 0x02, 0x03, 0xFE, 0xF6, 0xC3, 0x43, 0x22, 0x16, 0x07, 0xF6,
2883 0xCA, 0x05, 0xA3, 0xFC, 0xC5, 0x01, 0x3F, 0xFF, 0x33, 0x00, 0xFF,
2884 0xFF, 0x03, 0x00, 0xFB, 0xFF, 0xDF, 0xFF, 0xA9, 0x00, 0x10, 0xFE,
2885 0xB9, 0x04, 0x27, 0xF4, 0x5E, 0x3F, 0xC3, 0x1D, 0xFE, 0xF3, 0x99,
2886 0x06, 0x50, 0xFC, 0xE2, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFE, 0xFF,
2887 0x00, 0x00, 0x13, 0x00, 0x9F, 0xFF, 0x28, 0x01, 0x3A, 0xFD, 0x00,
2888 0x06, 0x5A, 0xF2, 0xDF, 0x39, 0x73, 0x25, 0x79, 0xF2, 0x12, 0x07,
2889 0x31, 0xFC, 0xE3, 0x01, 0x3B, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0xFD,
2890 0xFF, 0x24, 0x00, 0x6D, 0xFF, 0x88, 0x01, 0xA2, 0xFC, 0xD0, 0x06,
2891 0x8C, 0xF1, 0x78, 0x33, 0xF2, 0x2C, 0x9E, 0xF1, 0x24, 0x07, 0x4E,
2892 0xFC, 0xC3, 0x01, 0x4E, 0xFF, 0x2F, 0x00, 0xFD, 0xFF, 0xFD, 0xFF,
2893 0x30, 0x00, 0x4C, 0xFF, 0xC7, 0x01, 0x4A, 0xFC, 0x27, 0x07, 0xA8,
2894 0xF1, 0x62, 0x2C, 0xFD, 0x33, 0x93, 0xF1, 0xC4, 0x06, 0xAB, 0xFC,
2895 0x82, 0x01, 0x71, 0xFF, 0x23, 0x00, 0xFE, 0xFF, 0xFD, 0xFF, 0x36,
2896 0x00, 0x3A, 0xFF, 0xE4, 0x01, 0x32, 0xFC, 0x0C, 0x07, 0x91, 0xF2,
2897 0xDD, 0x24, 0x54, 0x3A, 0x74, 0xF2, 0xEB, 0x05, 0x49, 0xFD, 0x20,
2898 0x01, 0xA3, 0xFF, 0x11, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x36, 0x00,
2899 0x37, 0xFF, 0xE1, 0x01, 0x55, 0xFC, 0x8C, 0x06, 0x22, 0xF4, 0x2C,
2900 0x1D, 0xC0, 0x3F, 0x55, 0xF4, 0x9B, 0x04, 0x23, 0xFE, 0x9F, 0x00,
2901 0xE4, 0xFF, 0xF9, 0xFF, 0x04, 0x00, 0xFF, 0xFF, 0x33, 0x00, 0x40,
2902 0xFF, 0xC1, 0x01, 0xAB, 0xFC, 0xB7, 0x05, 0x34, 0xF6, 0x8E, 0x15,
2903 0x0B, 0x44, 0x42, 0xF7, 0xDC, 0x02, 0x32, 0xFF, 0x04, 0x00, 0x31,
2904 0x00, 0xDC, 0xFF, 0x09, 0x00, 0xFF, 0xFF, 0x2C, 0x00, 0x55, 0xFF,
2905 0x8B, 0x01, 0x2B, 0xFD, 0xA1, 0x04, 0x9B, 0xF8, 0x42, 0x0E, 0x0F,
2906 0x47, 0x38, 0xFB, 0xBE, 0x00, 0x6A, 0x00, 0x58, 0xFF, 0x85, 0x00,
2907 0xBB, 0xFF, 0x10, 0x00, 0x00, 0x00, 0x24, 0x00, 0x71, 0xFF, 0x43,
2908 0x01, 0xC9, 0xFD, 0x60, 0x03, 0x2E, 0xFB, 0x7E, 0x07, 0xAF, 0x48,
2909 0x2D, 0x00, 0x58, 0xFE, 0xBB, 0x01, 0xA3, 0xFE, 0xDD, 0x00, 0x99,
2910 0xFF, 0x19, 0x00, 0x1B, 0x00, 0x91, 0xFF, 0xF1, 0x00, 0x79, 0xFE,
2911 0x0A, 0x02, 0xC3, 0xFD, 0x73, 0x01, 0xDB, 0x48, 0x07, 0x06, 0xC7,
2912 0xFB, 0x12, 0x03, 0xF1, 0xFD, 0x31, 0x01, 0x78, 0xFF, 0x22, 0x00,
2913 0x00, 0x00, 0x12, 0x00, 0xB3, 0xFF, 0x99, 0x00, 0x2E, 0xFF, 0xB6,
2914 0x00, 0x36, 0x00, 0x47, 0xFC, 0x90, 0x47, 0xA4, 0x0C, 0x31, 0xF9,
2915 0x5A, 0x04, 0x4E, 0xFD, 0x7C, 0x01, 0x5B, 0xFF, 0x2A, 0x00, 0x00,
2916 0x00, 0x0B, 0x00, 0xD5, 0xFF, 0x44, 0x00, 0xDD, 0xFF, 0x77, 0xFF,
2917 0x67, 0x02, 0x14, 0xF8, 0xDC, 0x44, 0xD5, 0x13, 0xBC, 0xF6, 0x7C,
2918 0x05, 0xC5, 0xFC, 0xB7, 0x01, 0x44, 0xFF, 0x31, 0x00, 0xFF, 0xFF,
2919 0x05, 0x00, 0xF3, 0xFF, 0xF5, 0xFF, 0x7D, 0x00, 0x5D, 0xFE, 0x3E,
2920 0x04, 0xEA, 0xF4, 0xD9, 0x40, 0x66, 0x1B, 0x93, 0xF4, 0x62, 0x06,
2921 0x64, 0xFC, 0xDC, 0x01, 0x38, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x00,
2922 0x00, 0x0C, 0x00, 0xB1, 0xFF, 0x04, 0x01, 0x76, 0xFD, 0xA8, 0x05,
2923 0xCC, 0xF2, 0xAB, 0x3B, 0x18, 0x23, 0xE0, 0xF2, 0xF7, 0x06, 0x35,
2924 0xFC, 0xE6, 0x01, 0x38, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0xFE, 0xFF,
2925 0x20, 0x00, 0x7B, 0xFF, 0x6E, 0x01, 0xCA, 0xFC, 0x9D, 0x06, 0xB1,
2926 0xF1, 0x86, 0x35, 0xAE, 0x2A, 0xCD, 0xF1, 0x2B, 0x07, 0x3F, 0xFC,
2927 0xD1, 0x01, 0x46, 0xFF, 0x32, 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x2D,
2928 0x00, 0x54, 0xFF, 0xB7, 0x01, 0x5E, 0xFC, 0x19, 0x07, 0x88, 0xF1,
2929 0x9F, 0x2E, 0xE3, 0x31, 0x7E, 0xF1, 0xEE, 0x06, 0x88, 0xFC, 0x9A,
2930 0x01, 0x64, 0xFF, 0x28, 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x34, 0x00,
2931 0x3E, 0xFF, 0xDF, 0x01, 0x33, 0xFC, 0x20, 0x07, 0x35, 0xF2, 0x36,
2932 0x27, 0x78, 0x38, 0x14, 0xF2, 0x3B, 0x06, 0x11, 0xFD, 0x41, 0x01,
2933 0x92, 0xFF, 0x17, 0x00, 0xFF, 0xFF, 0xFD, 0xFF, 0x36, 0x00, 0x36,
2934 0xFF, 0xE5, 0x01, 0x44, 0xFC, 0xBD, 0x06, 0x97, 0xF3, 0x8A, 0x1F,
2935 0x31, 0x3E, 0xA5, 0xF3, 0x0F, 0x05, 0xDA, 0xFD, 0xC9, 0x00, 0xCF,
2936 0xFF, 0x01, 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x34, 0x00, 0x3C, 0xFF,
2937 0xCE, 0x01, 0x8C, 0xFC, 0x00, 0x06, 0x86, 0xF5, 0xE0, 0x17, 0xDB,
2938 0x42, 0x3F, 0xF6, 0x71, 0x03, 0xD9, 0xFE, 0x36, 0x00, 0x18, 0x00,
2939 0xE5, 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0x2E, 0x00, 0x4E, 0xFF, 0x9E,
2940 0x01, 0x00, 0xFD, 0xFC, 0x04, 0xD7, 0xF7, 0x75, 0x10, 0x48, 0x46,
2941 0xE4, 0xF9, 0x6E, 0x01, 0x06, 0x00, 0x8E, 0xFF, 0x6B, 0x00, 0xC6,
2942 0xFF, 0x0E, 0x00, 0x00, 0x00, 0x26, 0x00, 0x68, 0xFF, 0x5B, 0x01,
2943 0x96, 0xFD, 0xC6, 0x03, 0x61, 0xFA, 0x81, 0x09, 0x57, 0x48, 0x8D,
2944 0xFE, 0x1B, 0xFF, 0x52, 0x01, 0xDB, 0xFE, 0xC2, 0x00, 0xA4, 0xFF,
2945 0x16, 0x00, 0x1E, 0x00, 0x87, 0xFF, 0x0B, 0x01, 0x42, 0xFE, 0x74,
2946 0x02, 0xF9, 0xFC, 0x39, 0x03, 0xF5, 0x48, 0x24, 0x04, 0x94, 0xFC,
2947 0xA9, 0x02, 0x27, 0xFE, 0x18, 0x01, 0x82, 0xFF, 0x1F, 0x00, 0x00,
2948 0x00, 0x15, 0x00, 0xA9, 0xFF, 0xB4, 0x00, 0xF7, 0xFE, 0x1D, 0x01,
2949 0x7A, 0xFF, 0xC5, 0xFD, 0x1D, 0x48, 0x89, 0x0A, 0xFB, 0xF9, 0xF8,
2950 0x03, 0x7D, 0xFD, 0x66, 0x01, 0x63, 0xFF, 0x28, 0x00, 0x00, 0x00,
2951 0x0D, 0x00, 0xCB, 0xFF, 0x5E, 0x00, 0xA9, 0xFF, 0xD6, 0xFF, 0xC3,
2952 0x01, 0x43, 0xF9, 0xD7, 0x45, 0x92, 0x11, 0x77, 0xF7, 0x28, 0x05,
2953 0xEC, 0xFC, 0xA7, 0x01, 0x4A, 0xFF, 0x2F, 0x00, 0xFF, 0xFF, 0x06,
2954 0x00, 0xEA, 0xFF, 0x0C, 0x00, 0x4E, 0x00, 0xAF, 0xFE, 0xB8, 0x03,
2955 0xC7, 0xF5, 0x38, 0x42, 0x0C, 0x19, 0x32, 0xF5, 0x23, 0x06, 0x7D,
2956 0xFC, 0xD3, 0x01, 0x3A, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x02, 0x00,
2957 0x05, 0x00, 0xC5, 0xFF, 0xDE, 0x00, 0xB7, 0xFD, 0x45, 0x05, 0x56,
2958 0xF3, 0x61, 0x3D, 0xBA, 0x20, 0x56, 0xF3, 0xD3, 0x06, 0x3E, 0xFC,
2959 0xE6, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0xFF, 0xFF, 0x1A,
2960 0x00, 0x8A, 0xFF, 0x51, 0x01, 0xF8, 0xFC, 0x5E, 0x06, 0xED, 0xF1,
2961 0x82, 0x37, 0x60, 0x28, 0x0E, 0xF2, 0x26, 0x07, 0x35, 0xFC, 0xDB,
2962 0x01, 0x40, 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x29, 0x00,
2963 0x5F, 0xFF, 0xA5, 0x01, 0x78, 0xFC, 0xFF, 0x06, 0x7D, 0xF1, 0xCF,
2964 0x30, 0xB8, 0x2F, 0x80, 0xF1, 0x0D, 0x07, 0x6A, 0xFC, 0xAE, 0x01,
2965 0x59, 0xFF, 0x2B, 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x33, 0x00, 0x43,
2966 0xFF, 0xD6, 0x01, 0x39, 0xFC, 0x2A, 0x07, 0xEB, 0xF1, 0x87, 0x29,
2967 0x85, 0x36, 0xCC, 0xF1, 0x7F, 0x06, 0xE0, 0xFC, 0x60, 0x01, 0x82,
2968 0xFF, 0x1D, 0x00, 0xFE, 0xFF, 0xFD, 0xFF, 0x36, 0x00, 0x37, 0xFF,
2969 0xE6, 0x01, 0x38, 0xFC, 0xE6, 0x06, 0x19, 0xF3, 0xEA, 0x21, 0x8A,
2970 0x3C, 0x0E, 0xF3, 0x78, 0x05, 0x96, 0xFD, 0xF1, 0x00, 0xBB, 0xFF,
2971 0x08, 0x00, 0x01, 0x00, 0xFE, 0xFF, 0x35, 0x00, 0x39, 0xFF, 0xD8,
2972 0x01, 0x70, 0xFC, 0x43, 0x06, 0xE1, 0xF4, 0x38, 0x1A, 0x8C, 0x41,
2973 0x55, 0xF5, 0xFC, 0x03, 0x85, 0xFE, 0x66, 0x00, 0x01, 0x00, 0xEE,
2974 0xFF, 0x06, 0x00, 0xFF, 0xFF, 0x30, 0x00, 0x47, 0xFF, 0xAF, 0x01,
2975 0xD8, 0xFC, 0x52, 0x05, 0x19, 0xF7, 0xB2, 0x12, 0x5C, 0x45, 0xA9,
2976 0xF8, 0x16, 0x02, 0xA6, 0xFF, 0xC3, 0xFF, 0x51, 0x00, 0xD0, 0xFF,
2977 0x0C, 0x00, 0x00, 0x00, 0x29, 0x00, 0x5F, 0xFF, 0x71, 0x01, 0x65,
2978 0xFD, 0x29, 0x04, 0x96, 0xF9, 0x95, 0x0B, 0xDC, 0x47, 0x03, 0xFD,
2979 0xD9, 0xFF, 0xEA, 0x00, 0x12, 0xFF, 0xA7, 0x00, 0xAE, 0xFF, 0x14,
2980 0x00, 0x00, 0x00, 0x20, 0x00, 0x7D, 0xFF, 0x24, 0x01, 0x0C, 0xFE,
2981 0xDE, 0x02, 0x2E, 0xFC, 0x13, 0x05, 0xEC, 0x48, 0x54, 0x02, 0x5E,
2982 0xFD, 0x3F, 0x02, 0x5D, 0xFE, 0xFE, 0x00, 0x8C, 0xFF, 0x1C, 0x00,
2983 0x17, 0x00, 0x9E, 0xFF, 0xCF, 0x00, 0xBF, 0xFE, 0x86, 0x01, 0xBA,
2984 0xFE, 0x5A, 0xFF, 0x86, 0x48, 0x7D, 0x08, 0xC7, 0xFA, 0x93, 0x03,
2985 0xB0, 0xFD, 0x4F, 0x01, 0x6C, 0xFF, 0x25, 0x00, 0x00, 0x00, 0x0F,
2986 0x00, 0xC0, 0xFF, 0x78, 0x00, 0x73, 0xFF, 0x38, 0x00, 0x17, 0x01,
2987 0x8B, 0xFA, 0xAF, 0x46, 0x59, 0x0F, 0x39, 0xF8, 0xCF, 0x04, 0x15,
2988 0xFD, 0x95, 0x01, 0x51, 0xFF, 0x2D, 0x00, 0xFF, 0xFF, 0x08, 0x00,
2989 0xE1, 0xFF, 0x25, 0x00, 0x1D, 0x00, 0x05, 0xFF, 0x28, 0x03, 0xBD,
2990 0xF6, 0x77, 0x43, 0xB6, 0x16, 0xDC, 0xF5, 0xDD, 0x05, 0x9B, 0xFC,
2991 0xC8, 0x01, 0x3E, 0xFF, 0x33, 0x00, 0xFF, 0xFF, 0x03, 0x00, 0xFD,
2992 0xFF, 0xD9, 0xFF, 0xB4, 0x00, 0xFD, 0xFD, 0xD7, 0x04, 0xFA, 0xF3,
2993 0xFC, 0x3E, 0x5B, 0x1E, 0xDB, 0xF3, 0xA6, 0x06, 0x4C, 0xFC, 0xE3,
2994 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x14, 0x00,
2995 0x9B, 0xFF, 0x31, 0x01, 0x2C, 0xFD, 0x15, 0x06, 0x41, 0xF2, 0x6A,
2996 0x39, 0x0A, 0x26, 0x61, 0xF2, 0x17, 0x07, 0x31, 0xFC, 0xE2, 0x01,
2997 0x3B, 0xFF, 0x35, 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x25, 0x00, 0x6A,
2998 0xFF, 0x8E, 0x01, 0x99, 0xFC, 0xDB, 0x06, 0x86, 0xF1, 0xF2, 0x32,
2999 0x82, 0x2D, 0x96, 0xF1, 0x21, 0x07, 0x53, 0xFC, 0xC0, 0x01, 0x50,
3000 0xFF, 0x2E, 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x30, 0x00, 0x4A, 0xFF,
3001 0xCA, 0x01, 0x46, 0xFC, 0x29, 0x07, 0xB3, 0xF1, 0xD1, 0x2B, 0x81,
3002 0x34, 0x9C, 0xF1, 0xB8, 0x06, 0xB5, 0xFC, 0x7C, 0x01, 0x74, 0xFF,
3003 0x22, 0x00, 0xFE, 0xFF, 0xFD, 0xFF, 0x36, 0x00, 0x39, 0xFF, 0xE5,
3004 0x01, 0x32, 0xFC, 0x06, 0x07, 0xAA, 0xF2, 0x46, 0x24, 0xC8, 0x3A,
3005 0x90, 0xF2, 0xD6, 0x05, 0x57, 0xFD, 0x17, 0x01, 0xA8, 0xFF, 0x0F,
3006 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xDF, 0x01,
3007 0x5A, 0xFC, 0x7E, 0x06, 0x47, 0xF4, 0x94, 0x1C, 0x1F, 0x40, 0x85,
3008 0xF4, 0x7D, 0x04, 0x36, 0xFE, 0x93, 0x00, 0xEA, 0xFF, 0xF7, 0xFF,
3009 0x04, 0x00, 0xFF, 0xFF, 0x32, 0x00, 0x42, 0xFF, 0xBE, 0x01, 0xB4,
3010 0xFC, 0xA4, 0x05, 0x61, 0xF6, 0xFB, 0x14, 0x53, 0x44, 0x86, 0xF7,
3011 0xB6, 0x02, 0x49, 0xFF, 0xF7, 0xFF, 0x37, 0x00, 0xD9, 0xFF, 0x0A,
3012 0x00, 0x00, 0x00, 0x2B, 0x00, 0x57, 0xFF, 0x86, 0x01, 0x36, 0xFD,
3013 0x89, 0x04, 0xCD, 0xF8, 0xB7, 0x0D, 0x3D, 0x47, 0x91, 0xFB, 0x91,
3014 0x00, 0x83, 0x00, 0x4A, 0xFF, 0x8C, 0x00, 0xB9, 0xFF, 0x11, 0x00,
3015 0x00, 0x00, 0x23, 0x00, 0x73, 0xFF, 0x3D, 0x01, 0xD6, 0xFD, 0x46,
3016 0x03, 0x61, 0xFB, 0x00, 0x07, 0xBF, 0x48, 0x98, 0x00, 0x26, 0xFE,
3017 0xD5, 0x01, 0x95, 0xFE, 0xE3, 0x00, 0x96, 0xFF, 0x1A, 0x00, 0x1A,
3018 0x00, 0x94, 0xFF, 0xEA, 0x00, 0x87, 0xFE, 0xF0, 0x01, 0xF5, 0xFD,
3019 0x05, 0x01, 0xCE, 0x48, 0x83, 0x06, 0x94, 0xFB, 0x2C, 0x03, 0xE4,
3020 0xFD, 0x37, 0x01, 0x76, 0xFF, 0x22, 0x00, 0x00, 0x00, 0x12, 0x00,
3021 0xB6, 0xFF, 0x93, 0x00, 0x3C, 0xFF, 0x9D, 0x00, 0x63, 0x00, 0xEB,
3022 0xFB, 0x69, 0x47, 0x2D, 0x0D, 0xFF, 0xF8, 0x72, 0x04, 0x42, 0xFD,
3023 0x81, 0x01, 0x59, 0xFF, 0x2B, 0x00, 0x00, 0x00, 0x0A, 0x00, 0xD7,
3024 0xFF, 0x3E, 0x00, 0xEA, 0xFF, 0x60, 0xFF, 0x8F, 0x02, 0xCD, 0xF7,
3025 0x99, 0x44, 0x68, 0x14, 0x8E, 0xF6, 0x90, 0x05, 0xBC, 0xFC, 0xBA,
3026 0x01, 0x43, 0xFF, 0x32, 0x00, 0xFF, 0xFF, 0x04, 0x00, 0xF5, 0xFF,
3027 0xEF, 0xFF, 0x88, 0x00, 0x49, 0xFE, 0x5D, 0x04, 0xB7, 0xF4, 0x7D,
3028 0x40, 0xFD, 0x1B, 0x6C, 0xF4, 0x70, 0x06, 0x5F, 0xFC, 0xDE, 0x01,
3029 0x37, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x0E, 0x00, 0xAC,
3030 0xFF, 0x0E, 0x01, 0x66, 0xFD, 0xBF, 0x05, 0xAD, 0xF2, 0x3B, 0x3B,
3031 0xB0, 0x23, 0xC4, 0xF2, 0xFF, 0x06, 0x33, 0xFC, 0xE5, 0x01, 0x38,
3032 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0xFE, 0xFF, 0x21, 0x00, 0x77, 0xFF,
3033 0x75, 0x01, 0xBF, 0xFC, 0xAB, 0x06, 0xA6, 0xF1, 0x05, 0x35, 0x40,
3034 0x2B, 0xBF, 0xF1, 0x2A, 0x07, 0x42, 0xFC, 0xCE, 0x01, 0x48, 0xFF,
3035 0x31, 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x2E, 0x00, 0x52, 0xFF, 0xBC,
3036 0x01, 0x58, 0xFC, 0x1D, 0x07, 0x8E, 0xF1, 0x11, 0x2E, 0x6B, 0x32,
3037 0x81, 0xF1, 0xE5, 0x06, 0x90, 0xFC, 0x94, 0x01, 0x67, 0xFF, 0x26,
3038 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x35, 0x00, 0x3C, 0xFF, 0xE0, 0x01,
3039 0x32, 0xFC, 0x1C, 0x07, 0x4B, 0xF2, 0xA0, 0x26, 0xF2, 0x38, 0x2A,
3040 0xF2, 0x28, 0x06, 0x1F, 0xFD, 0x39, 0x01, 0x96, 0xFF, 0x16, 0x00,
3041 0xFF, 0xFF, 0xFE, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE4, 0x01, 0x48,
3042 0xFC, 0xB2, 0x06, 0xB9, 0xF3, 0xF3, 0x1E, 0x98, 0x3E, 0xCF, 0xF3,
3043 0xF3, 0x04, 0xEB, 0xFD, 0xBF, 0x00, 0xD4, 0xFF, 0xFF, 0xFF, 0x03,
3044 0x00, 0xFE, 0xFF, 0x34, 0x00, 0x3D, 0xFF, 0xCB, 0x01, 0x93, 0xFC,
3045 0xEF, 0x05, 0xB0, 0xF5, 0x4B, 0x17, 0x2A, 0x43, 0x7D, 0xF6, 0x4D,
3046 0x03, 0xEF, 0xFE, 0x2A, 0x00, 0x1E, 0x00, 0xE3, 0xFF, 0x08, 0x00,
3047 0xFF, 0xFF, 0x2E, 0x00, 0x4F, 0xFF, 0x99, 0x01, 0x0B, 0xFD, 0xE6,
3048 0x04, 0x08, 0xF8, 0xE7, 0x0F, 0x7C, 0x46, 0x37, 0xFA, 0x42, 0x01,
3049 0x1F, 0x00, 0x81, 0xFF, 0x71, 0x00, 0xC3, 0xFF, 0x0F, 0x00, 0x00,
3050 0x00, 0x26, 0x00, 0x6A, 0xFF, 0x55, 0x01, 0xA3, 0xFD, 0xAD, 0x03,
3051 0x94, 0xFA, 0xFF, 0x08, 0x70, 0x48, 0xF3, 0xFE, 0xEA, 0xFE, 0x6C,
3052 0x01, 0xCD, 0xFE, 0xC9, 0x00, 0xA1, 0xFF, 0x17, 0x00, 0x1D, 0x00,
3053 0x8A, 0xFF, 0x04, 0x01, 0x50, 0xFE, 0x5A, 0x02, 0x2C, 0xFD, 0xC6,
3054 0x02, 0xF2, 0x48, 0x9B, 0x04, 0x61, 0xFC, 0xC3, 0x02, 0x19, 0xFE,
3055 0x1E, 0x01, 0x7F, 0xFF, 0x20, 0x00, 0x00, 0x00, 0x14, 0x00, 0xAC,
3056 0xFF, 0xAE, 0x00, 0x05, 0xFF, 0x03, 0x01, 0xAA, 0xFF, 0x63, 0xFD,
3057 0xFD, 0x47, 0x0E, 0x0B, 0xC8, 0xF9, 0x11, 0x04, 0x71, 0xFD, 0x6C,
3058 0x01, 0x61, 0xFF, 0x28, 0x00, 0x00, 0x00, 0x0C, 0x00, 0xCD, 0xFF,
3059 0x57, 0x00, 0xB6, 0xFF, 0xBE, 0xFF, 0xED, 0x01, 0xF5, 0xF8, 0x9B,
3060 0x45, 0x22, 0x12, 0x48, 0xF7, 0x3D, 0x05, 0xE2, 0xFC, 0xAB, 0x01,
3061 0x49, 0xFF, 0x30, 0x00, 0xFF, 0xFF, 0x06, 0x00, 0xEC, 0xFF, 0x06,
3062 0x00, 0x5A, 0x00, 0x9A, 0xFE, 0xDA, 0x03, 0x8D, 0xF5, 0xE1, 0x41,
3063 0xA1, 0x19, 0x09, 0xF5, 0x33, 0x06, 0x77, 0xFC, 0xD6, 0x01, 0x3A,
3064 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x07, 0x00, 0xC0, 0xFF,
3065 0xE8, 0x00, 0xA6, 0xFD, 0x5F, 0x05, 0x31, 0xF3, 0xF6, 0x3C, 0x52,
3066 0x21, 0x37, 0xF3, 0xDD, 0x06, 0x3B, 0xFC, 0xE6, 0x01, 0x36, 0xFF,
3067 0x36, 0x00, 0xFD, 0xFF, 0xFE, 0xFF, 0x1C, 0x00, 0x86, 0xFF, 0x59,
3068 0x01, 0xEC, 0xFC, 0x6F, 0x06, 0xDC, 0xF1, 0x04, 0x37, 0xF3, 0x28,
3069 0xFC, 0xF1, 0x28, 0x07, 0x37, 0xFC, 0xD8, 0x01, 0x41, 0xFF, 0x33,
3070 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x2A, 0x00, 0x5C, 0xFF, 0xAA, 0x01,
3071 0x71, 0xFC, 0x07, 0x07, 0x7E, 0xF1, 0x44, 0x30, 0x44, 0x30, 0x7E,
3072 0xF1, 0x07, 0x07, 0x71, 0xFC, 0xAA, 0x01, 0x5C, 0xFF, 0x2A, 0x00,
3073 0xFD, 0xFF, 0xFD, 0xFF, 0x33, 0x00, 0x41, 0xFF, 0xD8, 0x01, 0x37,
3074 0xFC, 0x28, 0x07, 0xFC, 0xF1, 0xF3, 0x28, 0x04, 0x37, 0xDC, 0xF1,
3075 0x6F, 0x06, 0xEC, 0xFC, 0x59, 0x01, 0x86, 0xFF, 0x1C, 0x00, 0xFE,
3076 0xFF, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3B, 0xFC,
3077 0xDD, 0x06, 0x37, 0xF3, 0x52, 0x21, 0xF6, 0x3C, 0x31, 0xF3, 0x5F,
3078 0x05, 0xA6, 0xFD, 0xE8, 0x00, 0xC0, 0xFF, 0x07, 0x00, 0x01, 0x00,
3079 0xFE, 0xFF, 0x35, 0x00, 0x3A, 0xFF, 0xD6, 0x01, 0x77, 0xFC, 0x33,
3080 0x06, 0x09, 0xF5, 0xA1, 0x19, 0xE1, 0x41, 0x8D, 0xF5, 0xDA, 0x03,
3081 0x9A, 0xFE, 0x5A, 0x00, 0x06, 0x00, 0xEC, 0xFF, 0x06, 0x00, 0xFF,
3082 0xFF, 0x30, 0x00, 0x49, 0xFF, 0xAB, 0x01, 0xE2, 0xFC, 0x3D, 0x05,
3083 0x48, 0xF7, 0x22, 0x12, 0x9B, 0x45, 0xF5, 0xF8, 0xED, 0x01, 0xBE,
3084 0xFF, 0xB6, 0xFF, 0x57, 0x00, 0xCD, 0xFF, 0x0C, 0x00, 0x00, 0x00,
3085 0x28, 0x00, 0x61, 0xFF, 0x6C, 0x01, 0x71, 0xFD, 0x11, 0x04, 0xC8,
3086 0xF9, 0x0E, 0x0B, 0xFD, 0x47, 0x63, 0xFD, 0xAA, 0xFF, 0x03, 0x01,
3087 0x05, 0xFF, 0xAE, 0x00, 0xAC, 0xFF, 0x14, 0x00, 0x00, 0x00, 0x20,
3088 0x00, 0x7F, 0xFF, 0x1E, 0x01, 0x19, 0xFE, 0xC3, 0x02, 0x61, 0xFC,
3089 0x9B, 0x04, 0xF2, 0x48, 0xC6, 0x02, 0x2C, 0xFD, 0x5A, 0x02, 0x50,
3090 0xFE, 0x04, 0x01, 0x8A, 0xFF, 0x1D, 0x00, 0x17, 0x00, 0xA1, 0xFF,
3091 0xC9, 0x00, 0xCD, 0xFE, 0x6C, 0x01, 0xEA, 0xFE, 0xF3, 0xFE, 0x70,
3092 0x48, 0xFF, 0x08, 0x94, 0xFA, 0xAD, 0x03, 0xA3, 0xFD, 0x55, 0x01,
3093 0x6A, 0xFF, 0x26, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xC3, 0xFF, 0x71,
3094 0x00, 0x81, 0xFF, 0x1F, 0x00, 0x42, 0x01, 0x37, 0xFA, 0x7C, 0x46,
3095 0xE7, 0x0F, 0x08, 0xF8, 0xE6, 0x04, 0x0B, 0xFD, 0x99, 0x01, 0x4F,
3096 0xFF, 0x2E, 0x00, 0xFF, 0xFF, 0x08, 0x00, 0xE3, 0xFF, 0x1E, 0x00,
3097 0x2A, 0x00, 0xEF, 0xFE, 0x4D, 0x03, 0x7D, 0xF6, 0x2A, 0x43, 0x4B,
3098 0x17, 0xB0, 0xF5, 0xEF, 0x05, 0x93, 0xFC, 0xCB, 0x01, 0x3D, 0xFF,
3099 0x34, 0x00, 0xFE, 0xFF, 0x03, 0x00, 0xFF, 0xFF, 0xD4, 0xFF, 0xBF,
3100 0x00, 0xEB, 0xFD, 0xF3, 0x04, 0xCF, 0xF3, 0x98, 0x3E, 0xF3, 0x1E,
3101 0xB9, 0xF3, 0xB2, 0x06, 0x48, 0xFC, 0xE4, 0x01, 0x36, 0xFF, 0x36,
3102 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x16, 0x00, 0x96, 0xFF, 0x39, 0x01,
3103 0x1F, 0xFD, 0x28, 0x06, 0x2A, 0xF2, 0xF2, 0x38, 0xA0, 0x26, 0x4B,
3104 0xF2, 0x1C, 0x07, 0x32, 0xFC, 0xE0, 0x01, 0x3C, 0xFF, 0x35, 0x00,
3105 0xFD, 0xFF, 0xFD, 0xFF, 0x26, 0x00, 0x67, 0xFF, 0x94, 0x01, 0x90,
3106 0xFC, 0xE5, 0x06, 0x81, 0xF1, 0x6B, 0x32, 0x11, 0x2E, 0x8E, 0xF1,
3107 0x1D, 0x07, 0x58, 0xFC, 0xBC, 0x01, 0x52, 0xFF, 0x2E, 0x00, 0xFD,
3108 0xFF, 0xFD, 0xFF, 0x31, 0x00, 0x48, 0xFF, 0xCE, 0x01, 0x42, 0xFC,
3109 0x2A, 0x07, 0xBF, 0xF1, 0x40, 0x2B, 0x05, 0x35, 0xA6, 0xF1, 0xAB,
3110 0x06, 0xBF, 0xFC, 0x75, 0x01, 0x77, 0xFF, 0x21, 0x00, 0xFE, 0xFF,
3111 0xFD, 0xFF, 0x36, 0x00, 0x38, 0xFF, 0xE5, 0x01, 0x33, 0xFC, 0xFF,
3112 0x06, 0xC4, 0xF2, 0xB0, 0x23, 0x3B, 0x3B, 0xAD, 0xF2, 0xBF, 0x05,
3113 0x66, 0xFD, 0x0E, 0x01, 0xAC, 0xFF, 0x0E, 0x00, 0x00, 0x00, 0xFE,
3114 0xFF, 0x36, 0x00, 0x37, 0xFF, 0xDE, 0x01, 0x5F, 0xFC, 0x70, 0x06,
3115 0x6C, 0xF4, 0xFD, 0x1B, 0x7D, 0x40, 0xB7, 0xF4, 0x5D, 0x04, 0x49,
3116 0xFE, 0x88, 0x00, 0xEF, 0xFF, 0xF5, 0xFF, 0x04, 0x00, 0xFF, 0xFF,
3117 0x32, 0x00, 0x43, 0xFF, 0xBA, 0x01, 0xBC, 0xFC, 0x90, 0x05, 0x8E,
3118 0xF6, 0x68, 0x14, 0x99, 0x44, 0xCD, 0xF7, 0x8F, 0x02, 0x60, 0xFF,
3119 0xEA, 0xFF, 0x3E, 0x00, 0xD7, 0xFF, 0x0A, 0x00, 0x00, 0x00, 0x2B,
3120 0x00, 0x59, 0xFF, 0x81, 0x01, 0x42, 0xFD, 0x72, 0x04, 0xFF, 0xF8,
3121 0x2D, 0x0D, 0x69, 0x47, 0xEB, 0xFB, 0x63, 0x00, 0x9D, 0x00, 0x3C,
3122 0xFF, 0x93, 0x00, 0xB6, 0xFF, 0x12, 0x00, 0x00, 0x00, 0x22, 0x00,
3123 0x76, 0xFF, 0x37, 0x01, 0xE4, 0xFD, 0x2C, 0x03, 0x94, 0xFB, 0x83,
3124 0x06, 0xCE, 0x48, 0x05, 0x01, 0xF5, 0xFD, 0xF0, 0x01, 0x87, 0xFE,
3125 0xEA, 0x00, 0x94, 0xFF, 0x1A, 0x00, 0x1A, 0x00, 0x96, 0xFF, 0xE3,
3126 0x00, 0x95, 0xFE, 0xD5, 0x01, 0x26, 0xFE, 0x98, 0x00, 0xBF, 0x48,
3127 0x00, 0x07, 0x61, 0xFB, 0x46, 0x03, 0xD6, 0xFD, 0x3D, 0x01, 0x73,
3128 0xFF, 0x23, 0x00, 0x00, 0x00, 0x11, 0x00, 0xB9, 0xFF, 0x8C, 0x00,
3129 0x4A, 0xFF, 0x83, 0x00, 0x91, 0x00, 0x91, 0xFB, 0x3D, 0x47, 0xB7,
3130 0x0D, 0xCD, 0xF8, 0x89, 0x04, 0x36, 0xFD, 0x86, 0x01, 0x57, 0xFF,
3131 0x2B, 0x00, 0x00, 0x00, 0x0A, 0x00, 0xD9, 0xFF, 0x37, 0x00, 0xF7,
3132 0xFF, 0x49, 0xFF, 0xB6, 0x02, 0x86, 0xF7, 0x53, 0x44, 0xFB, 0x14,
3133 0x61, 0xF6, 0xA4, 0x05, 0xB4, 0xFC, 0xBE, 0x01, 0x42, 0xFF, 0x32,
3134 0x00, 0xFF, 0xFF, 0x04, 0x00, 0xF7, 0xFF, 0xEA, 0xFF, 0x93, 0x00,
3135 0x36, 0xFE, 0x7D, 0x04, 0x85, 0xF4, 0x1F, 0x40, 0x94, 0x1C, 0x47,
3136 0xF4, 0x7E, 0x06, 0x5A, 0xFC, 0xDF, 0x01, 0x37, 0xFF, 0x36, 0x00,
3137 0xFE, 0xFF, 0x00, 0x00, 0x0F, 0x00, 0xA8, 0xFF, 0x17, 0x01, 0x57,
3138 0xFD, 0xD6, 0x05, 0x90, 0xF2, 0xC8, 0x3A, 0x46, 0x24, 0xAA, 0xF2,
3139 0x06, 0x07, 0x32, 0xFC, 0xE5, 0x01, 0x39, 0xFF, 0x36, 0x00, 0xFD,
3140 0xFF, 0xFE, 0xFF, 0x22, 0x00, 0x74, 0xFF, 0x7C, 0x01, 0xB5, 0xFC,
3141 0xB8, 0x06, 0x9C, 0xF1, 0x81, 0x34, 0xD1, 0x2B, 0xB3, 0xF1, 0x29,
3142 0x07, 0x46, 0xFC, 0xCA, 0x01, 0x4A, 0xFF, 0x30, 0x00, 0xFD, 0xFF,
3143 0xFD, 0xFF, 0x2E, 0x00, 0x50, 0xFF, 0xC0, 0x01, 0x53, 0xFC, 0x21,
3144 0x07, 0x96, 0xF1, 0x82, 0x2D, 0xF2, 0x32, 0x86, 0xF1, 0xDB, 0x06,
3145 0x99, 0xFC, 0x8E, 0x01, 0x6A, 0xFF, 0x25, 0x00, 0xFD, 0xFF, 0xFD,
3146 0xFF, 0x35, 0x00, 0x3B, 0xFF, 0xE2, 0x01, 0x31, 0xFC, 0x17, 0x07,
3147 0x61, 0xF2, 0x0A, 0x26, 0x6A, 0x39, 0x41, 0xF2, 0x15, 0x06, 0x2C,
3148 0xFD, 0x31, 0x01, 0x9B, 0xFF, 0x14, 0x00, 0xFF, 0xFF, 0xFE, 0xFF,
3149 0x36, 0x00, 0x36, 0xFF, 0xE3, 0x01, 0x4C, 0xFC, 0xA6, 0x06, 0xDB,
3150 0xF3, 0x5B, 0x1E, 0xFC, 0x3E, 0xFA, 0xF3, 0xD7, 0x04, 0xFD, 0xFD,
3151 0xB4, 0x00, 0xD9, 0xFF, 0xFD, 0xFF, 0x03, 0x00, 0xFF, 0xFF, 0x33,
3152 0x00, 0x3E, 0xFF, 0xC8, 0x01, 0x9B, 0xFC, 0xDD, 0x05, 0xDC, 0xF5,
3153 0xB6, 0x16, 0x77, 0x43, 0xBD, 0xF6, 0x28, 0x03, 0x05, 0xFF, 0x1D,
3154 0x00, 0x25, 0x00, 0xE1, 0xFF, 0x08, 0x00, 0xFF, 0xFF, 0x2D, 0x00,
3155 0x51, 0xFF, 0x95, 0x01, 0x15, 0xFD, 0xCF, 0x04, 0x39, 0xF8, 0x59,
3156 0x0F, 0xAF, 0x46, 0x8B, 0xFA, 0x17, 0x01, 0x38, 0x00, 0x73, 0xFF,
3157 0x78, 0x00, 0xC0, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x25, 0x00, 0x6C,
3158 0xFF, 0x4F, 0x01, 0xB0, 0xFD, 0x93, 0x03, 0xC7, 0xFA, 0x7D, 0x08,
3159 0x86, 0x48, 0x5A, 0xFF, 0xBA, 0xFE, 0x86, 0x01, 0xBF, 0xFE, 0xCF,
3160 0x00, 0x9E, 0xFF, 0x17, 0x00, 0x1C, 0x00, 0x8C, 0xFF, 0xFE, 0x00,
3161 0x5D, 0xFE, 0x3F, 0x02, 0x5E, 0xFD, 0x54, 0x02, 0xEC, 0x48, 0x13,
3162 0x05, 0x2E, 0xFC, 0xDE, 0x02, 0x0C, 0xFE, 0x24, 0x01, 0x7D, 0xFF,
3163 0x20, 0x00, 0x00, 0x00, 0x14, 0x00, 0xAE, 0xFF, 0xA7, 0x00, 0x12,
3164 0xFF, 0xEA, 0x00, 0xD9, 0xFF, 0x03, 0xFD, 0xDC, 0x47, 0x95, 0x0B,
3165 0x96, 0xF9, 0x29, 0x04, 0x65, 0xFD, 0x71, 0x01, 0x5F, 0xFF, 0x29,
3166 0x00, 0x00, 0x00, 0x0C, 0x00, 0xD0, 0xFF, 0x51, 0x00, 0xC3, 0xFF,
3167 0xA6, 0xFF, 0x16, 0x02, 0xA9, 0xF8, 0x5C, 0x45, 0xB2, 0x12, 0x19,
3168 0xF7, 0x52, 0x05, 0xD8, 0xFC, 0xAF, 0x01, 0x47, 0xFF, 0x30, 0x00,
3169 0xFF, 0xFF, 0x06, 0x00, 0xEE, 0xFF, 0x01, 0x00, 0x66, 0x00, 0x85,
3170 0xFE, 0xFC, 0x03, 0x55, 0xF5, 0x8C, 0x41, 0x38, 0x1A, 0xE1, 0xF4,
3171 0x43, 0x06, 0x70, 0xFC, 0xD8, 0x01, 0x39, 0xFF, 0x35, 0x00, 0xFE,
3172 0xFF, 0x01, 0x00, 0x08, 0x00, 0xBB, 0xFF, 0xF1, 0x00, 0x96, 0xFD,
3173 0x78, 0x05, 0x0E, 0xF3, 0x8A, 0x3C, 0xEA, 0x21, 0x19, 0xF3, 0xE6,
3174 0x06, 0x38, 0xFC, 0xE6, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD, 0xFF,
3175 0xFE, 0xFF, 0x1D, 0x00, 0x82, 0xFF, 0x60, 0x01, 0xE0, 0xFC, 0x7F,
3176 0x06, 0xCC, 0xF1, 0x85, 0x36, 0x87, 0x29, 0xEB, 0xF1, 0x2A, 0x07,
3177 0x39, 0xFC, 0xD6, 0x01, 0x43, 0xFF, 0x33, 0x00, 0xFD, 0xFF, 0xFD,
3178 0xFF, 0x2B, 0x00, 0x59, 0xFF, 0xAE, 0x01, 0x6A, 0xFC, 0x0D, 0x07,
3179 0x80, 0xF1, 0xB8, 0x2F, 0xCF, 0x30, 0x7D, 0xF1, 0xFF, 0x06, 0x78,
3180 0xFC, 0xA5, 0x01, 0x5F, 0xFF, 0x29, 0x00, 0xFD, 0xFF, 0xFD, 0xFF,
3181 0x34, 0x00, 0x40, 0xFF, 0xDB, 0x01, 0x35, 0xFC, 0x26, 0x07, 0x0E,
3182 0xF2, 0x60, 0x28, 0x82, 0x37, 0xED, 0xF1, 0x5E, 0x06, 0xF8, 0xFC,
3183 0x51, 0x01, 0x8A, 0xFF, 0x1A, 0x00, 0xFF, 0xFF, 0xFD, 0xFF, 0x36,
3184 0x00, 0x36, 0xFF, 0xE6, 0x01, 0x3E, 0xFC, 0xD3, 0x06, 0x56, 0xF3,
3185 0xBA, 0x20, 0x61, 0x3D, 0x56, 0xF3, 0x45, 0x05, 0xB7, 0xFD, 0xDE,
3186 0x00, 0xC5, 0xFF, 0x05, 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x35, 0x00,
3187 0x3A, 0xFF, 0xD3, 0x01, 0x7D, 0xFC, 0x23, 0x06, 0x32, 0xF5, 0x0C,
3188 0x19, 0x38, 0x42, 0xC7, 0xF5, 0xB8, 0x03, 0xAF, 0xFE, 0x4E, 0x00,
3189 0x0C, 0x00, 0xEA, 0xFF, 0x06, 0x00, 0xFF, 0xFF, 0x2F, 0x00, 0x4A,
3190 0xFF, 0xA7, 0x01, 0xEC, 0xFC, 0x28, 0x05, 0x77, 0xF7, 0x92, 0x11,
3191 0xD7, 0x45, 0x43, 0xF9, 0xC3, 0x01, 0xD6, 0xFF, 0xA9, 0xFF, 0x5E,
3192 0x00, 0xCB, 0xFF, 0x0D, 0x00, 0x00, 0x00, 0x28, 0x00, 0x63, 0xFF,
3193 0x66, 0x01, 0x7D, 0xFD, 0xF8, 0x03, 0xFB, 0xF9, 0x89, 0x0A, 0x1D,
3194 0x48, 0xC5, 0xFD, 0x7A, 0xFF, 0x1D, 0x01, 0xF7, 0xFE, 0xB4, 0x00,
3195 0xA9, 0xFF, 0x15, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x82, 0xFF, 0x18,
3196 0x01, 0x27, 0xFE, 0xA9, 0x02, 0x94, 0xFC, 0x24, 0x04, 0xF5, 0x48,
3197 0x39, 0x03, 0xF9, 0xFC, 0x74, 0x02, 0x42, 0xFE, 0x0B, 0x01, 0x87,
3198 0xFF, 0x1E, 0x00, 0x16, 0x00, 0xA4, 0xFF, 0xC2, 0x00, 0xDB, 0xFE,
3199 0x52, 0x01, 0x1B, 0xFF, 0x8D, 0xFE, 0x57, 0x48, 0x81, 0x09, 0x61,
3200 0xFA, 0xC6, 0x03, 0x96, 0xFD, 0x5B, 0x01, 0x68, 0xFF, 0x26, 0x00,
3201 0x00, 0x00, 0x0E, 0x00, 0xC6, 0xFF, 0x6B, 0x00, 0x8E, 0xFF, 0x06,
3202 0x00, 0x6E, 0x01, 0xE4, 0xF9, 0x48, 0x46, 0x75, 0x10, 0xD7, 0xF7,
3203 0xFC, 0x04, 0x00, 0xFD, 0x9E, 0x01, 0x4E, 0xFF, 0x2E, 0x00, 0xFF,
3204 0xFF, 0x07, 0x00, 0xE5, 0xFF, 0x18, 0x00, 0x36, 0x00, 0xD9, 0xFE,
3205 0x71, 0x03, 0x3F, 0xF6, 0xDB, 0x42, 0xE0, 0x17, 0x86, 0xF5, 0x00,
3206 0x06, 0x8C, 0xFC, 0xCE, 0x01, 0x3C, 0xFF, 0x34, 0x00, 0xFE, 0xFF,
3207 0x02, 0x00, 0x01, 0x00, 0xCF, 0xFF, 0xC9, 0x00, 0xDA, 0xFD, 0x0F,
3208 0x05, 0xA5, 0xF3, 0x31, 0x3E, 0x8A, 0x1F, 0x97, 0xF3, 0xBD, 0x06,
3209 0x44, 0xFC, 0xE5, 0x01, 0x36, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0xFF,
3210 0xFF, 0x17, 0x00, 0x92, 0xFF, 0x41, 0x01, 0x11, 0xFD, 0x3B, 0x06,
3211 0x14, 0xF2, 0x78, 0x38, 0x36, 0x27, 0x35, 0xF2, 0x20, 0x07, 0x33,
3212 0xFC, 0xDF, 0x01, 0x3E, 0xFF, 0x34, 0x00, 0xFD, 0xFF, 0xFD, 0xFF,
3213 0x28, 0x00, 0x64, 0xFF, 0x9A, 0x01, 0x88, 0xFC, 0xEE, 0x06, 0x7E,
3214 0xF1, 0xE3, 0x31, 0x9F, 0x2E, 0x88, 0xF1, 0x19, 0x07, 0x5E, 0xFC,
3215 0xB7, 0x01, 0x54, 0xFF, 0x2D, 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x32,
3216 0x00, 0x46, 0xFF, 0xD1, 0x01, 0x3F, 0xFC, 0x2B, 0x07, 0xCD, 0xF1,
3217 0xAE, 0x2A, 0x86, 0x35, 0xB1, 0xF1, 0x9D, 0x06, 0xCA, 0xFC, 0x6E,
3218 0x01, 0x7B, 0xFF, 0x20, 0x00, 0xFE, 0xFF, 0xFD, 0xFF, 0x36, 0x00,
3219 0x38, 0xFF, 0xE6, 0x01, 0x35, 0xFC, 0xF7, 0x06, 0xE0, 0xF2, 0x18,
3220 0x23, 0xAB, 0x3B, 0xCC, 0xF2, 0xA8, 0x05, 0x76, 0xFD, 0x04, 0x01,
3221 0xB1, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x38,
3222 0xFF, 0xDC, 0x01, 0x64, 0xFC, 0x62, 0x06, 0x93, 0xF4, 0x66, 0x1B,
3223 0xD9, 0x40, 0xEA, 0xF4, 0x3E, 0x04, 0x5D, 0xFE, 0x7D, 0x00, 0xF5,
3224 0xFF, 0xF3, 0xFF, 0x05, 0x00, 0xFF, 0xFF, 0x31, 0x00, 0x44, 0xFF,
3225 0xB7, 0x01, 0xC5, 0xFC, 0x7C, 0x05, 0xBC, 0xF6, 0xD5, 0x13, 0xDC,
3226 0x44, 0x14, 0xF8, 0x67, 0x02, 0x77, 0xFF, 0xDD, 0xFF, 0x44, 0x00,
3227 0xD5, 0xFF, 0x0B, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x5B, 0xFF, 0x7C,
3228 0x01, 0x4E, 0xFD, 0x5A, 0x04, 0x31, 0xF9, 0xA4, 0x0C, 0x90, 0x47,
3229 0x47, 0xFC, 0x36, 0x00, 0xB6, 0x00, 0x2E, 0xFF, 0x99, 0x00, 0xB3,
3230 0xFF, 0x12, 0x00, 0x00, 0x00, 0x22, 0x00, 0x78, 0xFF, 0x31, 0x01,
3231 0xF1, 0xFD, 0x12, 0x03, 0xC7, 0xFB, 0x07, 0x06, 0xDB, 0x48, 0x73,
3232 0x01, 0xC3, 0xFD, 0x0A, 0x02, 0x79, 0xFE, 0xF1, 0x00, 0x91, 0xFF,
3233 0x1B, 0x00, 0x19, 0x00, 0x99, 0xFF, 0xDD, 0x00, 0xA3, 0xFE, 0xBB,
3234 0x01, 0x58, 0xFE, 0x2D, 0x00, 0xAF, 0x48, 0x7E, 0x07, 0x2E, 0xFB,
3235 0x60, 0x03, 0xC9, 0xFD, 0x43, 0x01, 0x71, 0xFF, 0x24, 0x00, 0x00,
3236 0x00, 0x10, 0x00, 0xBB, 0xFF, 0x85, 0x00, 0x58, 0xFF, 0x6A, 0x00,
3237 0xBE, 0x00, 0x38, 0xFB, 0x0F, 0x47, 0x42, 0x0E, 0x9B, 0xF8, 0xA1,
3238 0x04, 0x2B, 0xFD, 0x8B, 0x01, 0x55, 0xFF, 0x2C, 0x00, 0xFF, 0xFF,
3239 0x09, 0x00, 0xDC, 0xFF, 0x31, 0x00, 0x04, 0x00, 0x32, 0xFF, 0xDC,
3240 0x02, 0x42, 0xF7, 0x0B, 0x44, 0x8E, 0x15, 0x34, 0xF6, 0xB7, 0x05,
3241 0xAB, 0xFC, 0xC1, 0x01, 0x40, 0xFF, 0x33, 0x00, 0xFF, 0xFF, 0x04,
3242 0x00, 0xF9, 0xFF, 0xE4, 0xFF, 0x9F, 0x00, 0x23, 0xFE, 0x9B, 0x04,
3243 0x55, 0xF4, 0xC0, 0x3F, 0x2C, 0x1D, 0x22, 0xF4, 0x8C, 0x06, 0x55,
3244 0xFC, 0xE1, 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFE, 0xFF, 0x00, 0x00,
3245 0x11, 0x00, 0xA3, 0xFF, 0x20, 0x01, 0x49, 0xFD, 0xEB, 0x05, 0x74,
3246 0xF2, 0x54, 0x3A, 0xDD, 0x24, 0x91, 0xF2, 0x0C, 0x07, 0x32, 0xFC,
3247 0xE4, 0x01, 0x3A, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0xFE, 0xFF, 0x23,
3248 0x00, 0x71, 0xFF, 0x82, 0x01, 0xAB, 0xFC, 0xC4, 0x06, 0x93, 0xF1,
3249 0xFD, 0x33, 0x62, 0x2C, 0xA8, 0xF1, 0x27, 0x07, 0x4A, 0xFC, 0xC7,
3250 0x01, 0x4C, 0xFF, 0x30, 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x2F, 0x00,
3251 0x4E, 0xFF, 0xC3, 0x01, 0x4E, 0xFC, 0x24, 0x07, 0x9E, 0xF1, 0xF2,
3252 0x2C, 0x78, 0x33, 0x8C, 0xF1, 0xD0, 0x06, 0xA2, 0xFC, 0x88, 0x01,
3253 0x6D, 0xFF, 0x24, 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x35, 0x00, 0x3B,
3254 0xFF, 0xE3, 0x01, 0x31, 0xFC, 0x12, 0x07, 0x79, 0xF2, 0x73, 0x25,
3255 0xDF, 0x39, 0x5A, 0xF2, 0x00, 0x06, 0x3A, 0xFD, 0x28, 0x01, 0x9F,
3256 0xFF, 0x13, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x36, 0x00, 0x36, 0xFF,
3257 0xE2, 0x01, 0x50, 0xFC, 0x99, 0x06, 0xFE, 0xF3, 0xC3, 0x1D, 0x5E,
3258 0x3F, 0x27, 0xF4, 0xB9, 0x04, 0x10, 0xFE, 0xA9, 0x00, 0xDF, 0xFF,
3259 0xFB, 0xFF, 0x03, 0x00, 0xFF, 0xFF, 0x33, 0x00, 0x3F, 0xFF, 0xC5,
3260 0x01, 0xA3, 0xFC, 0xCA, 0x05, 0x07, 0xF6, 0x22, 0x16, 0xC3, 0x43,
3261 0xFE, 0xF6, 0x02, 0x03, 0x1B, 0xFF, 0x11, 0x00, 0x2B, 0x00, 0xDE,
3262 0xFF, 0x09, 0x00, 0xFF, 0xFF, 0x2D, 0x00, 0x53, 0xFF, 0x90, 0x01,
3263 0x20, 0xFD, 0xB8, 0x04, 0x6A, 0xF8, 0xCD, 0x0E, 0xE1, 0x46, 0xE1,
3264 0xFA, 0xEB, 0x00, 0x51, 0x00, 0x65, 0xFF, 0x7F, 0x00, 0xBE, 0xFF,
3265 0x10, 0x00, 0x00, 0x00, 0x24, 0x00, 0x6E, 0xFF, 0x49, 0x01, 0xBC,
3266 0xFD, 0x7A, 0x03, 0xFA, 0xFA, 0xFD, 0x07, 0x9C, 0x48, 0xC3, 0xFF,
3267 0x89, 0xFE, 0xA1, 0x01, 0xB1, 0xFE, 0xD6, 0x00, 0x9C, 0xFF, 0x18,
3268 0x00, 0x1C, 0x00, 0x8F, 0xFF, 0xF7, 0x00, 0x6B, 0xFE, 0x25, 0x02,
3269 0x91, 0xFD, 0xE3, 0x01, 0xE5, 0x48, 0x8D, 0x05, 0xFB, 0xFB, 0xF8,
3270 0x02, 0xFE, 0xFD, 0x2B, 0x01, 0x7A, 0xFF, 0x21, 0x00, 0x00, 0x00,
3271 0x13, 0x00, 0xB1, 0xFF, 0xA0, 0x00, 0x20, 0xFF, 0xD0, 0x00, 0x07,
3272 0x00, 0xA4, 0xFC, 0xB6, 0x47, 0x1C, 0x0C, 0x63, 0xF9, 0x42, 0x04,
3273 0x59, 0xFD, 0x76, 0x01, 0x5D, 0xFF, 0x2A, 0x00, 0x00, 0x00, 0x0B,
3274 0x00, 0xD2, 0xFF, 0x4A, 0x00, 0xD0, 0xFF, 0x8E, 0xFF, 0x3F, 0x02,
3275 0x5E, 0xF8, 0x1E, 0x45, 0x44, 0x13, 0xEA, 0xF6, 0x67, 0x05, 0xCF,
3276 0xFC, 0xB3, 0x01, 0x46, 0xFF, 0x31, 0x00, 0xFF, 0xFF, 0x05, 0x00,
3277 0xF0, 0xFF, 0xFB, 0xFF, 0x71, 0x00, 0x71, 0xFE, 0x1D, 0x04, 0x1F,
3278 0xF5, 0x32, 0x41, 0xCE, 0x1A, 0xBA, 0xF4, 0x53, 0x06, 0x6A, 0xFC,
3279 0xDA, 0x01, 0x38, 0xFF, 0x35, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x0A,
3280 0x00, 0xB6, 0xFF, 0xFB, 0x00, 0x85, 0xFD, 0x90, 0x05, 0xEC, 0xF2,
3281 0x1C, 0x3C, 0x81, 0x22, 0xFC, 0xF2, 0xEF, 0x06, 0x36, 0xFC, 0xE6,
3282 0x01, 0x37, 0xFF, 0x36, 0x00, 0xFD, 0xFF, 0xFE, 0xFF, 0x1E, 0x00,
3283 0x7F, 0xFF, 0x67, 0x01, 0xD5, 0xFC, 0x8E, 0x06, 0xBE, 0xF1, 0x06,
3284 0x36, 0x1A, 0x2A, 0xDC, 0xF1, 0x2A, 0x07, 0x3C, 0xFC, 0xD3, 0x01,
3285 0x44, 0xFF, 0x32, 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x2C, 0x00, 0x57,
3286 0xFF, 0xB3, 0x01, 0x64, 0xFC, 0x13, 0x07, 0x83, 0xF1, 0x2C, 0x2F,
3287 0x5A, 0x31, 0x7D, 0xF1, 0xF7, 0x06, 0x80, 0xFC, 0x9F, 0x01, 0x61,
3288 0xFF, 0x29, 0x00, 0xFD, 0xFF, 0xFD, 0xFF, 0x34, 0x00, 0x3F, 0xFF,
3289 0xDD, 0x01, 0x34, 0xFC, 0x23, 0x07, 0x21, 0xF2, 0xCB, 0x27, 0xFE,
3290 0x37, 0x00, 0xF2, 0x4D, 0x06, 0x04, 0xFD, 0x49, 0x01, 0x8E, 0xFF,
3291 0x19, 0x00, 0xFF, 0xFF, 0xFD, 0xFF, 0x36, 0x00, 0x36, 0xFF, 0xE6,
3292 0x01, 0x41, 0xFC, 0xC8, 0x06, 0x76, 0xF3, 0x22, 0x20, 0xCA, 0x3D,
3293 0x7D, 0xF3, 0x2A, 0x05, 0xC8, 0xFD, 0xD4, 0x00, 0xCA, 0xFF, 0x03,
3294 0x00, 0x02, 0x00, 0xFE, 0xFF, 0x34, 0x00, 0x3B, 0xFF, 0xD1, 0x01,
3295 0x84, 0xFC, 0x12, 0x06, 0x5C, 0xF5, 0x76, 0x18, 0x89, 0x42, 0x02,
3296 0xF6, 0x94, 0x03, 0xC4, 0xFE, 0x42, 0x00, 0x12, 0x00, 0xE8, 0xFF,
3297 0x07, 0x00, 0xFF, 0xFF, 0x2F, 0x00, 0x4C, 0xFF, 0xA2, 0x01, 0xF6,
3298 0xFC, 0x12, 0x05, 0xA7, 0xF7, 0x03, 0x11, 0x10, 0x46, 0x93, 0xF9,
3299 0x98, 0x01, 0xEE, 0xFF, 0x9B, 0xFF, 0x64, 0x00, 0xC8, 0xFF, 0x0E,
3300 0x00, 0x00, 0x00, 0x27, 0x00, 0x65, 0xFF, 0x60, 0x01, 0x8A, 0xFD,
3301 0xDF, 0x03, 0x2E, 0xFA, 0x04, 0x0A, 0x3A, 0x48, 0x28, 0xFE, 0x4B,
3302 0xFF, 0x38, 0x01, 0xE9, 0xFE, 0xBB, 0x00, 0xA6, 0xFF, 0x16, 0x00,
3303 0x00, 0x00, 0x1E, 0x00, 0x84, 0xFF, 0x11, 0x01, 0x34, 0xFE, 0x8F,
3304 0x02, 0xC7, 0xFC, 0xAE, 0x03, 0xF7, 0x48, 0xAE, 0x03, 0xC7, 0xFC,
3305 0x8F, 0x02, 0x34, 0xFE, 0x11, 0x01, 0x84, 0xFF, 0x1E, 0x00, 0x00,
3306 0x00, 0xF4, 0xFF, 0x1A, 0x00, 0xFF, 0x00, 0x07, 0x03, 0x16, 0x06,
3307 0x7C, 0x09, 0x2A, 0x0C, 0x2E, 0x0D, 0x2A, 0x0C, 0x7C, 0x09, 0x16,
3308 0x06, 0x07, 0x03, 0xFF, 0x00, 0x1A, 0x00, 0xF4, 0xFF, 0xF2, 0xFF,
3309 0xA0, 0xFF, 0x71, 0xFF, 0x71, 0x00, 0x86, 0x03, 0x73, 0x08, 0x88,
3310 0x0D, 0x78, 0x10, 0xC9, 0x0F, 0xD5, 0x0B, 0x8B, 0x06, 0x28, 0x02,
3311 0xDF, 0xFF, 0x6F, 0xFF, 0xC3, 0xFF, 0xFD, 0xFF, 0x00, 0x00, 0xDC,
3312 0xFF, 0x80, 0xFF, 0x9A, 0xFF, 0x46, 0x01, 0x1E, 0x05, 0x5A, 0x0A,
3313 0xED, 0x0E, 0xAA, 0x10, 0xAF, 0x0E, 0xFD, 0x09, 0xCB, 0x04, 0x18,
3314 0x01, 0x8E, 0xFF, 0x85, 0xFF, 0xE1, 0xFF, 0xFC, 0xFF, 0xBD, 0xFF,
3315 0x6D, 0xFF, 0xF6, 0xFF, 0x65, 0x02, 0xE5, 0x06, 0x2B, 0x0C, 0xF3,
3316 0x0F, 0x60, 0x10, 0x3B, 0x0D, 0x16, 0x08, 0x3F, 0x03, 0x50, 0x00,
3317 0x6E, 0xFF, 0xA7, 0xFF, 0xF5, 0xFF, 0xEF, 0xFF, 0x9A, 0xFF, 0x75,
3318 0xFF, 0x91, 0x00, 0xC9, 0x03, 0xC8, 0x08, 0xCC, 0x0D, 0x89, 0x10,
3319 0x9F, 0x0F, 0x85, 0x0B, 0x3B, 0x06, 0xF4, 0x01, 0xCD, 0xFF, 0x72,
3320 0xFF, 0xC9, 0xFF, 0xFE, 0xFF, 0x00, 0x00, 0xD7, 0xFF, 0x7B, 0xFF,
3321 0xA5, 0xFF, 0x73, 0x01, 0x6A, 0x05, 0xAD, 0x0A, 0x21, 0x0F, 0xA6,
3322 0x10, 0x74, 0x0E, 0xA9, 0x09, 0x83, 0x04, 0xF0, 0x00, 0x85, 0xFF,
3323 0x8B, 0xFF, 0xE5, 0xFF, 0xFA, 0xFF, 0xB7, 0xFF, 0x6C, 0xFF, 0x0C,
3324 0x00, 0x9D, 0x02, 0x37, 0x07, 0x78, 0x0C, 0x15, 0x10, 0x47, 0x10,
3325 0xF3, 0x0C, 0xC2, 0x07, 0x01, 0x03, 0x35, 0x00, 0x6D, 0xFF, 0xAD,
3326 0xFF, 0xF7, 0xFF, 0xEB, 0xFF, 0x94, 0xFF, 0x7A, 0xFF, 0xB3, 0x00,
3327 0x0D, 0x04, 0x1C, 0x09, 0x0D, 0x0E, 0x97, 0x10, 0x73, 0x0F, 0x35,
3328 0x0B, 0xEB, 0x05, 0xC1, 0x01, 0xBD, 0xFF, 0x75, 0xFF, 0xCE, 0xFF,
3329 0xFF, 0xFF, 0xFF, 0xFF, 0xD2, 0xFF, 0x77, 0xFF, 0xB3, 0xFF, 0xA1,
3330 0x01, 0xB7, 0x05, 0xFF, 0x0A, 0x53, 0x0F, 0x9E, 0x10, 0x37, 0x0E,
3331 0x55, 0x09, 0x3B, 0x04, 0xCB, 0x00, 0x7E, 0xFF, 0x90, 0xFF, 0xE9,
3332 0xFF, 0xF8, 0xFF, 0xB1, 0xFF, 0x6C, 0xFF, 0x24, 0x00, 0xD8, 0x02,
3333 0x8A, 0x07, 0xC2, 0x0C, 0x34, 0x10, 0x2A, 0x10, 0xAA, 0x0C, 0x6F,
3334 0x07, 0xC4, 0x02, 0x1C, 0x00, 0x6C, 0xFF, 0xB3, 0xFF, 0xF9, 0xFF,
3335 0xE8, 0xFF, 0x8E, 0xFF, 0x80, 0xFF, 0xD7, 0x00, 0x53, 0x04, 0x71,
3336 0x09, 0x4C, 0x0E, 0xA1, 0x10, 0x43, 0x0F, 0xE3, 0x0A, 0x9D, 0x05,
3337 0x91, 0x01, 0xAE, 0xFF, 0x79, 0xFF, 0xD4, 0xFF, 0x00, 0x00, 0xFF,
3338 0xFF, 0xCD, 0xFF, 0x74, 0xFF, 0xC2, 0xFF, 0xD2, 0x01, 0x06, 0x06,
3339 0x50, 0x0B, 0x82, 0x0F, 0x93, 0x10, 0xF8, 0x0D, 0x00, 0x09, 0xF6,
3340 0x03, 0xA7, 0x00, 0x78, 0xFF, 0x96, 0xFF, 0xEC, 0xFF, 0xF6, 0xFF,
3341 0xAB, 0xFF, 0x6D, 0xFF, 0x3E, 0x00, 0x15, 0x03, 0xDE, 0x07, 0x0B,
3342 0x0D, 0x50, 0x10, 0x0A, 0x10, 0x5E, 0x0C, 0x1C, 0x07, 0x8A, 0x02,
3343 0x04, 0x00, 0x6C, 0xFF, 0xB9, 0xFF, 0xFB, 0xFF, 0xE4, 0xFF, 0x89,
3344 0xFF, 0x88, 0xFF, 0xFD, 0x00, 0x9B, 0x04, 0xC5, 0x09, 0x88, 0x0E,
3345 0xA8, 0x10, 0x10, 0x0F, 0x91, 0x0A, 0x50, 0x05, 0x64, 0x01, 0xA1,
3346 0xFF, 0x7D, 0xFF, 0xD9, 0xFF, 0x00, 0x00, 0xFE, 0xFF, 0xC7, 0xFF,
3347 0x71, 0xFF, 0xD3, 0xFF, 0x05, 0x02, 0x55, 0x06, 0xA0, 0x0B, 0xAD,
3348 0x0F, 0x84, 0x10, 0xB6, 0x0D, 0xAC, 0x08, 0xB3, 0x03, 0x86, 0x00,
3349 0x74, 0xFF, 0x9C, 0xFF, 0xF0, 0xFF, 0xF4, 0xFF, 0xA5, 0xFF, 0x6F,
3350 0xFF, 0x5A, 0x00, 0x54, 0x03, 0x32, 0x08, 0x52, 0x0D, 0x68, 0x10,
3351 0xE6, 0x0F, 0x11, 0x0C, 0xCA, 0x06, 0x52, 0x02, 0xEF, 0xFF, 0x6E,
3352 0xFF, 0xBF, 0xFF, 0xFC, 0xFF, 0xDF, 0xFF, 0x84, 0xFF, 0x91, 0xFF,
3353 0x25, 0x01, 0xE4, 0x04, 0x19, 0x0A, 0xC2, 0x0E, 0xAA, 0x10, 0xDA,
3354 0x0E, 0x3E, 0x0A, 0x05, 0x05, 0x38, 0x01, 0x96, 0xFF, 0x81, 0xFF,
3355 0xDD, 0xFF, 0x00, 0x00, 0xFD, 0xFF, 0xC1, 0xFF, 0x6E, 0xFF, 0xE6,
3356 0xFF, 0x3A, 0x02, 0xA6, 0x06, 0xEF, 0x0B, 0xD6, 0x0F, 0x71, 0x10,
3357 0x71, 0x0D, 0x57, 0x08, 0x71, 0x03, 0x67, 0x00, 0x70, 0xFF, 0xA2,
3358 0xFF, 0xF3, 0xFF, 0xF1, 0xFF, 0x9F, 0xFF, 0x72, 0xFF, 0x78, 0x00,
3359 0x95, 0x03, 0x86, 0x08, 0x98, 0x0D, 0x7C, 0x10, 0xC0, 0x0F, 0xC3,
3360 0x0B, 0x79, 0x06, 0x1C, 0x02, 0xDB, 0xFF, 0x70, 0xFF, 0xC5, 0xFF,
3361 0xFE, 0xFF, 0x00, 0x00, 0xDB, 0xFF, 0x7F, 0xFF, 0x9C, 0xFF, 0x50,
3362 0x01, 0x2F, 0x05, 0x6C, 0x0A, 0xF9, 0x0E, 0xA9, 0x10, 0xA2, 0x0E,
3363 0xEA, 0x09, 0xBB, 0x04, 0x0F, 0x01, 0x8C, 0xFF, 0x87, 0xFF, 0xE2,
3364 0xFF, 0xFC, 0xFF, 0xBC, 0xFF, 0x6D, 0xFF, 0xFA, 0xFF, 0x71, 0x02,
3365 0xF7, 0x06, 0x3C, 0x0C, 0xFB, 0x0F, 0x5B, 0x10, 0x2B, 0x0D, 0x03,
3366 0x08, 0x31, 0x03, 0x4A, 0x00, 0x6E, 0xFF, 0xA8, 0xFF, 0xF5, 0xFF,
3367 0xEE, 0xFF, 0x99, 0xFF, 0x76, 0xFF, 0x98, 0x00, 0xD8, 0x03, 0xDB,
3368 0x08, 0xDB, 0x0D, 0x8D, 0x10, 0x96, 0x0F, 0x73, 0x0B, 0x29, 0x06,
3369 0xE8, 0x01, 0xC9, 0xFF, 0x72, 0xFF, 0xCA, 0xFF, 0xFE, 0xFF, 0x00,
3370 0x00, 0xD6, 0xFF, 0x7A, 0xFF, 0xA8, 0xFF, 0x7D, 0x01, 0x7B, 0x05,
3371 0xBF, 0x0A, 0x2D, 0x0F, 0xA5, 0x10, 0x67, 0x0E, 0x96, 0x09, 0x73,
3372 0x04, 0xE7, 0x00, 0x84, 0xFF, 0x8C, 0xFF, 0xE6, 0xFF, 0xFA, 0xFF,
3373 0xB6, 0xFF, 0x6C, 0xFF, 0x11, 0x00, 0xAA, 0x02, 0x4A, 0x07, 0x88,
3374 0x0C, 0x1C, 0x10, 0x41, 0x10, 0xE3, 0x0C, 0xAF, 0x07, 0xF3, 0x02,
3375 0x2F, 0x00, 0x6C, 0xFF, 0xAE, 0xFF, 0xF7, 0xFF, 0xEA, 0xFF, 0x93,
3376 0xFF, 0x7B, 0xFF, 0xBB, 0x00, 0x1C, 0x04, 0x2F, 0x09, 0x1B, 0x0E,
3377 0x9A, 0x10, 0x68, 0x0F, 0x23, 0x0B, 0xDA, 0x05, 0xB7, 0x01, 0xB9,
3378 0xFF, 0x76, 0xFF, 0xD0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xD1, 0xFF,
3379 0x76, 0xFF, 0xB6, 0xFF, 0xAC, 0x01, 0xC8, 0x05, 0x11, 0x0B, 0x5E,
3380 0x0F, 0x9C, 0x10, 0x29, 0x0E, 0x42, 0x09, 0x2C, 0x04, 0xC2, 0x00,
3381 0x7D, 0xFF, 0x92, 0xFF, 0xEA, 0xFF, 0xF8, 0xFF, 0xB0, 0xFF, 0x6C,
3382 0xFF, 0x29, 0x00, 0xE6, 0x02, 0x9D, 0x07, 0xD3, 0x0C, 0x3B, 0x10,
3383 0x23, 0x10, 0x99, 0x0C, 0x5C, 0x07, 0xB7, 0x02, 0x16, 0x00, 0x6C,
3384 0xFF, 0xB4, 0xFF, 0xF9, 0xFF, 0xE7, 0xFF, 0x8D, 0xFF, 0x82, 0xFF,
3385 0xDF, 0x00, 0x63, 0x04, 0x84, 0x09, 0x59, 0x0E, 0xA3, 0x10, 0x38,
3386 0x0F, 0xD1, 0x0A, 0x8C, 0x05, 0x87, 0x01, 0xAB, 0xFF, 0x79, 0xFF,
3387 0xD5, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xCB, 0xFF, 0x73, 0xFF, 0xC6,
3388 0xFF, 0xDD, 0x01, 0x17, 0x06, 0x62, 0x0B, 0x8C, 0x0F, 0x90, 0x10,
3389 0xE9, 0x0D, 0xED, 0x08, 0xE7, 0x03, 0xA0, 0x00, 0x77, 0xFF, 0x97,
3390 0xFF, 0xED, 0xFF, 0xF6, 0xFF, 0xA9, 0xFF, 0x6D, 0xFF, 0x44, 0x00,
3391 0x23, 0x03, 0xF1, 0x07, 0x1B, 0x0D, 0x55, 0x10, 0x02, 0x10, 0x4D,
3392 0x0C, 0x0A, 0x07, 0x7E, 0x02, 0xFF, 0xFF, 0x6D, 0xFF, 0xBA, 0xFF,
3393 0xFB, 0xFF, 0xE3, 0xFF, 0x88, 0xFF, 0x8A, 0xFF, 0x06, 0x01, 0xAB,
3394 0x04, 0xD8, 0x09, 0x95, 0x0E, 0xA9, 0x10, 0x05, 0x0F, 0x7F, 0x0A,
3395 0x40, 0x05, 0x5A, 0x01, 0x9F, 0xFF, 0x7E, 0xFF, 0xDA, 0xFF, 0x00,
3396 0x00, 0xFE, 0xFF, 0xC6, 0xFF, 0x70, 0xFF, 0xD7, 0xFF, 0x10, 0x02,
3397 0x67, 0x06, 0xB1, 0x0B, 0xB7, 0x0F, 0x80, 0x10, 0xA7, 0x0D, 0x99,
3398 0x08, 0xA4, 0x03, 0x7F, 0x00, 0x73, 0xFF, 0x9D, 0xFF, 0xF0, 0xFF,
3399 0xF3, 0xFF, 0xA3, 0xFF, 0x70, 0xFF, 0x60, 0x00, 0x62, 0x03, 0x45,
3400 0x08, 0x62, 0x0D, 0x6C, 0x10, 0xDE, 0x0F, 0x00, 0x0C, 0xB8, 0x06,
3401 0x46, 0x02, 0xEA, 0xFF, 0x6E, 0xFF, 0xC0, 0xFF, 0xFD, 0xFF, 0x00,
3402 0x00, 0xDE, 0xFF, 0x83, 0xFF, 0x94, 0xFF, 0x2F, 0x01, 0xF4, 0x04,
3403 0x2B, 0x0A, 0xCE, 0x0E, 0xAA, 0x10, 0xCE, 0x0E, 0x2B, 0x0A, 0xF4,
3404 0x04, 0x2F, 0x01, 0x94, 0xFF, 0x83, 0xFF, 0xDE, 0xFF, 0xFD, 0xFF,
3405 0xC0, 0xFF, 0x6E, 0xFF, 0xEA, 0xFF, 0x46, 0x02, 0xB8, 0x06, 0x00,
3406 0x0C, 0xDE, 0x0F, 0x6C, 0x10, 0x62, 0x0D, 0x45, 0x08, 0x62, 0x03,
3407 0x60, 0x00, 0x70, 0xFF, 0xA3, 0xFF, 0xF3, 0xFF, 0xF0, 0xFF, 0x9D,
3408 0xFF, 0x73, 0xFF, 0x7F, 0x00, 0xA4, 0x03, 0x99, 0x08, 0xA7, 0x0D,
3409 0x80, 0x10, 0xB7, 0x0F, 0xB1, 0x0B, 0x67, 0x06, 0x10, 0x02, 0xD7,
3410 0xFF, 0x70, 0xFF, 0xC6, 0xFF, 0xFE, 0xFF, 0x00, 0x00, 0xDA, 0xFF,
3411 0x7E, 0xFF, 0x9F, 0xFF, 0x5A, 0x01, 0x40, 0x05, 0x7F, 0x0A, 0x05,
3412 0x0F, 0xA9, 0x10, 0x95, 0x0E, 0xD8, 0x09, 0xAB, 0x04, 0x06, 0x01,
3413 0x8A, 0xFF, 0x88, 0xFF, 0xE3, 0xFF, 0xFB, 0xFF, 0xBA, 0xFF, 0x6D,
3414 0xFF, 0xFF, 0xFF, 0x7E, 0x02, 0x0A, 0x07, 0x4D, 0x0C, 0x02, 0x10,
3415 0x55, 0x10, 0x1B, 0x0D, 0xF1, 0x07, 0x23, 0x03, 0x44, 0x00, 0x6D,
3416 0xFF, 0xA9, 0xFF, 0xF6, 0xFF, 0xED, 0xFF, 0x97, 0xFF, 0x77, 0xFF,
3417 0xA0, 0x00, 0xE7, 0x03, 0xED, 0x08, 0xE9, 0x0D, 0x90, 0x10, 0x8C,
3418 0x0F, 0x62, 0x0B, 0x17, 0x06, 0xDD, 0x01, 0xC6, 0xFF, 0x73, 0xFF,
3419 0xCB, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xD5, 0xFF, 0x79, 0xFF, 0xAB,
3420 0xFF, 0x87, 0x01, 0x8C, 0x05, 0xD1, 0x0A, 0x38, 0x0F, 0xA3, 0x10,
3421 0x59, 0x0E, 0x84, 0x09, 0x63, 0x04, 0xDF, 0x00, 0x82, 0xFF, 0x8D,
3422 0xFF, 0xE7, 0xFF, 0xF9, 0xFF, 0xB4, 0xFF, 0x6C, 0xFF, 0x16, 0x00,
3423 0xB7, 0x02, 0x5C, 0x07, 0x99, 0x0C, 0x23, 0x10, 0x3B, 0x10, 0xD3,
3424 0x0C, 0x9D, 0x07, 0xE6, 0x02, 0x29, 0x00, 0x6C, 0xFF, 0xB0, 0xFF,
3425 0xF8, 0xFF, 0xEA, 0xFF, 0x92, 0xFF, 0x7D, 0xFF, 0xC2, 0x00, 0x2C,
3426 0x04, 0x42, 0x09, 0x29, 0x0E, 0x9C, 0x10, 0x5E, 0x0F, 0x11, 0x0B,
3427 0xC8, 0x05, 0xAC, 0x01, 0xB6, 0xFF, 0x76, 0xFF, 0xD1, 0xFF, 0xFF,
3428 0xFF, 0xFF, 0xFF, 0xD0, 0xFF, 0x76, 0xFF, 0xB9, 0xFF, 0xB7, 0x01,
3429 0xDA, 0x05, 0x23, 0x0B, 0x68, 0x0F, 0x9A, 0x10, 0x1B, 0x0E, 0x2F,
3430 0x09, 0x1C, 0x04, 0xBB, 0x00, 0x7B, 0xFF, 0x93, 0xFF, 0xEA, 0xFF,
3431 0xF7, 0xFF, 0xAE, 0xFF, 0x6C, 0xFF, 0x2F, 0x00, 0xF3, 0x02, 0xAF,
3432 0x07, 0xE3, 0x0C, 0x41, 0x10, 0x1C, 0x10, 0x88, 0x0C, 0x4A, 0x07,
3433 0xAA, 0x02, 0x11, 0x00, 0x6C, 0xFF, 0xB6, 0xFF, 0xFA, 0xFF, 0xE6,
3434 0xFF, 0x8C, 0xFF, 0x84, 0xFF, 0xE7, 0x00, 0x73, 0x04, 0x96, 0x09,
3435 0x67, 0x0E, 0xA5, 0x10, 0x2D, 0x0F, 0xBF, 0x0A, 0x7B, 0x05, 0x7D,
3436 0x01, 0xA8, 0xFF, 0x7A, 0xFF, 0xD6, 0xFF, 0x00, 0x00, 0xFE, 0xFF,
3437 0xCA, 0xFF, 0x72, 0xFF, 0xC9, 0xFF, 0xE8, 0x01, 0x29, 0x06, 0x73,
3438 0x0B, 0x96, 0x0F, 0x8D, 0x10, 0xDB, 0x0D, 0xDB, 0x08, 0xD8, 0x03,
3439 0x98, 0x00, 0x76, 0xFF, 0x99, 0xFF, 0xEE, 0xFF, 0xF5, 0xFF, 0xA8,
3440 0xFF, 0x6E, 0xFF, 0x4A, 0x00, 0x31, 0x03, 0x03, 0x08, 0x2B, 0x0D,
3441 0x5B, 0x10, 0xFB, 0x0F, 0x3C, 0x0C, 0xF7, 0x06, 0x71, 0x02, 0xFA,
3442 0xFF, 0x6D, 0xFF, 0xBC, 0xFF, 0xFC, 0xFF, 0xE2, 0xFF, 0x87, 0xFF,
3443 0x8C, 0xFF, 0x0F, 0x01, 0xBB, 0x04, 0xEA, 0x09, 0xA2, 0x0E, 0xA9,
3444 0x10, 0xF9, 0x0E, 0x6C, 0x0A, 0x2F, 0x05, 0x50, 0x01, 0x9C, 0xFF,
3445 0x7F, 0xFF, 0xDB, 0xFF, 0x00, 0x00, 0xFE, 0xFF, 0xC5, 0xFF, 0x70,
3446 0xFF, 0xDB, 0xFF, 0x1C, 0x02, 0x79, 0x06, 0xC3, 0x0B, 0xC0, 0x0F,
3447 0x7C, 0x10, 0x98, 0x0D, 0x86, 0x08, 0x95, 0x03, 0x78, 0x00, 0x72,
3448 0xFF, 0x9F, 0xFF, 0xF1, 0xFF, 0xF3, 0xFF, 0xA2, 0xFF, 0x70, 0xFF,
3449 0x67, 0x00, 0x71, 0x03, 0x57, 0x08, 0x71, 0x0D, 0x71, 0x10, 0xD6,
3450 0x0F, 0xEF, 0x0B, 0xA6, 0x06, 0x3A, 0x02, 0xE6, 0xFF, 0x6E, 0xFF,
3451 0xC1, 0xFF, 0xFD, 0xFF, 0x00, 0x00, 0xDD, 0xFF, 0x81, 0xFF, 0x96,
3452 0xFF, 0x38, 0x01, 0x05, 0x05, 0x3E, 0x0A, 0xDA, 0x0E, 0xAA, 0x10,
3453 0xC2, 0x0E, 0x19, 0x0A, 0xE4, 0x04, 0x25, 0x01, 0x91, 0xFF, 0x84,
3454 0xFF, 0xDF, 0xFF, 0xFC, 0xFF, 0xBF, 0xFF, 0x6E, 0xFF, 0xEF, 0xFF,
3455 0x52, 0x02, 0xCA, 0x06, 0x11, 0x0C, 0xE6, 0x0F, 0x68, 0x10, 0x52,
3456 0x0D, 0x32, 0x08, 0x54, 0x03, 0x5A, 0x00, 0x6F, 0xFF, 0xA5, 0xFF,
3457 0xF4, 0xFF, 0xF0, 0xFF, 0x9C, 0xFF, 0x74, 0xFF, 0x86, 0x00, 0xB3,
3458 0x03, 0xAC, 0x08, 0xB6, 0x0D, 0x84, 0x10, 0xAD, 0x0F, 0xA0, 0x0B,
3459 0x55, 0x06, 0x05, 0x02, 0xD3, 0xFF, 0x71, 0xFF, 0xC7, 0xFF, 0xFE,
3460 0xFF, 0x00, 0x00, 0xD9, 0xFF, 0x7D, 0xFF, 0xA1, 0xFF, 0x64, 0x01,
3461 0x50, 0x05, 0x91, 0x0A, 0x10, 0x0F, 0xA8, 0x10, 0x88, 0x0E, 0xC5,
3462 0x09, 0x9B, 0x04, 0xFD, 0x00, 0x88, 0xFF, 0x89, 0xFF, 0xE4, 0xFF,
3463 0xFB, 0xFF, 0xB9, 0xFF, 0x6C, 0xFF, 0x04, 0x00, 0x8A, 0x02, 0x1C,
3464 0x07, 0x5E, 0x0C, 0x0A, 0x10, 0x50, 0x10, 0x0B, 0x0D, 0xDE, 0x07,
3465 0x15, 0x03, 0x3E, 0x00, 0x6D, 0xFF, 0xAB, 0xFF, 0xF6, 0xFF, 0xEC,
3466 0xFF, 0x96, 0xFF, 0x78, 0xFF, 0xA7, 0x00, 0xF6, 0x03, 0x00, 0x09,
3467 0xF8, 0x0D, 0x93, 0x10, 0x82, 0x0F, 0x50, 0x0B, 0x06, 0x06, 0xD2,
3468 0x01, 0xC2, 0xFF, 0x74, 0xFF, 0xCD, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
3469 0xD4, 0xFF, 0x79, 0xFF, 0xAE, 0xFF, 0x91, 0x01, 0x9D, 0x05, 0xE3,
3470 0x0A, 0x43, 0x0F, 0xA1, 0x10, 0x4C, 0x0E, 0x71, 0x09, 0x53, 0x04,
3471 0xD7, 0x00, 0x80, 0xFF, 0x8E, 0xFF, 0xE8, 0xFF, 0xF9, 0xFF, 0xB3,
3472 0xFF, 0x6C, 0xFF, 0x1C, 0x00, 0xC4, 0x02, 0x6F, 0x07, 0xAA, 0x0C,
3473 0x2A, 0x10, 0x34, 0x10, 0xC2, 0x0C, 0x8A, 0x07, 0xD8, 0x02, 0x24,
3474 0x00, 0x6C, 0xFF, 0xB1, 0xFF, 0xF8, 0xFF, 0xE9, 0xFF, 0x90, 0xFF,
3475 0x7E, 0xFF, 0xCB, 0x00, 0x3B, 0x04, 0x55, 0x09, 0x37, 0x0E, 0x9E,
3476 0x10, 0x53, 0x0F, 0xFF, 0x0A, 0xB7, 0x05, 0xA1, 0x01, 0xB3, 0xFF,
3477 0x77, 0xFF, 0xD2, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCE, 0xFF, 0x75,
3478 0xFF, 0xBD, 0xFF, 0xC1, 0x01, 0xEB, 0x05, 0x35, 0x0B, 0x73, 0x0F,
3479 0x97, 0x10, 0x0D, 0x0E, 0x1C, 0x09, 0x0D, 0x04, 0xB3, 0x00, 0x7A,
3480 0xFF, 0x94, 0xFF, 0xEB, 0xFF, 0xF7, 0xFF, 0xAD, 0xFF, 0x6D, 0xFF,
3481 0x35, 0x00, 0x01, 0x03, 0xC2, 0x07, 0xF3, 0x0C, 0x47, 0x10, 0x15,
3482 0x10, 0x78, 0x0C, 0x37, 0x07, 0x9D, 0x02, 0x0C, 0x00, 0x6C, 0xFF,
3483 0xB7, 0xFF, 0xFA, 0xFF, 0xE5, 0xFF, 0x8B, 0xFF, 0x85, 0xFF, 0xF0,
3484 0x00, 0x83, 0x04, 0xA9, 0x09, 0x74, 0x0E, 0xA6, 0x10, 0x21, 0x0F,
3485 0xAD, 0x0A, 0x6A, 0x05, 0x73, 0x01, 0xA5, 0xFF, 0x7B, 0xFF, 0xD7,
3486 0xFF, 0x00, 0x00, 0xFE, 0xFF, 0xC9, 0xFF, 0x72, 0xFF, 0xCD, 0xFF,
3487 0xF4, 0x01, 0x3B, 0x06, 0x85, 0x0B, 0x9F, 0x0F, 0x89, 0x10, 0xCC,
3488 0x0D, 0xC8, 0x08, 0xC9, 0x03, 0x91, 0x00, 0x75, 0xFF, 0x9A, 0xFF,
3489 0xEF, 0xFF, 0xF5, 0xFF, 0xA7, 0xFF, 0x6E, 0xFF, 0x50, 0x00, 0x3F,
3490 0x03, 0x16, 0x08, 0x3B, 0x0D, 0x60, 0x10, 0xF3, 0x0F, 0x2B, 0x0C,
3491 0xE5, 0x06, 0x65, 0x02, 0xF6, 0xFF, 0x6D, 0xFF, 0xBD, 0xFF, 0xFC,
3492 0xFF, 0xE1, 0xFF, 0x85, 0xFF, 0x8E, 0xFF, 0x18, 0x01, 0xCB, 0x04,
3493 0xFD, 0x09, 0xAF, 0x0E, 0xAA, 0x10, 0xED, 0x0E, 0x5A, 0x0A, 0x1E,
3494 0x05, 0x46, 0x01, 0x9A, 0xFF, 0x80, 0xFF, 0xDC, 0xFF, 0x00, 0x00,
3495 0xFD, 0xFF, 0xC3, 0xFF, 0x6F, 0xFF, 0xDF, 0xFF, 0x28, 0x02, 0x8B,
3496 0x06, 0xD5, 0x0B, 0xC9, 0x0F, 0x78, 0x10, 0x88, 0x0D, 0x73, 0x08,
3497 0x86, 0x03, 0x71, 0x00, 0x71, 0xFF, 0xA0, 0xFF, 0xF2, 0xFF, 0xF2,
3498 0xFF, 0xA1, 0xFF, 0x71, 0xFF, 0x6E, 0x00, 0x7F, 0x03, 0x6A, 0x08,
3499 0x81, 0x0D, 0x76, 0x10, 0xCD, 0x0F, 0xDD, 0x0B, 0x94, 0x06, 0x2E,
3500 0x02, 0xE1, 0xFF, 0x6F, 0xFF, 0xC3, 0xFF, 0xFD, 0xFF, 0x00, 0x00,
3501 0xDC, 0xFF, 0x80, 0xFF, 0x98, 0xFF, 0x42, 0x01, 0x16, 0x05, 0x50,
3502 0x0A, 0xE7, 0x0E, 0xAA, 0x10, 0xB5, 0x0E, 0x06, 0x0A, 0xD3, 0x04,
3503 0x1C, 0x01, 0x8F, 0xFF, 0x85, 0xFF, 0xE0, 0xFF, 0xFC, 0xFF, 0xBE,
3504 0xFF, 0x6D, 0xFF, 0xF3, 0xFF, 0x5E, 0x02, 0xDC, 0x06, 0x23, 0x0C,
3505 0xEF, 0x0F, 0x63, 0x10, 0x43, 0x0D, 0x1F, 0x08, 0x46, 0x03, 0x53,
3506 0x00, 0x6E, 0xFF, 0xA6, 0xFF, 0xF4, 0xFF, 0xEF, 0xFF, 0x9B, 0xFF,
3507 0x75, 0xFF, 0x8D, 0x00, 0xC1, 0x03, 0xBE, 0x08, 0xC4, 0x0D, 0x88,
3508 0x10, 0xA4, 0x0F, 0x8E, 0x0B, 0x43, 0x06, 0xF9, 0x01, 0xCF, 0xFF,
3509 0x71, 0xFF, 0xC8, 0xFF, 0xFE, 0xFF, 0x00, 0x00, 0xD8, 0xFF, 0x7C,
3510 0xFF, 0xA4, 0xFF, 0x6E, 0x01, 0x61, 0x05, 0xA3, 0x0A, 0x1C, 0x0F,
3511 0xA7, 0x10, 0x7B, 0x0E, 0xB2, 0x09, 0x8B, 0x04, 0xF4, 0x00, 0x86,
3512 0xFF, 0x8A, 0xFF, 0xE4, 0xFF, 0xFA, 0xFF, 0xB8, 0xFF, 0x6C, 0xFF,
3513 0x09, 0x00, 0x97, 0x02, 0x2E, 0x07, 0x6F, 0x0C, 0x11, 0x10, 0x4A,
3514 0x10, 0xFB, 0x0C, 0xCB, 0x07, 0x07, 0x03, 0x38, 0x00, 0x6D, 0xFF,
3515 0xAC, 0xFF, 0xF7, 0xFF, 0xEC, 0xFF, 0x95, 0xFF, 0x79, 0xFF, 0xAF,
3516 0x00, 0x05, 0x04, 0x13, 0x09, 0x06, 0x0E, 0x96, 0x10, 0x78, 0x0F,
3517 0x3E, 0x0B, 0xF4, 0x05, 0xC7, 0x01, 0xBF, 0xFF, 0x74, 0xFF, 0xCE,
3518 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xD2, 0xFF, 0x78, 0xFF, 0xB1, 0xFF,
3519 0x9C, 0x01, 0xAE, 0x05, 0xF6, 0x0A, 0x4E, 0x0F, 0x9F, 0x10, 0x3E,
3520 0x0E, 0x5E, 0x09, 0x43, 0x04, 0xCF, 0x00, 0x7F, 0xFF, 0x90, 0xFF,
3521 0xE8, 0xFF, 0xF9, 0xFF, 0xB2, 0xFF, 0x6C, 0xFF, 0x21, 0x00, 0xD2,
3522 0x02, 0x81, 0x07, 0xBA, 0x0C, 0x31, 0x10, 0x2E, 0x10, 0xB2, 0x0C,
3523 0x78, 0x07, 0xCB, 0x02, 0x1E, 0x00, 0x6C, 0xFF, 0xB2, 0xFF, 0xF9,
3524 0xFF, 0xE8, 0xFF, 0x8F, 0xFF, 0x80, 0xFF, 0xD3, 0x00, 0x4B, 0x04,
3525 0x67, 0x09, 0x45, 0x0E, 0xA0, 0x10, 0x48, 0x0F, 0xEC, 0x0A, 0xA6,
3526 0x05, 0x97, 0x01, 0xB0, 0xFF, 0x78, 0xFF, 0xD3, 0xFF, 0x00, 0x00,
3527 0xFF, 0xFF, 0xCD, 0xFF, 0x74, 0xFF, 0xC0, 0xFF, 0xCC, 0x01, 0xFD,
3528 0x05, 0x47, 0x0B, 0x7D, 0x0F, 0x94, 0x10, 0xFF, 0x0D, 0x0A, 0x09,
3529 0xFE, 0x03, 0xAB, 0x00, 0x79, 0xFF, 0x95, 0xFF, 0xEC, 0xFF, 0xF7,
3530 0xFF, 0xAC, 0xFF, 0x6D, 0xFF, 0x3B, 0x00, 0x0E, 0x03, 0xD5, 0x07,
3531 0x03, 0x0D, 0x4D, 0x10, 0x0E, 0x10, 0x67, 0x0C, 0x25, 0x07, 0x91,
3532 0x02, 0x07, 0x00, 0x6C, 0xFF, 0xB8, 0xFF, 0xFB, 0xFF, 0xE4, 0xFF,
3533 0x89, 0xFF, 0x87, 0xFF, 0xF9, 0x00, 0x93, 0x04, 0xBC, 0x09, 0x82,
3534 0x0E, 0xA7, 0x10, 0x16, 0x0F, 0x9A, 0x0A, 0x59, 0x05, 0x69, 0x01,
3535 0xA3, 0xFF, 0x7C, 0xFF, 0xD8, 0xFF, 0x00, 0x00, 0xFE, 0xFF, 0xC8,
3536 0xFF, 0x71, 0xFF, 0xD1, 0xFF, 0xFF, 0x01, 0x4C, 0x06, 0x97, 0x0B,
3537 0xA9, 0x0F, 0x86, 0x10, 0xBD, 0x0D, 0xB5, 0x08, 0xBA, 0x03, 0x8A,
3538 0x00, 0x74, 0xFF, 0x9B, 0xFF, 0xEF, 0xFF, 0xF4, 0xFF, 0xA5, 0xFF,
3539 0x6F, 0xFF, 0x57, 0x00, 0x4D, 0x03, 0x29, 0x08, 0x4B, 0x0D, 0x65,
3540 0x10, 0xEB, 0x0F, 0x1A, 0x0C, 0xD3, 0x06, 0x58, 0x02, 0xF1, 0xFF,
3541 0x6D, 0xFF, 0xBE, 0xFF, 0xFC, 0xFF, 0xE0, 0xFF, 0x84, 0xFF, 0x90,
3542 0xFF, 0x21, 0x01, 0xDC, 0x04, 0x10, 0x0A, 0xBB, 0x0E, 0xAA, 0x10,
3543 0xE1, 0x0E, 0x47, 0x0A, 0x0D, 0x05, 0x3D, 0x01, 0x97, 0xFF, 0x81,
3544 0xFF, 0xDD, 0xFF, 0x00, 0x00, 0xFD, 0xFF, 0xC2, 0xFF, 0x6F, 0xFF,
3545 0xE4, 0xFF, 0x34, 0x02, 0x9D, 0x06, 0xE6, 0x0B, 0xD1, 0x0F, 0x73,
3546 0x10, 0x79, 0x0D, 0x61, 0x08, 0x78, 0x03, 0x6A, 0x00, 0x70, 0xFF,
3547 0xA1, 0xFF, 0xF2, 0xFF, 0xF1, 0xFF, 0x9F, 0xFF, 0x72, 0xFF, 0x74,
3548 0x00, 0x8E, 0x03, 0x7D, 0x08, 0x90, 0x0D, 0x7A, 0x10, 0xC4, 0x0F,
3549 0xCC, 0x0B, 0x82, 0x06, 0x22, 0x02, 0xDD, 0xFF, 0x6F, 0xFF, 0xC4,
3550 0xFF, 0xFD, 0xFF, 0x00, 0x00, 0xDB, 0xFF, 0x7F, 0xFF, 0x9B, 0xFF,
3551 0x4B, 0x01, 0x26, 0x05, 0x63, 0x0A, 0xF3, 0x0E, 0xAA, 0x10, 0xA8,
3552 0x0E, 0xF4, 0x09, 0xC3, 0x04, 0x13, 0x01, 0x8D, 0xFF, 0x86, 0xFF,
3553 0xE1, 0xFF, 0xFC, 0xFF, 0xBC, 0xFF, 0x6D, 0xFF, 0xF8, 0xFF, 0x6B,
3554 0x02, 0xEE, 0x06, 0x34, 0x0C, 0xF7, 0x0F, 0x5D, 0x10, 0x33, 0x0D,
3555 0x0D, 0x08, 0x38, 0x03, 0x4D, 0x00, 0x6E, 0xFF, 0xA7, 0xFF, 0xF5,
3556 0xFF, 0xEE, 0xFF, 0x99, 0xFF, 0x76, 0xFF, 0x94, 0x00, 0xD0, 0x03,
3557 0xD1, 0x08, 0xD3, 0x0D, 0x8B, 0x10, 0x9A, 0x0F, 0x7C, 0x0B, 0x32,
3558 0x06, 0xEE, 0x01, 0xCB, 0xFF, 0x72, 0xFF, 0xCA, 0xFF, 0xFE, 0xFF,
3559 0x00, 0x00, 0xD6, 0xFF, 0x7B, 0xFF, 0xA7, 0xFF, 0x78, 0x01, 0x72,
3560 0x05, 0xB6, 0x0A, 0x27, 0x0F, 0xA5, 0x10, 0x6E, 0x0E, 0xA0, 0x09,
3561 0x7B, 0x04, 0xEC, 0x00, 0x85, 0xFF, 0x8B, 0xFF, 0xE5, 0xFF, 0xFA,
3562 0xFF, 0xB6, 0xFF, 0x6C, 0xFF, 0x0E, 0x00, 0xA4, 0x02, 0x41, 0x07,
3563 0x80, 0x0C, 0x19, 0x10, 0x44, 0x10, 0xEB, 0x0C, 0xB9, 0x07, 0xFA,
3564 0x02, 0x32, 0x00, 0x6D, 0xFF, 0xAE, 0xFF, 0xF7, 0xFF, 0xEB, 0xFF,
3565 0x93, 0xFF, 0x7B, 0xFF, 0xB7, 0x00, 0x15, 0x04, 0x26, 0x09, 0x14,
3566 0x0E, 0x98, 0x10, 0x6D, 0x0F, 0x2C, 0x0B, 0xE3, 0x05, 0xBC, 0x01,
3567 0xBB, 0xFF, 0x75, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xD1,
3568 0xFF, 0x77, 0xFF, 0xB5, 0xFF, 0xA6, 0x01, 0xC0, 0x05, 0x08, 0x0B,
3569 0x58, 0x0F, 0x9D, 0x10, 0x30, 0x0E, 0x4B, 0x09, 0x34, 0x04, 0xC6,
3570 0x00, 0x7D, 0xFF, 0x91, 0xFF, 0xE9, 0xFF, 0xF8, 0xFF, 0xB0, 0xFF,
3571 0x6C, 0xFF, 0x27, 0x00, 0xDF, 0x02, 0x94, 0x07, 0xCA, 0x0C, 0x37,
3572 0x10, 0x27, 0x10, 0xA1, 0x0C, 0x65, 0x07, 0xBE, 0x02, 0x19, 0x00,
3573 0x6C, 0xFF, 0xB4, 0xFF, 0xF9, 0xFF, 0xE7, 0xFF, 0x8E, 0xFF, 0x81,
3574 0xFF, 0xDB, 0x00, 0x5B, 0x04, 0x7A, 0x09, 0x53, 0x0E, 0xA2, 0x10,
3575 0x3D, 0x0F, 0xDA, 0x0A, 0x95, 0x05, 0x8C, 0x01, 0xAD, 0xFF, 0x79,
3576 0xFF, 0xD4, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xCC, 0xFF, 0x73, 0xFF,
3577 0xC4, 0xFF, 0xD7, 0x01, 0x0E, 0x06, 0x59, 0x0B, 0x87, 0x0F, 0x91,
3578 0x10, 0xF0, 0x0D, 0xF7, 0x08, 0xEF, 0x03, 0xA3, 0x00, 0x78, 0xFF,
3579 0x97, 0xFF, 0xED, 0xFF, 0xF6, 0xFF, 0xAA, 0xFF, 0x6D, 0xFF, 0x41,
3580 0x00, 0x1C, 0x03, 0xE7, 0x07, 0x13, 0x0D, 0x52, 0x10, 0x06, 0x10,
3581 0x56, 0x0C, 0x13, 0x07, 0x84, 0x02, 0x02, 0x00, 0x6D, 0xFF, 0xBA,
3582 0xFF, 0xFB, 0xFF, 0xE3, 0xFF, 0x88, 0xFF, 0x89, 0xFF, 0x01, 0x01,
3583 0xA3, 0x04, 0xCE, 0x09, 0x8F, 0x0E, 0xA8, 0x10, 0x0A, 0x0F, 0x88,
3584 0x0A, 0x48, 0x05, 0x5F, 0x01, 0xA0, 0xFF, 0x7D, 0xFF, 0xD9, 0xFF,
3585 0x00, 0x00, 0xFE, 0xFF, 0xC7, 0xFF, 0x70, 0xFF, 0xD5, 0xFF, 0x0B,
3586 0x02, 0x5E, 0x06, 0xA9, 0x0B, 0xB2, 0x0F, 0x82, 0x10, 0xAE, 0x0D,
3587 0xA2, 0x08, 0xAB, 0x03, 0x82, 0x00, 0x73, 0xFF, 0x9D, 0xFF, 0xF0,
3588 0xFF, 0xF3, 0xFF, 0xA4, 0xFF, 0x6F, 0xFF, 0x5D, 0x00, 0x5B, 0x03,
3589 0x3B, 0x08, 0x5A, 0x0D, 0x6A, 0x10, 0xE2, 0x0F, 0x09, 0x0C, 0xC1,
3590 0x06, 0x4C, 0x02, 0xEC, 0xFF, 0x6E, 0xFF, 0xC0, 0xFF, 0xFC, 0xFF,
3591 0xDF, 0xFF, 0x83, 0xFF, 0x93, 0xFF, 0x2A, 0x01, 0xEC, 0x04, 0x22,
3592 0x0A, 0xC8, 0x0E, 0xAB, 0x10, 0xD4, 0x0E, 0x35, 0x0A, 0xFD, 0x04,
3593 0x33, 0x01, 0x95, 0xFF, 0x82, 0xFF, 0xDE, 0xFF, 0x00, 0x00, 0xFD,
3594 0xFF, 0xC1, 0xFF, 0x6E, 0xFF, 0xE8, 0xFF, 0x40, 0x02, 0xAF, 0x06,
3595 0xF7, 0x0B, 0xDA, 0x0F, 0x6F, 0x10, 0x6A, 0x0D, 0x4E, 0x08, 0x6A,
3596 0x03, 0x64, 0x00, 0x70, 0xFF, 0xA3, 0xFF, 0xF3, 0xFF, 0xF1, 0xFF,
3597 0x9E, 0xFF, 0x72, 0xFF, 0x7B, 0x00, 0x9C, 0x03, 0x90, 0x08, 0x9F,
3598 0x0D, 0x7E, 0x10, 0xBB, 0x0F, 0xBA, 0x0B, 0x70, 0x06, 0x16, 0x02,
3599 0xD9, 0xFF, 0x70, 0xFF, 0xC5, 0xFF, 0xFE, 0xFF, 0x00, 0x00, 0xDA,
3600 0xFF, 0x7E, 0xFF, 0x9D, 0xFF, 0x55, 0x01, 0x37, 0x05, 0x75, 0x0A,
3601 0xFF, 0x0E, 0xA9, 0x10, 0x9C, 0x0E, 0xE1, 0x09, 0xB3, 0x04, 0x0A,
3602 0x01, 0x8B, 0xFF, 0x87, 0xFF, 0xE2, 0xFF, 0xFB, 0xFF, 0xBB, 0xFF,
3603 0x6D, 0xFF, 0xFD, 0xFF, 0x77, 0x02, 0x01, 0x07, 0x45, 0x0C, 0xFF,
3604 0x0F, 0x58, 0x10, 0x23, 0x0D, 0xFA, 0x07, 0x2A, 0x03, 0x47, 0x00,
3605 0x6E, 0xFF, 0xA9, 0xFF, 0xF5, 0xFF, 0xED, 0xFF, 0x98, 0xFF, 0x77,
3606 0xFF, 0x9C, 0x00, 0xDF, 0x03, 0xE4, 0x08, 0xE2, 0x0D, 0x8E, 0x10,
3607 0x91, 0x0F, 0x6B, 0x0B, 0x20, 0x06, 0xE3, 0x01, 0xC8, 0xFF, 0x73,
3608 0xFF, 0xCB, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xD5, 0xFF, 0x7A, 0xFF,
3609 0xAA, 0xFF, 0x82, 0x01, 0x83, 0x05, 0xC8, 0x0A, 0x32, 0x0F, 0xA4,
3610 0x10, 0x60, 0x0E, 0x8D, 0x09, 0x6B, 0x04, 0xE3, 0x00, 0x83, 0xFF,
3611 0x8D, 0xFF, 0xE6, 0xFF, 0xFA, 0xFF, 0xB5, 0xFF, 0x6C, 0xFF, 0x14,
3612 0x00, 0xB1, 0x02, 0x53, 0x07, 0x91, 0x0C, 0x20, 0x10, 0x3E, 0x10,
3613 0xDB, 0x0C, 0xA6, 0x07, 0xEC, 0x02, 0x2C, 0x00, 0x6C, 0xFF, 0xAF,
3614 0xFF, 0xF8, 0xFF, 0xEA, 0xFF, 0x92, 0xFF, 0x7C, 0xFF, 0xBE, 0x00,
3615 0x24, 0x04, 0x38, 0x09, 0x22, 0x0E, 0x9B, 0x10, 0x63, 0x0F, 0x1A,
3616 0x0B, 0xD1, 0x05, 0xB1, 0x01, 0xB8, 0xFF, 0x76, 0xFF, 0xD0, 0xFF,
3617 0xFF, 0xFF, 0xFF, 0xFF, 0xD0, 0xFF, 0x76, 0xFF, 0xB8, 0xFF, 0xB1,
3618 0x01, 0xD1, 0x05, 0x1A, 0x0B, 0x63, 0x0F, 0x9B, 0x10, 0x22, 0x0E,
3619 0x38, 0x09, 0x24, 0x04, 0xBE, 0x00, 0x7C, 0xFF, 0x92, 0xFF, 0xEA,
3620 0xFF, 0xF8, 0xFF, 0xAF, 0xFF, 0x6C, 0xFF, 0x2C, 0x00, 0xEC, 0x02,
3621 0xA6, 0x07, 0xDB, 0x0C, 0x3E, 0x10, 0x20, 0x10, 0x91, 0x0C, 0x53,
3622 0x07, 0xB1, 0x02, 0x14, 0x00, 0x6C, 0xFF, 0xB5, 0xFF, 0xFA, 0xFF,
3623 0xE6, 0xFF, 0x8D, 0xFF, 0x83, 0xFF, 0xE3, 0x00, 0x6B, 0x04, 0x8D,
3624 0x09, 0x60, 0x0E, 0xA4, 0x10, 0x32, 0x0F, 0xC8, 0x0A, 0x83, 0x05,
3625 0x82, 0x01, 0xAA, 0xFF, 0x7A, 0xFF, 0xD5, 0xFF, 0x00, 0x00, 0xFF,
3626 0xFF, 0xCB, 0xFF, 0x73, 0xFF, 0xC8, 0xFF, 0xE3, 0x01, 0x20, 0x06,
3627 0x6B, 0x0B, 0x91, 0x0F, 0x8E, 0x10, 0xE2, 0x0D, 0xE4, 0x08, 0xDF,
3628 0x03, 0x9C, 0x00, 0x77, 0xFF, 0x98, 0xFF, 0xED, 0xFF, 0xF5, 0xFF,
3629 0xA9, 0xFF, 0x6E, 0xFF, 0x47, 0x00, 0x2A, 0x03, 0xFA, 0x07, 0x23,
3630 0x0D, 0x58, 0x10, 0xFF, 0x0F, 0x45, 0x0C, 0x01, 0x07, 0x77, 0x02,
3631 0xFD, 0xFF, 0x6D, 0xFF, 0xBB, 0xFF, 0xFB, 0xFF, 0xE2, 0xFF, 0x87,
3632 0xFF, 0x8B, 0xFF, 0x0A, 0x01, 0xB3, 0x04, 0xE1, 0x09, 0x9C, 0x0E,
3633 0xA9, 0x10, 0xFF, 0x0E, 0x75, 0x0A, 0x37, 0x05, 0x55, 0x01, 0x9D,
3634 0xFF, 0x7E, 0xFF, 0xDA, 0xFF, 0x00, 0x00, 0xFE, 0xFF, 0xC5, 0xFF,
3635 0x70, 0xFF, 0xD9, 0xFF, 0x16, 0x02, 0x70, 0x06, 0xBA, 0x0B, 0xBB,
3636 0x0F, 0x7E, 0x10, 0x9F, 0x0D, 0x90, 0x08, 0x9C, 0x03, 0x7B, 0x00,
3637 0x72, 0xFF, 0x9E, 0xFF, 0xF1, 0xFF, 0xF3, 0xFF, 0xA3, 0xFF, 0x70,
3638 0xFF, 0x64, 0x00, 0x6A, 0x03, 0x4E, 0x08, 0x6A, 0x0D, 0x6F, 0x10,
3639 0xDA, 0x0F, 0xF7, 0x0B, 0xAF, 0x06, 0x40, 0x02, 0xE8, 0xFF, 0x6E,
3640 0xFF, 0xC1, 0xFF, 0xFD, 0xFF, 0x00, 0x00, 0xDE, 0xFF, 0x82, 0xFF,
3641 0x95, 0xFF, 0x33, 0x01, 0xFD, 0x04, 0x35, 0x0A, 0xD4, 0x0E, 0xAB,
3642 0x10, 0xC8, 0x0E, 0x22, 0x0A, 0xEC, 0x04, 0x2A, 0x01, 0x93, 0xFF,
3643 0x83, 0xFF, 0xDF, 0xFF, 0xFC, 0xFF, 0xC0, 0xFF, 0x6E, 0xFF, 0xEC,
3644 0xFF, 0x4C, 0x02, 0xC1, 0x06, 0x09, 0x0C, 0xE2, 0x0F, 0x6A, 0x10,
3645 0x5A, 0x0D, 0x3B, 0x08, 0x5B, 0x03, 0x5D, 0x00, 0x6F, 0xFF, 0xA4,
3646 0xFF, 0xF3, 0xFF, 0xF0, 0xFF, 0x9D, 0xFF, 0x73, 0xFF, 0x82, 0x00,
3647 0xAB, 0x03, 0xA2, 0x08, 0xAE, 0x0D, 0x82, 0x10, 0xB2, 0x0F, 0xA9,
3648 0x0B, 0x5E, 0x06, 0x0B, 0x02, 0xD5, 0xFF, 0x70, 0xFF, 0xC7, 0xFF,
3649 0xFE, 0xFF, 0x00, 0x00, 0xD9, 0xFF, 0x7D, 0xFF, 0xA0, 0xFF, 0x5F,
3650 0x01, 0x48, 0x05, 0x88, 0x0A, 0x0A, 0x0F, 0xA8, 0x10, 0x8F, 0x0E,
3651 0xCE, 0x09, 0xA3, 0x04, 0x01, 0x01, 0x89, 0xFF, 0x88, 0xFF, 0xE3,
3652 0xFF, 0xFB, 0xFF, 0xBA, 0xFF, 0x6D, 0xFF, 0x02, 0x00, 0x84, 0x02,
3653 0x13, 0x07, 0x56, 0x0C, 0x06, 0x10, 0x52, 0x10, 0x13, 0x0D, 0xE7,
3654 0x07, 0x1C, 0x03, 0x41, 0x00, 0x6D, 0xFF, 0xAA, 0xFF, 0xF6, 0xFF,
3655 0xED, 0xFF, 0x97, 0xFF, 0x78, 0xFF, 0xA3, 0x00, 0xEF, 0x03, 0xF7,
3656 0x08, 0xF0, 0x0D, 0x91, 0x10, 0x87, 0x0F, 0x59, 0x0B, 0x0E, 0x06,
3657 0xD7, 0x01, 0xC4, 0xFF, 0x73, 0xFF, 0xCC, 0xFF, 0xFF, 0xFF, 0x00,
3658 0x00, 0xD4, 0xFF, 0x79, 0xFF, 0xAD, 0xFF, 0x8C, 0x01, 0x95, 0x05,
3659 0xDA, 0x0A, 0x3D, 0x0F, 0xA2, 0x10, 0x53, 0x0E, 0x7A, 0x09, 0x5B,
3660 0x04, 0xDB, 0x00, 0x81, 0xFF, 0x8E, 0xFF, 0xE7, 0xFF, 0xF9, 0xFF,
3661 0xB4, 0xFF, 0x6C, 0xFF, 0x19, 0x00, 0xBE, 0x02, 0x65, 0x07, 0xA1,
3662 0x0C, 0x27, 0x10, 0x37, 0x10, 0xCA, 0x0C, 0x94, 0x07, 0xDF, 0x02,
3663 0x27, 0x00, 0x6C, 0xFF, 0xB0, 0xFF, 0xF8, 0xFF, 0xE9, 0xFF, 0x91,
3664 0xFF, 0x7D, 0xFF, 0xC6, 0x00, 0x34, 0x04, 0x4B, 0x09, 0x30, 0x0E,
3665 0x9D, 0x10, 0x58, 0x0F, 0x08, 0x0B, 0xC0, 0x05, 0xA6, 0x01, 0xB5,
3666 0xFF, 0x77, 0xFF, 0xD1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF,
3667 0x75, 0xFF, 0xBB, 0xFF, 0xBC, 0x01, 0xE3, 0x05, 0x2C, 0x0B, 0x6D,
3668 0x0F, 0x98, 0x10, 0x14, 0x0E, 0x26, 0x09, 0x15, 0x04, 0xB7, 0x00,
3669 0x7B, 0xFF, 0x93, 0xFF, 0xEB, 0xFF, 0xF7, 0xFF, 0xAE, 0xFF, 0x6D,
3670 0xFF, 0x32, 0x00, 0xFA, 0x02, 0xB9, 0x07, 0xEB, 0x0C, 0x44, 0x10,
3671 0x19, 0x10, 0x80, 0x0C, 0x41, 0x07, 0xA4, 0x02, 0x0E, 0x00, 0x6C,
3672 0xFF, 0xB6, 0xFF, 0xFA, 0xFF, 0xE5, 0xFF, 0x8B, 0xFF, 0x85, 0xFF,
3673 0xEC, 0x00, 0x7B, 0x04, 0xA0, 0x09, 0x6E, 0x0E, 0xA5, 0x10, 0x27,
3674 0x0F, 0xB6, 0x0A, 0x72, 0x05, 0x78, 0x01, 0xA7, 0xFF, 0x7B, 0xFF,
3675 0xD6, 0xFF, 0x00, 0x00, 0xFE, 0xFF, 0xCA, 0xFF, 0x72, 0xFF, 0xCB,
3676 0xFF, 0xEE, 0x01, 0x32, 0x06, 0x7C, 0x0B, 0x9A, 0x0F, 0x8B, 0x10,
3677 0xD3, 0x0D, 0xD1, 0x08, 0xD0, 0x03, 0x94, 0x00, 0x76, 0xFF, 0x99,
3678 0xFF, 0xEE, 0xFF, 0xF5, 0xFF, 0xA7, 0xFF, 0x6E, 0xFF, 0x4D, 0x00,
3679 0x38, 0x03, 0x0D, 0x08, 0x33, 0x0D, 0x5D, 0x10, 0xF7, 0x0F, 0x34,
3680 0x0C, 0xEE, 0x06, 0x6B, 0x02, 0xF8, 0xFF, 0x6D, 0xFF, 0xBC, 0xFF,
3681 0xFC, 0xFF, 0xE1, 0xFF, 0x86, 0xFF, 0x8D, 0xFF, 0x13, 0x01, 0xC3,
3682 0x04, 0xF4, 0x09, 0xA8, 0x0E, 0xAA, 0x10, 0xF3, 0x0E, 0x63, 0x0A,
3683 0x26, 0x05, 0x4B, 0x01, 0x9B, 0xFF, 0x7F, 0xFF, 0xDB, 0xFF, 0x00,
3684 0x00, 0xFD, 0xFF, 0xC4, 0xFF, 0x6F, 0xFF, 0xDD, 0xFF, 0x22, 0x02,
3685 0x82, 0x06, 0xCC, 0x0B, 0xC4, 0x0F, 0x7A, 0x10, 0x90, 0x0D, 0x7D,
3686 0x08, 0x8E, 0x03, 0x74, 0x00, 0x72, 0xFF, 0x9F, 0xFF, 0xF1, 0xFF,
3687 0xF2, 0xFF, 0xA1, 0xFF, 0x70, 0xFF, 0x6A, 0x00, 0x78, 0x03, 0x61,
3688 0x08, 0x79, 0x0D, 0x73, 0x10, 0xD1, 0x0F, 0xE6, 0x0B, 0x9D, 0x06,
3689 0x34, 0x02, 0xE4, 0xFF, 0x6F, 0xFF, 0xC2, 0xFF, 0xFD, 0xFF, 0x00,
3690 0x00, 0xDD, 0xFF, 0x81, 0xFF, 0x97, 0xFF, 0x3D, 0x01, 0x0D, 0x05,
3691 0x47, 0x0A, 0xE1, 0x0E, 0xAA, 0x10, 0xBB, 0x0E, 0x10, 0x0A, 0xDC,
3692 0x04, 0x21, 0x01, 0x90, 0xFF, 0x84, 0xFF, 0xE0, 0xFF, 0xFC, 0xFF,
3693 0xBE, 0xFF, 0x6D, 0xFF, 0xF1, 0xFF, 0x58, 0x02, 0xD3, 0x06, 0x1A,
3694 0x0C, 0xEB, 0x0F, 0x65, 0x10, 0x4B, 0x0D, 0x29, 0x08, 0x4D, 0x03,
3695 0x57, 0x00, 0x6F, 0xFF, 0xA5, 0xFF, 0xF4, 0xFF, 0xEF, 0xFF, 0x9B,
3696 0xFF, 0x74, 0xFF, 0x8A, 0x00, 0xBA, 0x03, 0xB5, 0x08, 0xBD, 0x0D,
3697 0x86, 0x10, 0xA9, 0x0F, 0x97, 0x0B, 0x4C, 0x06, 0xFF, 0x01, 0xD1,
3698 0xFF, 0x71, 0xFF, 0xC8, 0xFF, 0xFE, 0xFF, 0x00, 0x00, 0xD8, 0xFF,
3699 0x7C, 0xFF, 0xA3, 0xFF, 0x69, 0x01, 0x59, 0x05, 0x9A, 0x0A, 0x16,
3700 0x0F, 0xA7, 0x10, 0x82, 0x0E, 0xBC, 0x09, 0x93, 0x04, 0xF9, 0x00,
3701 0x87, 0xFF, 0x89, 0xFF, 0xE4, 0xFF, 0xFB, 0xFF, 0xB8, 0xFF, 0x6C,
3702 0xFF, 0x07, 0x00, 0x91, 0x02, 0x25, 0x07, 0x67, 0x0C, 0x0E, 0x10,
3703 0x4D, 0x10, 0x03, 0x0D, 0xD5, 0x07, 0x0E, 0x03, 0x3B, 0x00, 0x6D,
3704 0xFF, 0xAC, 0xFF, 0xF7, 0xFF, 0xEC, 0xFF, 0x95, 0xFF, 0x79, 0xFF,
3705 0xAB, 0x00, 0xFE, 0x03, 0x0A, 0x09, 0xFF, 0x0D, 0x94, 0x10, 0x7D,
3706 0x0F, 0x47, 0x0B, 0xFD, 0x05, 0xCC, 0x01, 0xC0, 0xFF, 0x74, 0xFF,
3707 0xCD, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xD3, 0xFF, 0x78, 0xFF, 0xB0,
3708 0xFF, 0x97, 0x01, 0xA6, 0x05, 0xEC, 0x0A, 0x48, 0x0F, 0xA0, 0x10,
3709 0x45, 0x0E, 0x67, 0x09, 0x4B, 0x04, 0xD3, 0x00, 0x80, 0xFF, 0x8F,
3710 0xFF, 0xE8, 0xFF, 0xF9, 0xFF, 0xB2, 0xFF, 0x6C, 0xFF, 0x1E, 0x00,
3711 0xCB, 0x02, 0x78, 0x07, 0xB2, 0x0C, 0x2E, 0x10, 0x31, 0x10, 0xBA,
3712 0x0C, 0x81, 0x07, 0xD2, 0x02, 0x21, 0x00, 0x6C, 0xFF, 0xB2, 0xFF,
3713 0xF9, 0xFF, 0xE8, 0xFF, 0x90, 0xFF, 0x7F, 0xFF, 0xCF, 0x00, 0x43,
3714 0x04, 0x5E, 0x09, 0x3E, 0x0E, 0x9F, 0x10, 0x4E, 0x0F, 0xF6, 0x0A,
3715 0xAE, 0x05, 0x9C, 0x01, 0xB1, 0xFF, 0x78, 0xFF, 0xD2, 0xFF, 0xFF,
3716 0xFF, 0xFF, 0xFF, 0xCE, 0xFF, 0x74, 0xFF, 0xBF, 0xFF, 0xC7, 0x01,
3717 0xF4, 0x05, 0x3E, 0x0B, 0x78, 0x0F, 0x96, 0x10, 0x06, 0x0E, 0x13,
3718 0x09, 0x05, 0x04, 0xAF, 0x00, 0x79, 0xFF, 0x95, 0xFF, 0xEC, 0xFF,
3719 0xF7, 0xFF, 0xAC, 0xFF, 0x6D, 0xFF, 0x38, 0x00, 0x07, 0x03, 0xCB,
3720 0x07, 0xFB, 0x0C, 0x4A, 0x10, 0x11, 0x10, 0x6F, 0x0C, 0x2E, 0x07,
3721 0x97, 0x02, 0x09, 0x00, 0x6C, 0xFF, 0xB8, 0xFF, 0xFA, 0xFF, 0xE4,
3722 0xFF, 0x8A, 0xFF, 0x86, 0xFF, 0xF4, 0x00, 0x8B, 0x04, 0xB2, 0x09,
3723 0x7B, 0x0E, 0xA7, 0x10, 0x1C, 0x0F, 0xA3, 0x0A, 0x61, 0x05, 0x6E,
3724 0x01, 0xA4, 0xFF, 0x7C, 0xFF, 0xD8, 0xFF, 0x00, 0x00, 0xFE, 0xFF,
3725 0xC8, 0xFF, 0x71, 0xFF, 0xCF, 0xFF, 0xF9, 0x01, 0x43, 0x06, 0x8E,
3726 0x0B, 0xA4, 0x0F, 0x88, 0x10, 0xC4, 0x0D, 0xBE, 0x08, 0xC1, 0x03,
3727 0x8D, 0x00, 0x75, 0xFF, 0x9B, 0xFF, 0xEF, 0xFF, 0xF4, 0xFF, 0xA6,
3728 0xFF, 0x6E, 0xFF, 0x53, 0x00, 0x46, 0x03, 0x1F, 0x08, 0x43, 0x0D,
3729 0x63, 0x10, 0xEF, 0x0F, 0x23, 0x0C, 0xDC, 0x06, 0x5E, 0x02, 0xF3,
3730 0xFF, 0x6D, 0xFF, 0xBE, 0xFF, 0xFC, 0xFF, 0xE0, 0xFF, 0x85, 0xFF,
3731 0x8F, 0xFF, 0x1C, 0x01, 0xD3, 0x04, 0x06, 0x0A, 0xB5, 0x0E, 0xAA,
3732 0x10, 0xE7, 0x0E, 0x50, 0x0A, 0x16, 0x05, 0x42, 0x01, 0x98, 0xFF,
3733 0x80, 0xFF, 0xDC, 0xFF, 0x00, 0x00, 0xFD, 0xFF, 0xC3, 0xFF, 0x6F,
3734 0xFF, 0xE1, 0xFF, 0x2E, 0x02, 0x94, 0x06, 0xDD, 0x0B, 0xCD, 0x0F,
3735 0x76, 0x10, 0x81, 0x0D, 0x6A, 0x08, 0x7F, 0x03, 0x6E, 0x00, 0x71,
3736 0xFF, 0xA1, 0xFF, 0xF2, 0xFF, 0x00, 0x00, 0x15, 0x00, 0xD1, 0xFF,
3737 0x8B, 0xFE, 0xBC, 0xFD, 0xE1, 0x00, 0x84, 0x09, 0xB0, 0x13, 0x47,
3738 0x18, 0xB0, 0x13, 0x84, 0x09, 0xE1, 0x00, 0xBC, 0xFD, 0x8B, 0xFE,
3739 0xD1, 0xFF, 0x15, 0x00, 0xFD, 0xFF, 0x13, 0x00, 0xDA, 0x00, 0x30,
3740 0x00, 0x5D, 0xFC, 0xB3, 0xFC, 0x35, 0x0A, 0xC2, 0x1C, 0x24, 0x20,
3741 0x48, 0x10, 0x5D, 0xFF, 0x74, 0xFB, 0x3A, 0xFF, 0xFB, 0x00, 0x42,
3742 0x00, 0xF8, 0xFF, 0xFA, 0xFF, 0x2C, 0x00, 0xF3, 0x00, 0xAD, 0xFF,
3743 0xC5, 0xFB, 0x11, 0xFE, 0xAF, 0x0D, 0xEF, 0x1E, 0x68, 0x1E, 0xBC,
3744 0x0C, 0xA7, 0xFD, 0xEA, 0xFB, 0xD3, 0xFF, 0xEE, 0x00, 0x24, 0x00,
3745 0xFA, 0xFF, 0xF7, 0xFF, 0x4C, 0x00, 0xFB, 0x00, 0x0C, 0xFF, 0x5F,
3746 0xFB, 0xE8, 0xFF, 0x3D, 0x11, 0x7E, 0x20, 0x13, 0x1C, 0x4C, 0x09,
3747 0x6A, 0xFC, 0x8C, 0xFC, 0x4E, 0x00, 0xD1, 0x00, 0x0E, 0x00, 0xFD,
3748 0xFF, 0xF7, 0xFF, 0x72, 0x00, 0xEC, 0x00, 0x55, 0xFE, 0x3D, 0xFB,
3749 0x37, 0x02, 0xBE, 0x14, 0x5D, 0x21, 0x40, 0x19, 0x18, 0x06, 0xA2,
3750 0xFB, 0x47, 0xFD, 0xA7, 0x00, 0xAB, 0x00, 0x00, 0x00, 0x00, 0x00,
3751 0x00, 0x00, 0xFC, 0xFF, 0x9B, 0x00, 0xC0, 0x00, 0x92, 0xFD, 0x73,
3752 0xFB, 0xF2, 0x04, 0x0E, 0x18, 0x81, 0x21, 0x0C, 0x16, 0x37, 0x03,
3753 0x47, 0xFB, 0x0B, 0xFE, 0xDF, 0x00, 0x82, 0x00, 0xF9, 0xFF, 0xFE,
3754 0xFF, 0x08, 0x00, 0xC3, 0x00, 0x74, 0x00, 0xD2, 0xFC, 0x10, 0xFC,
3755 0x08, 0x08, 0x0A, 0x1B, 0xE9, 0x20, 0x9A, 0x12, 0xBE, 0x00, 0x49,
3756 0xFB, 0xC8, 0xFE, 0xF9, 0x00, 0x5A, 0x00, 0xF7, 0xFF, 0xFC, 0xFF,
3757 0x1B, 0x00, 0xE4, 0x00, 0x06, 0x00, 0x24, 0xFC, 0x1E, 0xFD, 0x65,
3758 0x0B, 0x94, 0x1D, 0x9D, 0x1F, 0x0D, 0x0F, 0xB8, 0xFE, 0x96, 0xFB,
3759 0x72, 0xFF, 0xF9, 0x00, 0x37, 0x00, 0xF8, 0xFF, 0xF9, 0xFF, 0x36,
3760 0x00, 0xF8, 0x00, 0x78, 0xFF, 0x9B, 0xFB, 0xA6, 0xFE, 0xE9, 0x0E,
3761 0x8D, 0x1F, 0xAA, 0x1D, 0x87, 0x0B, 0x2B, 0xFD, 0x1E, 0xFC, 0x02,
3762 0x00, 0xE5, 0x00, 0x1C, 0x00, 0xFB, 0xFF, 0xF7, 0xFF, 0x58, 0x00,
3763 0xF9, 0x00, 0xCF, 0xFE, 0x4A, 0xFB, 0xA7, 0x00, 0x77, 0x12, 0xE0,
3764 0x20, 0x26, 0x1B, 0x28, 0x08, 0x18, 0xFC, 0xCB, 0xFC, 0x71, 0x00,
3765 0xC5, 0x00, 0x08, 0x00, 0xFE, 0xFF, 0xF8, 0xFF, 0x80, 0x00, 0xE1,
3766 0x00, 0x13, 0xFE, 0x45, 0xFB, 0x1D, 0x03, 0xEB, 0x15, 0x7F, 0x21,
3767 0x2D, 0x18, 0x0E, 0x05, 0x77, 0xFB, 0x8B, 0xFD, 0xBE, 0x00, 0x9D,
3768 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xA9, 0x00,
3769 0xAA, 0x00, 0x4F, 0xFD, 0x9D, 0xFB, 0xFA, 0x05, 0x22, 0x19, 0x62,
3770 0x21, 0xE0, 0x14, 0x50, 0x02, 0x3E, 0xFB, 0x4E, 0xFE, 0xEB, 0x00,
3771 0x73, 0x00, 0xF7, 0xFF, 0xFE, 0xFF, 0x0D, 0x00, 0xD0, 0x00, 0x52,
3772 0x00, 0x93, 0xFC, 0x60, 0xFC, 0x2C, 0x09, 0xFA, 0x1B, 0x8A, 0x20,
3773 0x60, 0x11, 0xFD, 0xFF, 0x5C, 0xFB, 0x06, 0xFF, 0xFB, 0x00, 0x4D,
3774 0x00, 0xF7, 0xFF, 0xFA, 0xFF, 0x23, 0x00, 0xED, 0x00, 0xD9, 0xFF,
3775 0xEF, 0xFB, 0x98, 0xFD, 0x99, 0x0C, 0x54, 0x1E, 0x02, 0x1F, 0xD2,
3776 0x0D, 0x20, 0xFE, 0xC0, 0xFB, 0xA7, 0xFF, 0xF4, 0x00, 0x2D, 0x00,
3777 0xF9, 0xFF, 0xF8, 0xFF, 0x41, 0x00, 0xFB, 0x00, 0x41, 0xFF, 0x78,
3778 0xFB, 0x4A, 0xFF, 0x25, 0x10, 0x16, 0x20, 0xDA, 0x1C, 0x56, 0x0A,
3779 0xBE, 0xFC, 0x56, 0xFC, 0x2C, 0x00, 0xDB, 0x00, 0x14, 0x00, 0xFD,
3780 0xFF, 0xF7, 0xFF, 0x66, 0x00, 0xF4, 0x00, 0x8F, 0xFE, 0x3F, 0xFB,
3781 0x75, 0x01, 0xAE, 0x13, 0x2C, 0x21, 0x2A, 0x1A, 0x0D, 0x07, 0xD4,
3782 0xFB, 0x0C, 0xFD, 0x8F, 0x00, 0xB7, 0x00, 0x03, 0x00, 0xFF, 0xFF,
3783 0x00, 0x00, 0xFA, 0xFF, 0x8E, 0x00, 0xD1, 0x00, 0xCF, 0xFD, 0x58,
3784 0xFB, 0x10, 0x04, 0x10, 0x17, 0x8A, 0x21, 0x10, 0x17, 0x10, 0x04,
3785 0x58, 0xFB, 0xCF, 0xFD, 0xD1, 0x00, 0x8E, 0x00, 0xFA, 0xFF, 0xFF,
3786 0xFF, 0x03, 0x00, 0xB7, 0x00, 0x8F, 0x00, 0x0C, 0xFD, 0xD4, 0xFB,
3787 0x0D, 0x07, 0x2A, 0x1A, 0x2C, 0x21, 0xAE, 0x13, 0x75, 0x01, 0x3F,
3788 0xFB, 0x8F, 0xFE, 0xF4, 0x00, 0x66, 0x00, 0xF7, 0xFF, 0xFD, 0xFF,
3789 0x14, 0x00, 0xDB, 0x00, 0x2C, 0x00, 0x56, 0xFC, 0xBE, 0xFC, 0x56,
3790 0x0A, 0xDA, 0x1C, 0x16, 0x20, 0x25, 0x10, 0x4A, 0xFF, 0x78, 0xFB,
3791 0x41, 0xFF, 0xFB, 0x00, 0x41, 0x00, 0xF8, 0xFF, 0xF9, 0xFF, 0x2D,
3792 0x00, 0xF4, 0x00, 0xA7, 0xFF, 0xC0, 0xFB, 0x20, 0xFE, 0xD2, 0x0D,
3793 0x02, 0x1F, 0x54, 0x1E, 0x99, 0x0C, 0x98, 0xFD, 0xEF, 0xFB, 0xD9,
3794 0xFF, 0xED, 0x00, 0x23, 0x00, 0xFA, 0xFF, 0xF7, 0xFF, 0x4D, 0x00,
3795 0xFB, 0x00, 0x06, 0xFF, 0x5C, 0xFB, 0xFD, 0xFF, 0x60, 0x11, 0x8A,
3796 0x20, 0xFA, 0x1B, 0x2C, 0x09, 0x60, 0xFC, 0x93, 0xFC, 0x52, 0x00,
3797 0xD0, 0x00, 0x0D, 0x00, 0xFE, 0xFF, 0xF7, 0xFF, 0x73, 0x00, 0xEB,
3798 0x00, 0x4E, 0xFE, 0x3E, 0xFB, 0x50, 0x02, 0xE0, 0x14, 0x62, 0x21,
3799 0x22, 0x19, 0xFA, 0x05, 0x9D, 0xFB, 0x4F, 0xFD, 0xAA, 0x00, 0xA9,
3800 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0x9D, 0x00,
3801 0xBE, 0x00, 0x8B, 0xFD, 0x77, 0xFB, 0x0E, 0x05, 0x2D, 0x18, 0x7F,
3802 0x21, 0xEB, 0x15, 0x1D, 0x03, 0x45, 0xFB, 0x13, 0xFE, 0xE1, 0x00,
3803 0x80, 0x00, 0xF8, 0xFF, 0xFE, 0xFF, 0x08, 0x00, 0xC5, 0x00, 0x71,
3804 0x00, 0xCB, 0xFC, 0x18, 0xFC, 0x28, 0x08, 0x26, 0x1B, 0xE0, 0x20,
3805 0x77, 0x12, 0xA7, 0x00, 0x4A, 0xFB, 0xCF, 0xFE, 0xF9, 0x00, 0x58,
3806 0x00, 0xF7, 0xFF, 0xFB, 0xFF, 0x1C, 0x00, 0xE5, 0x00, 0x02, 0x00,
3807 0x1E, 0xFC, 0x2B, 0xFD, 0x87, 0x0B, 0xAA, 0x1D, 0x8D, 0x1F, 0xE9,
3808 0x0E, 0xA6, 0xFE, 0x9B, 0xFB, 0x78, 0xFF, 0xF8, 0x00, 0x36, 0x00,
3809 0xF9, 0xFF, 0xF8, 0xFF, 0x37, 0x00, 0xF9, 0x00, 0x72, 0xFF, 0x96,
3810 0xFB, 0xB8, 0xFE, 0x0D, 0x0F, 0x9D, 0x1F, 0x94, 0x1D, 0x65, 0x0B,
3811 0x1E, 0xFD, 0x24, 0xFC, 0x06, 0x00, 0xE4, 0x00, 0x1B, 0x00, 0xFC,
3812 0xFF, 0xF7, 0xFF, 0x5A, 0x00, 0xF9, 0x00, 0xC8, 0xFE, 0x49, 0xFB,
3813 0xBE, 0x00, 0x9A, 0x12, 0xE9, 0x20, 0x0A, 0x1B, 0x08, 0x08, 0x10,
3814 0xFC, 0xD2, 0xFC, 0x74, 0x00, 0xC3, 0x00, 0x08, 0x00, 0xFE, 0xFF,
3815 0xF9, 0xFF, 0x82, 0x00, 0xDF, 0x00, 0x0B, 0xFE, 0x47, 0xFB, 0x37,
3816 0x03, 0x0C, 0x16, 0x81, 0x21, 0x0E, 0x18, 0xF2, 0x04, 0x73, 0xFB,
3817 0x92, 0xFD, 0xC0, 0x00, 0x9B, 0x00, 0xFC, 0xFF, 0x00, 0x00, 0x00,
3818 0x00, 0x00, 0x00, 0xAB, 0x00, 0xA7, 0x00, 0x47, 0xFD, 0xA2, 0xFB,
3819 0x18, 0x06, 0x40, 0x19, 0x5D, 0x21, 0xBE, 0x14, 0x37, 0x02, 0x3D,
3820 0xFB, 0x55, 0xFE, 0xEC, 0x00, 0x72, 0x00, 0xF7, 0xFF, 0xFD, 0xFF,
3821 0x0E, 0x00, 0xD1, 0x00, 0x4E, 0x00, 0x8C, 0xFC, 0x6A, 0xFC, 0x4C,
3822 0x09, 0x13, 0x1C, 0x7E, 0x20, 0x3D, 0x11, 0xE8, 0xFF, 0x5F, 0xFB,
3823 0x0C, 0xFF, 0xFB, 0x00, 0x4C, 0x00, 0xF7, 0xFF, 0xFA, 0xFF, 0x24,
3824 0x00, 0xEE, 0x00, 0xD3, 0xFF, 0xEA, 0xFB, 0xA7, 0xFD, 0xBC, 0x0C,
3825 0x68, 0x1E, 0xEF, 0x1E, 0xAF, 0x0D, 0x11, 0xFE, 0xC5, 0xFB, 0xAD,
3826 0xFF, 0xF3, 0x00, 0x2C, 0x00, 0xFA, 0xFF, 0xF8, 0xFF, 0x42, 0x00,
3827 0xFB, 0x00, 0x3A, 0xFF, 0x74, 0xFB, 0x5D, 0xFF, 0x48, 0x10, 0x24,
3828 0x20, 0xC2, 0x1C, 0x35, 0x0A, 0xB3, 0xFC, 0x5D, 0xFC, 0x30, 0x00,
3829 0xDA, 0x00, 0x13, 0x00, 0xFD, 0xFF, 0xF7, 0xFF, 0x67, 0x00, 0xF3,
3830 0x00, 0x88, 0xFE, 0x3E, 0xFB, 0x8C, 0x01, 0xD0, 0x13, 0x33, 0x21,
3831 0x0D, 0x1A, 0xEE, 0x06, 0xCD, 0xFB, 0x13, 0xFD, 0x92, 0x00, 0xB6,
3832 0x00, 0x03, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFA, 0xFF, 0x90, 0x00,
3833 0xCF, 0x00, 0xC7, 0xFD, 0x5B, 0xFB, 0x2B, 0x04, 0x31, 0x17, 0x8A,
3834 0x21, 0xF0, 0x16, 0xF4, 0x03, 0x56, 0xFB, 0xD6, 0xFD, 0xD3, 0x00,
3835 0x8D, 0x00, 0xFA, 0xFF, 0xFF, 0xFF, 0x04, 0x00, 0xB9, 0x00, 0x8C,
3836 0x00, 0x05, 0xFD, 0xDB, 0xFB, 0x2C, 0x07, 0x47, 0x1A, 0x25, 0x21,
3837 0x8B, 0x13, 0x5D, 0x01, 0x40, 0xFB, 0x97, 0xFE, 0xF5, 0x00, 0x64,
3838 0x00, 0xF7, 0xFF, 0xFC, 0xFF, 0x15, 0x00, 0xDC, 0x00, 0x27, 0x00,
3839 0x50, 0xFC, 0xCA, 0xFC, 0x78, 0x0A, 0xF2, 0x1C, 0x07, 0x20, 0x02,
3840 0x10, 0x37, 0xFF, 0x7B, 0xFB, 0x47, 0xFF, 0xFB, 0x00, 0x40, 0x00,
3841 0xF8, 0xFF, 0xF9, 0xFF, 0x2E, 0x00, 0xF5, 0x00, 0xA2, 0xFF, 0xBB,
3842 0xFB, 0x31, 0xFE, 0xF5, 0x0D, 0x14, 0x1F, 0x3F, 0x1E, 0x77, 0x0C,
3843 0x8A, 0xFD, 0xF5, 0xFB, 0xDE, 0xFF, 0xEC, 0x00, 0x22, 0x00, 0xFB,
3844 0xFF, 0xF7, 0xFF, 0x4E, 0x00, 0xFB, 0x00, 0xFF, 0xFE, 0x59, 0xFB,
3845 0x11, 0x00, 0x83, 0x11, 0x96, 0x20, 0xE0, 0x1B, 0x0B, 0x09, 0x56,
3846 0xFC, 0x99, 0xFC, 0x56, 0x00, 0xCE, 0x00, 0x0D, 0x00, 0xFE, 0xFF,
3847 0xF8, 0xFF, 0x75, 0x00, 0xEA, 0x00, 0x47, 0xFE, 0x3E, 0xFB, 0x69,
3848 0x02, 0x02, 0x15, 0x66, 0x21, 0x04, 0x19, 0xDC, 0x05, 0x98, 0xFB,
3849 0x56, 0xFD, 0xAD, 0x00, 0xA8, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00,
3850 0x00, 0xFD, 0xFF, 0x9E, 0x00, 0xBC, 0x00, 0x83, 0xFD, 0x7B, 0xFB,
3851 0x2B, 0x05, 0x4C, 0x18, 0x7C, 0x21, 0xCA, 0x15, 0x03, 0x03, 0x44,
3852 0xFB, 0x1A, 0xFE, 0xE2, 0x00, 0x7E, 0x00, 0xF8, 0xFF, 0xFE, 0xFF,
3853 0x09, 0x00, 0xC6, 0x00, 0x6D, 0x00, 0xC3, 0xFC, 0x20, 0xFC, 0x49,
3854 0x08, 0x41, 0x1B, 0xD6, 0x20, 0x54, 0x12, 0x92, 0x00, 0x4C, 0xFB,
3855 0xD6, 0xFE, 0xFA, 0x00, 0x57, 0x00, 0xF7, 0xFF, 0xFB, 0xFF, 0x1D,
3856 0x00, 0xE6, 0x00, 0xFD, 0xFF, 0x18, 0xFC, 0x38, 0xFD, 0xA9, 0x0B,
3857 0xC0, 0x1D, 0x7C, 0x1F, 0xC6, 0x0E, 0x95, 0xFE, 0x9F, 0xFB, 0x7E,
3858 0xFF, 0xF8, 0x00, 0x35, 0x00, 0xF9, 0xFF, 0xF8, 0xFF, 0x38, 0x00,
3859 0xF9, 0x00, 0x6C, 0xFF, 0x92, 0xFB, 0xC9, 0xFE, 0x2F, 0x0F, 0xAD,
3860 0x1F, 0x7D, 0x1D, 0x42, 0x0B, 0x12, 0xFD, 0x2A, 0xFC, 0x0B, 0x00,
3861 0xE3, 0x00, 0x1A, 0x00, 0xFC, 0xFF, 0xF7, 0xFF, 0x5B, 0x00, 0xF8,
3862 0x00, 0xC1, 0xFE, 0x47, 0xFB, 0xD4, 0x00, 0xBC, 0x12, 0xF3, 0x20,
3863 0xEF, 0x1A, 0xE9, 0x07, 0x08, 0xFC, 0xD9, 0xFC, 0x78, 0x00, 0xC2,
3864 0x00, 0x07, 0x00, 0xFF, 0xFF, 0xF9, 0xFF, 0x83, 0x00, 0xDD, 0x00,
3865 0x04, 0xFE, 0x49, 0xFB, 0x52, 0x03, 0x2D, 0x16, 0x83, 0x21, 0xEF,
3866 0x17, 0xD5, 0x04, 0x6F, 0xFB, 0x9A, 0xFD, 0xC3, 0x00, 0x9A, 0x00,
3867 0xFC, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xAD, 0x00, 0xA4,
3868 0x00, 0x40, 0xFD, 0xA8, 0xFB, 0x36, 0x06, 0x5E, 0x19, 0x58, 0x21,
3869 0x9C, 0x14, 0x1E, 0x02, 0x3D, 0xFB, 0x5D, 0xFE, 0xED, 0x00, 0x70,
3870 0x00, 0xF7, 0xFF, 0xFD, 0xFF, 0x0F, 0x00, 0xD2, 0x00, 0x4A, 0x00,
3871 0x85, 0xFC, 0x74, 0xFC, 0x6D, 0x09, 0x2D, 0x1C, 0x72, 0x20, 0x1A,
3872 0x11, 0xD4, 0xFF, 0x61, 0xFB, 0x13, 0xFF, 0xFC, 0x00, 0x4A, 0x00,
3873 0xF7, 0xFF, 0xFA, 0xFF, 0x25, 0x00, 0xEF, 0x00, 0xCE, 0xFF, 0xE4,
3874 0xFB, 0xB5, 0xFD, 0xDE, 0x0C, 0x7C, 0x1E, 0xDD, 0x1E, 0x8C, 0x0D,
3875 0x01, 0xFE, 0xCA, 0xFB, 0xB3, 0xFF, 0xF3, 0x00, 0x2B, 0x00, 0xFA,
3876 0xFF, 0xF8, 0xFF, 0x44, 0x00, 0xFB, 0x00, 0x34, 0xFF, 0x71, 0xFB,
3877 0x71, 0xFF, 0x6B, 0x10, 0x32, 0x20, 0xA9, 0x1C, 0x13, 0x0A, 0xA8,
3878 0xFC, 0x63, 0xFC, 0x35, 0x00, 0xD9, 0x00, 0x12, 0x00, 0xFD, 0xFF,
3879 0xF7, 0xFF, 0x69, 0x00, 0xF2, 0x00, 0x81, 0xFE, 0x3E, 0xFB, 0xA4,
3880 0x01, 0xF2, 0x13, 0x3A, 0x21, 0xF0, 0x19, 0xCF, 0x06, 0xC7, 0xFB,
3881 0x1B, 0xFD, 0x96, 0x00, 0xB4, 0x00, 0x02, 0x00, 0xFF, 0xFF, 0x00,
3882 0x00, 0xFB, 0xFF, 0x92, 0x00, 0xCD, 0x00, 0xC0, 0xFD, 0x5E, 0xFB,
3883 0x47, 0x04, 0x51, 0x17, 0x8A, 0x21, 0xD0, 0x16, 0xD9, 0x03, 0x53,
3884 0xFB, 0xDE, 0xFD, 0xD5, 0x00, 0x8B, 0x00, 0xFA, 0xFF, 0xFF, 0xFF,
3885 0x04, 0x00, 0xBA, 0x00, 0x89, 0x00, 0xFD, 0xFC, 0xE2, 0xFB, 0x4B,
3886 0x07, 0x63, 0x1A, 0x1D, 0x21, 0x69, 0x13, 0x46, 0x01, 0x41, 0xFB,
3887 0x9E, 0xFE, 0xF5, 0x00, 0x63, 0x00, 0xF7, 0xFF, 0xFC, 0xFF, 0x16,
3888 0x00, 0xDD, 0x00, 0x23, 0x00, 0x49, 0xFC, 0xD5, 0xFC, 0x99, 0x0A,
3889 0x09, 0x1D, 0xF9, 0x1F, 0xDF, 0x0F, 0x24, 0xFF, 0x7F, 0xFB, 0x4D,
3890 0xFF, 0xFB, 0x00, 0x3F, 0x00, 0xF8, 0xFF, 0xF9, 0xFF, 0x2F, 0x00,
3891 0xF5, 0x00, 0x9C, 0xFF, 0xB6, 0xFB, 0x41, 0xFE, 0x17, 0x0E, 0x26,
3892 0x1F, 0x2B, 0x1E, 0x54, 0x0C, 0x7C, 0xFD, 0xFA, 0xFB, 0xE3, 0xFF,
3893 0xEB, 0x00, 0x21, 0x00, 0xFB, 0xFF, 0xF7, 0xFF, 0x50, 0x00, 0xFB,
3894 0x00, 0xF8, 0xFE, 0x57, 0xFB, 0x26, 0x00, 0xA6, 0x11, 0xA1, 0x20,
3895 0xC6, 0x1B, 0xEA, 0x08, 0x4D, 0xFC, 0xA0, 0xFC, 0x5A, 0x00, 0xCD,
3896 0x00, 0x0C, 0x00, 0xFE, 0xFF, 0xF8, 0xFF, 0x77, 0x00, 0xE9, 0x00,
3897 0x3F, 0xFE, 0x3F, 0xFB, 0x82, 0x02, 0x23, 0x15, 0x6B, 0x21, 0xE5,
3898 0x18, 0xBE, 0x05, 0x93, 0xFB, 0x5E, 0xFD, 0xAF, 0x00, 0xA6, 0x00,
3899 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFD, 0xFF, 0xA0, 0x00, 0xB9,
3900 0x00, 0x7C, 0xFD, 0x80, 0xFB, 0x48, 0x05, 0x6B, 0x18, 0x79, 0x21,
3901 0xA9, 0x15, 0xE9, 0x02, 0x43, 0xFB, 0x21, 0xFE, 0xE3, 0x00, 0x7D,
3902 0x00, 0xF8, 0xFF, 0xFE, 0xFF, 0x09, 0x00, 0xC7, 0x00, 0x69, 0x00,
3903 0xBC, 0xFC, 0x29, 0xFC, 0x69, 0x08, 0x5C, 0x1B, 0xCC, 0x20, 0x32,
3904 0x12, 0x7C, 0x00, 0x4E, 0xFB, 0xDD, 0xFE, 0xFA, 0x00, 0x56, 0x00,
3905 0xF7, 0xFF, 0xFB, 0xFF, 0x1D, 0x00, 0xE7, 0x00, 0xF8, 0xFF, 0x12,
3906 0xFC, 0x45, 0xFD, 0xCB, 0x0B, 0xD6, 0x1D, 0x6C, 0x1F, 0xA3, 0x0E,
3907 0x84, 0xFE, 0xA4, 0xFB, 0x84, 0xFF, 0xF7, 0x00, 0x34, 0x00, 0xF9,
3908 0xFF, 0xF8, 0xFF, 0x3A, 0x00, 0xFA, 0x00, 0x66, 0xFF, 0x8E, 0xFB,
3909 0xDB, 0xFE, 0x53, 0x0F, 0xBD, 0x1F, 0x66, 0x1D, 0x21, 0x0B, 0x05,
3910 0xFD, 0x30, 0xFC, 0x10, 0x00, 0xE2, 0x00, 0x19, 0x00, 0xFC, 0xFF,
3911 0xF7, 0xFF, 0x5D, 0x00, 0xF8, 0x00, 0xBA, 0xFE, 0x46, 0xFB, 0xEA,
3912 0x00, 0xDF, 0x12, 0xFC, 0x20, 0xD3, 0x1A, 0xC9, 0x07, 0x00, 0xFC,
3913 0xE0, 0xFC, 0x7B, 0x00, 0xC0, 0x00, 0x07, 0x00, 0xFF, 0xFF, 0xF9,
3914 0xFF, 0x85, 0x00, 0xDC, 0x00, 0xFC, 0xFD, 0x4A, 0xFB, 0x6C, 0x03,
3915 0x4E, 0x16, 0x85, 0x21, 0xCF, 0x17, 0xB8, 0x04, 0x6C, 0xFB, 0xA2,
3916 0xFD, 0xC5, 0x00, 0x98, 0x00, 0xFC, 0xFF, 0x00, 0x00, 0xFF, 0xFF,
3917 0x01, 0x00, 0xAE, 0x00, 0xA1, 0x00, 0x38, 0xFD, 0xAE, 0xFB, 0x54,
3918 0x06, 0x7C, 0x19, 0x53, 0x21, 0x7B, 0x14, 0x05, 0x02, 0x3D, 0xFB,
3919 0x64, 0xFE, 0xEE, 0x00, 0x6F, 0x00, 0xF7, 0xFF, 0xFD, 0xFF, 0x0F,
3920 0x00, 0xD4, 0x00, 0x46, 0x00, 0x7E, 0xFC, 0x7E, 0xFC, 0x8E, 0x09,
3921 0x46, 0x1C, 0x66, 0x20, 0xF7, 0x10, 0xC0, 0xFF, 0x64, 0xFB, 0x1A,
3922 0xFF, 0xFC, 0x00, 0x49, 0x00, 0xF7, 0xFF, 0xFA, 0xFF, 0x26, 0x00,
3923 0xF0, 0x00, 0xC9, 0xFF, 0xDF, 0xFB, 0xC4, 0xFD, 0x01, 0x0D, 0x90,
3924 0x1E, 0xCA, 0x1E, 0x69, 0x0D, 0xF1, 0xFD, 0xCF, 0xFB, 0xB8, 0xFF,
3925 0xF2, 0x00, 0x29, 0x00, 0xFA, 0xFF, 0xF7, 0xFF, 0x45, 0x00, 0xFC,
3926 0x00, 0x2D, 0xFF, 0x6D, 0xFB, 0x84, 0xFF, 0x8E, 0x10, 0x3F, 0x20,
3927 0x91, 0x1C, 0xF2, 0x09, 0x9D, 0xFC, 0x6A, 0xFC, 0x39, 0x00, 0xD7,
3928 0x00, 0x12, 0x00, 0xFD, 0xFF, 0xF7, 0xFF, 0x6A, 0x00, 0xF1, 0x00,
3929 0x7A, 0xFE, 0x3D, 0xFB, 0xBC, 0x01, 0x14, 0x14, 0x41, 0x21, 0xD4,
3930 0x19, 0xB0, 0x06, 0xC0, 0xFB, 0x22, 0xFD, 0x99, 0x00, 0xB3, 0x00,
3931 0x02, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFB, 0xFF, 0x93, 0x00, 0xCB,
3932 0x00, 0xB8, 0xFD, 0x61, 0xFB, 0x63, 0x04, 0x71, 0x17, 0x89, 0x21,
3933 0xB0, 0x16, 0xBD, 0x03, 0x51, 0xFB, 0xE6, 0xFD, 0xD7, 0x00, 0x8A,
3934 0x00, 0xFA, 0xFF, 0xFF, 0xFF, 0x05, 0x00, 0xBC, 0x00, 0x86, 0x00,
3935 0xF6, 0xFC, 0xE9, 0xFB, 0x6A, 0x07, 0x80, 0x1A, 0x15, 0x21, 0x47,
3936 0x13, 0x2F, 0x01, 0x42, 0xFB, 0xA5, 0xFE, 0xF6, 0x00, 0x61, 0x00,
3937 0xF7, 0xFF, 0xFC, 0xFF, 0x16, 0x00, 0xDF, 0x00, 0x1E, 0x00, 0x43,
3938 0xFC, 0xE1, 0xFC, 0xBB, 0x0A, 0x21, 0x1D, 0xEA, 0x1F, 0xBC, 0x0F,
3939 0x12, 0xFF, 0x82, 0xFB, 0x54, 0xFF, 0xFA, 0x00, 0x3D, 0x00, 0xF8,
3940 0xFF, 0xF9, 0xFF, 0x30, 0x00, 0xF6, 0x00, 0x96, 0xFF, 0xB1, 0xFB,
3941 0x51, 0xFE, 0x3A, 0x0E, 0x38, 0x1F, 0x16, 0x1E, 0x32, 0x0C, 0x6E,
3942 0xFD, 0x00, 0xFC, 0xE8, 0xFF, 0xEA, 0x00, 0x20, 0x00, 0xFB, 0xFF,
3943 0xF7, 0xFF, 0x51, 0x00, 0xFB, 0x00, 0xF1, 0xFE, 0x54, 0xFB, 0x3B,
3944 0x00, 0xC9, 0x11, 0xAD, 0x20, 0xAC, 0x1B, 0xCA, 0x08, 0x44, 0xFC,
3945 0xA7, 0xFC, 0x5E, 0x00, 0xCC, 0x00, 0x0B, 0x00, 0xFE, 0xFF, 0xF8,
3946 0xFF, 0x78, 0x00, 0xE7, 0x00, 0x38, 0xFE, 0x40, 0xFB, 0x9B, 0x02,
3947 0x45, 0x15, 0x6F, 0x21, 0xC7, 0x18, 0xA1, 0x05, 0x8E, 0xFB, 0x65,
3948 0xFD, 0xB2, 0x00, 0xA5, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00,
3949 0xFE, 0xFF, 0xA2, 0x00, 0xB7, 0x00, 0x74, 0xFD, 0x84, 0xFB, 0x66,
3950 0x05, 0x8A, 0x18, 0x76, 0x21, 0x87, 0x15, 0xCF, 0x02, 0x41, 0xFB,
3951 0x29, 0xFE, 0xE5, 0x00, 0x7B, 0x00, 0xF8, 0xFF, 0xFE, 0xFF, 0x0A,
3952 0x00, 0xC9, 0x00, 0x66, 0x00, 0xB5, 0xFC, 0x32, 0xFC, 0x89, 0x08,
3953 0x77, 0x1B, 0xC2, 0x20, 0x0F, 0x12, 0x66, 0x00, 0x50, 0xFB, 0xE4,
3954 0xFE, 0xFA, 0x00, 0x54, 0x00, 0xF7, 0xFF, 0xFB, 0xFF, 0x1E, 0x00,
3955 0xE8, 0x00, 0xF3, 0xFF, 0x0C, 0xFC, 0x53, 0xFD, 0xED, 0x0B, 0xEB,
3956 0x1D, 0x5A, 0x1F, 0x80, 0x0E, 0x73, 0xFE, 0xA8, 0xFB, 0x8A, 0xFF,
3957 0xF7, 0x00, 0x32, 0x00, 0xF9, 0xFF, 0xF8, 0xFF, 0x3B, 0x00, 0xFA,
3958 0x00, 0x60, 0xFF, 0x8A, 0xFB, 0xED, 0xFE, 0x76, 0x0F, 0xCC, 0x1F,
3959 0x4F, 0x1D, 0xFF, 0x0A, 0xF9, 0xFC, 0x36, 0xFC, 0x15, 0x00, 0xE1,
3960 0x00, 0x18, 0x00, 0xFC, 0xFF, 0xF7, 0xFF, 0x5E, 0x00, 0xF7, 0x00,
3961 0xB3, 0xFE, 0x44, 0xFB, 0x01, 0x01, 0x02, 0x13, 0x04, 0x21, 0xB8,
3962 0x1A, 0xA9, 0x07, 0xF8, 0xFB, 0xE7, 0xFC, 0x7F, 0x00, 0xBF, 0x00,
3963 0x06, 0x00, 0xFF, 0xFF, 0xF9, 0xFF, 0x86, 0x00, 0xDA, 0x00, 0xF5,
3964 0xFD, 0x4C, 0xFB, 0x87, 0x03, 0x6E, 0x16, 0x86, 0x21, 0xB0, 0x17,
3965 0x9C, 0x04, 0x68, 0xFB, 0xA9, 0xFD, 0xC7, 0x00, 0x96, 0x00, 0xFB,
3966 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x01, 0x00, 0xB0, 0x00, 0x9F, 0x00,
3967 0x31, 0xFD, 0xB4, 0xFB, 0x73, 0x06, 0x99, 0x19, 0x4D, 0x21, 0x59,
3968 0x14, 0xED, 0x01, 0x3D, 0xFB, 0x6B, 0xFE, 0xEF, 0x00, 0x6D, 0x00,
3969 0xF7, 0xFF, 0xFD, 0xFF, 0x10, 0x00, 0xD5, 0x00, 0x42, 0x00, 0x77,
3970 0xFC, 0x88, 0xFC, 0xAF, 0x09, 0x5F, 0x1C, 0x59, 0x20, 0xD4, 0x10,
3971 0xAC, 0xFF, 0x67, 0xFB, 0x20, 0xFF, 0xFC, 0x00, 0x48, 0x00, 0xF7,
3972 0xFF, 0xFA, 0xFF, 0x27, 0x00, 0xF0, 0x00, 0xC3, 0xFF, 0xD9, 0xFB,
3973 0xD3, 0xFD, 0x24, 0x0D, 0xA3, 0x1E, 0xB7, 0x1E, 0x46, 0x0D, 0xE2,
3974 0xFD, 0xD4, 0xFB, 0xBE, 0xFF, 0xF1, 0x00, 0x28, 0x00, 0xFA, 0xFF,
3975 0xF7, 0xFF, 0x46, 0x00, 0xFC, 0x00, 0x27, 0xFF, 0x6A, 0xFB, 0x98,
3976 0xFF, 0xB1, 0x10, 0x4C, 0x20, 0x78, 0x1C, 0xD1, 0x09, 0x93, 0xFC,
3977 0x71, 0xFC, 0x3D, 0x00, 0xD6, 0x00, 0x11, 0x00, 0xFD, 0xFF, 0xF7,
3978 0xFF, 0x6C, 0x00, 0xF0, 0x00, 0x72, 0xFE, 0x3D, 0xFB, 0xD4, 0x01,
3979 0x36, 0x14, 0x47, 0x21, 0xB6, 0x19, 0x91, 0x06, 0xBA, 0xFB, 0x29,
3980 0xFD, 0x9C, 0x00, 0xB1, 0x00, 0x02, 0x00, 0xFF, 0xFF, 0x00, 0x00,
3981 0xFB, 0xFF, 0x95, 0x00, 0xC9, 0x00, 0xB1, 0xFD, 0x65, 0xFB, 0x80,
3982 0x04, 0x90, 0x17, 0x88, 0x21, 0x8F, 0x16, 0xA2, 0x03, 0x4E, 0xFB,
3983 0xED, 0xFD, 0xD9, 0x00, 0x88, 0x00, 0xF9, 0xFF, 0xFF, 0xFF, 0x05,
3984 0x00, 0xBD, 0x00, 0x82, 0x00, 0xEF, 0xFC, 0xF0, 0xFB, 0x8A, 0x07,
3985 0x9C, 0x1A, 0x0D, 0x21, 0x24, 0x13, 0x18, 0x01, 0x43, 0xFB, 0xAC,
3986 0xFE, 0xF7, 0x00, 0x60, 0x00, 0xF7, 0xFF, 0xFC, 0xFF, 0x17, 0x00,
3987 0xE0, 0x00, 0x1A, 0x00, 0x3D, 0xFC, 0xED, 0xFC, 0xDD, 0x0A, 0x38,
3988 0x1D, 0xDB, 0x1F, 0x99, 0x0F, 0xFF, 0xFE, 0x86, 0xFB, 0x5A, 0xFF,
3989 0xFA, 0x00, 0x3C, 0x00, 0xF8, 0xFF, 0xF9, 0xFF, 0x31, 0x00, 0xF6,
3990 0x00, 0x90, 0xFF, 0xAD, 0xFB, 0x62, 0xFE, 0x5D, 0x0E, 0x49, 0x1F,
3991 0x01, 0x1E, 0x10, 0x0C, 0x60, 0xFD, 0x06, 0xFC, 0xEE, 0xFF, 0xE9,
3992 0x00, 0x1F, 0x00, 0xFB, 0xFF, 0xF7, 0xFF, 0x53, 0x00, 0xFB, 0x00,
3993 0xEB, 0xFE, 0x52, 0xFB, 0x51, 0x00, 0xEC, 0x11, 0xB7, 0x20, 0x91,
3994 0x1B, 0xA9, 0x08, 0x3B, 0xFC, 0xAE, 0xFC, 0x62, 0x00, 0xCA, 0x00,
3995 0x0B, 0x00, 0xFE, 0xFF, 0xF8, 0xFF, 0x7A, 0x00, 0xE6, 0x00, 0x30,
3996 0xFE, 0x40, 0xFB, 0xB5, 0x02, 0x66, 0x15, 0x73, 0x21, 0xA9, 0x18,
3997 0x83, 0x05, 0x89, 0xFB, 0x6D, 0xFD, 0xB4, 0x00, 0xA3, 0x00, 0xFE,
3998 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xA3, 0x00, 0xB4, 0x00,
3999 0x6D, 0xFD, 0x89, 0xFB, 0x83, 0x05, 0xA9, 0x18, 0x73, 0x21, 0x66,
4000 0x15, 0xB5, 0x02, 0x40, 0xFB, 0x30, 0xFE, 0xE6, 0x00, 0x7A, 0x00,
4001 0xF8, 0xFF, 0xFE, 0xFF, 0x0B, 0x00, 0xCA, 0x00, 0x62, 0x00, 0xAE,
4002 0xFC, 0x3B, 0xFC, 0xA9, 0x08, 0x91, 0x1B, 0xB7, 0x20, 0xEC, 0x11,
4003 0x51, 0x00, 0x52, 0xFB, 0xEB, 0xFE, 0xFB, 0x00, 0x53, 0x00, 0xF7,
4004 0xFF, 0xFB, 0xFF, 0x1F, 0x00, 0xE9, 0x00, 0xEE, 0xFF, 0x06, 0xFC,
4005 0x60, 0xFD, 0x10, 0x0C, 0x01, 0x1E, 0x49, 0x1F, 0x5D, 0x0E, 0x62,
4006 0xFE, 0xAD, 0xFB, 0x90, 0xFF, 0xF6, 0x00, 0x31, 0x00, 0xF9, 0xFF,
4007 0xF8, 0xFF, 0x3C, 0x00, 0xFA, 0x00, 0x5A, 0xFF, 0x86, 0xFB, 0xFF,
4008 0xFE, 0x99, 0x0F, 0xDB, 0x1F, 0x38, 0x1D, 0xDD, 0x0A, 0xED, 0xFC,
4009 0x3D, 0xFC, 0x1A, 0x00, 0xE0, 0x00, 0x17, 0x00, 0xFC, 0xFF, 0xF7,
4010 0xFF, 0x60, 0x00, 0xF7, 0x00, 0xAC, 0xFE, 0x43, 0xFB, 0x18, 0x01,
4011 0x24, 0x13, 0x0D, 0x21, 0x9C, 0x1A, 0x8A, 0x07, 0xF0, 0xFB, 0xEF,
4012 0xFC, 0x82, 0x00, 0xBD, 0x00, 0x05, 0x00, 0xFF, 0xFF, 0xF9, 0xFF,
4013 0x88, 0x00, 0xD9, 0x00, 0xED, 0xFD, 0x4E, 0xFB, 0xA2, 0x03, 0x8F,
4014 0x16, 0x88, 0x21, 0x90, 0x17, 0x80, 0x04, 0x65, 0xFB, 0xB1, 0xFD,
4015 0xC9, 0x00, 0x95, 0x00, 0xFB, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x02,
4016 0x00, 0xB1, 0x00, 0x9C, 0x00, 0x29, 0xFD, 0xBA, 0xFB, 0x91, 0x06,
4017 0xB6, 0x19, 0x47, 0x21, 0x36, 0x14, 0xD4, 0x01, 0x3D, 0xFB, 0x72,
4018 0xFE, 0xF0, 0x00, 0x6C, 0x00, 0xF7, 0xFF, 0xFD, 0xFF, 0x11, 0x00,
4019 0xD6, 0x00, 0x3D, 0x00, 0x71, 0xFC, 0x93, 0xFC, 0xD1, 0x09, 0x78,
4020 0x1C, 0x4C, 0x20, 0xB1, 0x10, 0x98, 0xFF, 0x6A, 0xFB, 0x27, 0xFF,
4021 0xFC, 0x00, 0x46, 0x00, 0xF7, 0xFF, 0xFA, 0xFF, 0x28, 0x00, 0xF1,
4022 0x00, 0xBE, 0xFF, 0xD4, 0xFB, 0xE2, 0xFD, 0x46, 0x0D, 0xB7, 0x1E,
4023 0xA3, 0x1E, 0x24, 0x0D, 0xD3, 0xFD, 0xD9, 0xFB, 0xC3, 0xFF, 0xF0,
4024 0x00, 0x27, 0x00, 0xFA, 0xFF, 0xF7, 0xFF, 0x48, 0x00, 0xFC, 0x00,
4025 0x20, 0xFF, 0x67, 0xFB, 0xAC, 0xFF, 0xD4, 0x10, 0x59, 0x20, 0x5F,
4026 0x1C, 0xAF, 0x09, 0x88, 0xFC, 0x77, 0xFC, 0x42, 0x00, 0xD5, 0x00,
4027 0x10, 0x00, 0xFD, 0xFF, 0xF7, 0xFF, 0x6D, 0x00, 0xEF, 0x00, 0x6B,
4028 0xFE, 0x3D, 0xFB, 0xED, 0x01, 0x59, 0x14, 0x4D, 0x21, 0x99, 0x19,
4029 0x73, 0x06, 0xB4, 0xFB, 0x31, 0xFD, 0x9F, 0x00, 0xB0, 0x00, 0x01,
4030 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFB, 0xFF, 0x96, 0x00, 0xC7, 0x00,
4031 0xA9, 0xFD, 0x68, 0xFB, 0x9C, 0x04, 0xB0, 0x17, 0x86, 0x21, 0x6E,
4032 0x16, 0x87, 0x03, 0x4C, 0xFB, 0xF5, 0xFD, 0xDA, 0x00, 0x86, 0x00,
4033 0xF9, 0xFF, 0xFF, 0xFF, 0x06, 0x00, 0xBF, 0x00, 0x7F, 0x00, 0xE7,
4034 0xFC, 0xF8, 0xFB, 0xA9, 0x07, 0xB8, 0x1A, 0x04, 0x21, 0x02, 0x13,
4035 0x01, 0x01, 0x44, 0xFB, 0xB3, 0xFE, 0xF7, 0x00, 0x5E, 0x00, 0xF7,
4036 0xFF, 0xFC, 0xFF, 0x18, 0x00, 0xE1, 0x00, 0x15, 0x00, 0x36, 0xFC,
4037 0xF9, 0xFC, 0xFF, 0x0A, 0x4F, 0x1D, 0xCC, 0x1F, 0x76, 0x0F, 0xED,
4038 0xFE, 0x8A, 0xFB, 0x60, 0xFF, 0xFA, 0x00, 0x3B, 0x00, 0xF8, 0xFF,
4039 0xF9, 0xFF, 0x32, 0x00, 0xF7, 0x00, 0x8A, 0xFF, 0xA8, 0xFB, 0x73,
4040 0xFE, 0x80, 0x0E, 0x5A, 0x1F, 0xEB, 0x1D, 0xED, 0x0B, 0x53, 0xFD,
4041 0x0C, 0xFC, 0xF3, 0xFF, 0xE8, 0x00, 0x1E, 0x00, 0xFB, 0xFF, 0xF7,
4042 0xFF, 0x54, 0x00, 0xFA, 0x00, 0xE4, 0xFE, 0x50, 0xFB, 0x66, 0x00,
4043 0x0F, 0x12, 0xC2, 0x20, 0x77, 0x1B, 0x89, 0x08, 0x32, 0xFC, 0xB5,
4044 0xFC, 0x66, 0x00, 0xC9, 0x00, 0x0A, 0x00, 0xFE, 0xFF, 0xF8, 0xFF,
4045 0x7B, 0x00, 0xE5, 0x00, 0x29, 0xFE, 0x41, 0xFB, 0xCF, 0x02, 0x87,
4046 0x15, 0x76, 0x21, 0x8A, 0x18, 0x66, 0x05, 0x84, 0xFB, 0x74, 0xFD,
4047 0xB7, 0x00, 0xA2, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFE,
4048 0xFF, 0xA5, 0x00, 0xB2, 0x00, 0x65, 0xFD, 0x8E, 0xFB, 0xA1, 0x05,
4049 0xC7, 0x18, 0x6F, 0x21, 0x45, 0x15, 0x9B, 0x02, 0x40, 0xFB, 0x38,
4050 0xFE, 0xE7, 0x00, 0x78, 0x00, 0xF8, 0xFF, 0xFE, 0xFF, 0x0B, 0x00,
4051 0xCC, 0x00, 0x5E, 0x00, 0xA7, 0xFC, 0x44, 0xFC, 0xCA, 0x08, 0xAC,
4052 0x1B, 0xAD, 0x20, 0xC9, 0x11, 0x3B, 0x00, 0x54, 0xFB, 0xF1, 0xFE,
4053 0xFB, 0x00, 0x51, 0x00, 0xF7, 0xFF, 0xFB, 0xFF, 0x20, 0x00, 0xEA,
4054 0x00, 0xE8, 0xFF, 0x00, 0xFC, 0x6E, 0xFD, 0x32, 0x0C, 0x16, 0x1E,
4055 0x38, 0x1F, 0x3A, 0x0E, 0x51, 0xFE, 0xB1, 0xFB, 0x96, 0xFF, 0xF6,
4056 0x00, 0x30, 0x00, 0xF9, 0xFF, 0xF8, 0xFF, 0x3D, 0x00, 0xFA, 0x00,
4057 0x54, 0xFF, 0x82, 0xFB, 0x12, 0xFF, 0xBC, 0x0F, 0xEA, 0x1F, 0x21,
4058 0x1D, 0xBB, 0x0A, 0xE1, 0xFC, 0x43, 0xFC, 0x1E, 0x00, 0xDF, 0x00,
4059 0x16, 0x00, 0xFC, 0xFF, 0xF7, 0xFF, 0x61, 0x00, 0xF6, 0x00, 0xA5,
4060 0xFE, 0x42, 0xFB, 0x2F, 0x01, 0x47, 0x13, 0x15, 0x21, 0x80, 0x1A,
4061 0x6A, 0x07, 0xE9, 0xFB, 0xF6, 0xFC, 0x86, 0x00, 0xBC, 0x00, 0x05,
4062 0x00, 0xFF, 0xFF, 0xFA, 0xFF, 0x8A, 0x00, 0xD7, 0x00, 0xE6, 0xFD,
4063 0x51, 0xFB, 0xBD, 0x03, 0xB0, 0x16, 0x89, 0x21, 0x71, 0x17, 0x63,
4064 0x04, 0x61, 0xFB, 0xB8, 0xFD, 0xCB, 0x00, 0x93, 0x00, 0xFB, 0xFF,
4065 0x00, 0x00, 0xFF, 0xFF, 0x02, 0x00, 0xB3, 0x00, 0x99, 0x00, 0x22,
4066 0xFD, 0xC0, 0xFB, 0xB0, 0x06, 0xD4, 0x19, 0x41, 0x21, 0x14, 0x14,
4067 0xBC, 0x01, 0x3D, 0xFB, 0x7A, 0xFE, 0xF1, 0x00, 0x6A, 0x00, 0xF7,
4068 0xFF, 0xFD, 0xFF, 0x12, 0x00, 0xD7, 0x00, 0x39, 0x00, 0x6A, 0xFC,
4069 0x9D, 0xFC, 0xF2, 0x09, 0x91, 0x1C, 0x3F, 0x20, 0x8E, 0x10, 0x84,
4070 0xFF, 0x6D, 0xFB, 0x2D, 0xFF, 0xFC, 0x00, 0x45, 0x00, 0xF7, 0xFF,
4071 0xFA, 0xFF, 0x29, 0x00, 0xF2, 0x00, 0xB8, 0xFF, 0xCF, 0xFB, 0xF1,
4072 0xFD, 0x69, 0x0D, 0xCA, 0x1E, 0x90, 0x1E, 0x01, 0x0D, 0xC4, 0xFD,
4073 0xDF, 0xFB, 0xC9, 0xFF, 0xF0, 0x00, 0x26, 0x00, 0xFA, 0xFF, 0xF7,
4074 0xFF, 0x49, 0x00, 0xFC, 0x00, 0x1A, 0xFF, 0x64, 0xFB, 0xC0, 0xFF,
4075 0xF7, 0x10, 0x66, 0x20, 0x46, 0x1C, 0x8E, 0x09, 0x7E, 0xFC, 0x7E,
4076 0xFC, 0x46, 0x00, 0xD4, 0x00, 0x0F, 0x00, 0xFD, 0xFF, 0xF7, 0xFF,
4077 0x6F, 0x00, 0xEE, 0x00, 0x64, 0xFE, 0x3D, 0xFB, 0x05, 0x02, 0x7B,
4078 0x14, 0x53, 0x21, 0x7C, 0x19, 0x54, 0x06, 0xAE, 0xFB, 0x38, 0xFD,
4079 0xA1, 0x00, 0xAE, 0x00, 0x01, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFC,
4080 0xFF, 0x98, 0x00, 0xC5, 0x00, 0xA2, 0xFD, 0x6C, 0xFB, 0xB8, 0x04,
4081 0xCF, 0x17, 0x85, 0x21, 0x4E, 0x16, 0x6C, 0x03, 0x4A, 0xFB, 0xFC,
4082 0xFD, 0xDC, 0x00, 0x85, 0x00, 0xF9, 0xFF, 0xFF, 0xFF, 0x07, 0x00,
4083 0xC0, 0x00, 0x7B, 0x00, 0xE0, 0xFC, 0x00, 0xFC, 0xC9, 0x07, 0xD3,
4084 0x1A, 0xFC, 0x20, 0xDF, 0x12, 0xEA, 0x00, 0x46, 0xFB, 0xBA, 0xFE,
4085 0xF8, 0x00, 0x5D, 0x00, 0xF7, 0xFF, 0xFC, 0xFF, 0x19, 0x00, 0xE2,
4086 0x00, 0x10, 0x00, 0x30, 0xFC, 0x05, 0xFD, 0x21, 0x0B, 0x66, 0x1D,
4087 0xBD, 0x1F, 0x53, 0x0F, 0xDB, 0xFE, 0x8E, 0xFB, 0x66, 0xFF, 0xFA,
4088 0x00, 0x3A, 0x00, 0xF8, 0xFF, 0xF9, 0xFF, 0x34, 0x00, 0xF7, 0x00,
4089 0x84, 0xFF, 0xA4, 0xFB, 0x84, 0xFE, 0xA3, 0x0E, 0x6C, 0x1F, 0xD6,
4090 0x1D, 0xCB, 0x0B, 0x45, 0xFD, 0x12, 0xFC, 0xF8, 0xFF, 0xE7, 0x00,
4091 0x1D, 0x00, 0xFB, 0xFF, 0xF7, 0xFF, 0x56, 0x00, 0xFA, 0x00, 0xDD,
4092 0xFE, 0x4E, 0xFB, 0x7C, 0x00, 0x32, 0x12, 0xCC, 0x20, 0x5C, 0x1B,
4093 0x69, 0x08, 0x29, 0xFC, 0xBC, 0xFC, 0x69, 0x00, 0xC7, 0x00, 0x09,
4094 0x00, 0xFE, 0xFF, 0xF8, 0xFF, 0x7D, 0x00, 0xE3, 0x00, 0x21, 0xFE,
4095 0x43, 0xFB, 0xE9, 0x02, 0xA9, 0x15, 0x79, 0x21, 0x6B, 0x18, 0x48,
4096 0x05, 0x80, 0xFB, 0x7C, 0xFD, 0xB9, 0x00, 0xA0, 0x00, 0xFD, 0xFF,
4097 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xA6, 0x00, 0xAF, 0x00, 0x5E,
4098 0xFD, 0x93, 0xFB, 0xBE, 0x05, 0xE5, 0x18, 0x6B, 0x21, 0x23, 0x15,
4099 0x82, 0x02, 0x3F, 0xFB, 0x3F, 0xFE, 0xE9, 0x00, 0x77, 0x00, 0xF8,
4100 0xFF, 0xFE, 0xFF, 0x0C, 0x00, 0xCD, 0x00, 0x5A, 0x00, 0xA0, 0xFC,
4101 0x4D, 0xFC, 0xEA, 0x08, 0xC6, 0x1B, 0xA1, 0x20, 0xA6, 0x11, 0x26,
4102 0x00, 0x57, 0xFB, 0xF8, 0xFE, 0xFB, 0x00, 0x50, 0x00, 0xF7, 0xFF,
4103 0xFB, 0xFF, 0x21, 0x00, 0xEB, 0x00, 0xE3, 0xFF, 0xFA, 0xFB, 0x7C,
4104 0xFD, 0x54, 0x0C, 0x2B, 0x1E, 0x26, 0x1F, 0x17, 0x0E, 0x41, 0xFE,
4105 0xB6, 0xFB, 0x9C, 0xFF, 0xF5, 0x00, 0x2F, 0x00, 0xF9, 0xFF, 0xF8,
4106 0xFF, 0x3F, 0x00, 0xFB, 0x00, 0x4D, 0xFF, 0x7F, 0xFB, 0x24, 0xFF,
4107 0xDF, 0x0F, 0xF9, 0x1F, 0x09, 0x1D, 0x99, 0x0A, 0xD5, 0xFC, 0x49,
4108 0xFC, 0x23, 0x00, 0xDD, 0x00, 0x16, 0x00, 0xFC, 0xFF, 0xF7, 0xFF,
4109 0x63, 0x00, 0xF5, 0x00, 0x9E, 0xFE, 0x41, 0xFB, 0x46, 0x01, 0x69,
4110 0x13, 0x1D, 0x21, 0x63, 0x1A, 0x4B, 0x07, 0xE2, 0xFB, 0xFD, 0xFC,
4111 0x89, 0x00, 0xBA, 0x00, 0x04, 0x00, 0xFF, 0xFF, 0xFA, 0xFF, 0x8B,
4112 0x00, 0xD5, 0x00, 0xDE, 0xFD, 0x53, 0xFB, 0xD9, 0x03, 0xD0, 0x16,
4113 0x8A, 0x21, 0x51, 0x17, 0x47, 0x04, 0x5E, 0xFB, 0xC0, 0xFD, 0xCD,
4114 0x00, 0x92, 0x00, 0xFB, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x02, 0x00,
4115 0xB4, 0x00, 0x96, 0x00, 0x1B, 0xFD, 0xC7, 0xFB, 0xCF, 0x06, 0xF0,
4116 0x19, 0x3A, 0x21, 0xF2, 0x13, 0xA4, 0x01, 0x3E, 0xFB, 0x81, 0xFE,
4117 0xF2, 0x00, 0x69, 0x00, 0xF7, 0xFF, 0xFD, 0xFF, 0x12, 0x00, 0xD9,
4118 0x00, 0x35, 0x00, 0x63, 0xFC, 0xA8, 0xFC, 0x13, 0x0A, 0xA9, 0x1C,
4119 0x32, 0x20, 0x6B, 0x10, 0x71, 0xFF, 0x71, 0xFB, 0x34, 0xFF, 0xFB,
4120 0x00, 0x44, 0x00, 0xF8, 0xFF, 0xFA, 0xFF, 0x2B, 0x00, 0xF3, 0x00,
4121 0xB3, 0xFF, 0xCA, 0xFB, 0x01, 0xFE, 0x8C, 0x0D, 0xDD, 0x1E, 0x7C,
4122 0x1E, 0xDE, 0x0C, 0xB5, 0xFD, 0xE4, 0xFB, 0xCE, 0xFF, 0xEF, 0x00,
4123 0x25, 0x00, 0xFA, 0xFF, 0xF7, 0xFF, 0x4A, 0x00, 0xFC, 0x00, 0x13,
4124 0xFF, 0x61, 0xFB, 0xD4, 0xFF, 0x1A, 0x11, 0x72, 0x20, 0x2D, 0x1C,
4125 0x6D, 0x09, 0x74, 0xFC, 0x85, 0xFC, 0x4A, 0x00, 0xD2, 0x00, 0x0F,
4126 0x00, 0xFD, 0xFF, 0xF7, 0xFF, 0x70, 0x00, 0xED, 0x00, 0x5D, 0xFE,
4127 0x3D, 0xFB, 0x1E, 0x02, 0x9C, 0x14, 0x58, 0x21, 0x5E, 0x19, 0x36,
4128 0x06, 0xA8, 0xFB, 0x40, 0xFD, 0xA4, 0x00, 0xAD, 0x00, 0x00, 0x00,
4129 0xFF, 0xFF, 0x00, 0x00, 0xFC, 0xFF, 0x9A, 0x00, 0xC3, 0x00, 0x9A,
4130 0xFD, 0x6F, 0xFB, 0xD5, 0x04, 0xEF, 0x17, 0x83, 0x21, 0x2D, 0x16,
4131 0x52, 0x03, 0x49, 0xFB, 0x04, 0xFE, 0xDD, 0x00, 0x83, 0x00, 0xF9,
4132 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0xC2, 0x00, 0x78, 0x00, 0xD9, 0xFC,
4133 0x08, 0xFC, 0xE9, 0x07, 0xEF, 0x1A, 0xF3, 0x20, 0xBC, 0x12, 0xD4,
4134 0x00, 0x47, 0xFB, 0xC1, 0xFE, 0xF8, 0x00, 0x5B, 0x00, 0xF7, 0xFF,
4135 0xFC, 0xFF, 0x1A, 0x00, 0xE3, 0x00, 0x0B, 0x00, 0x2A, 0xFC, 0x12,
4136 0xFD, 0x42, 0x0B, 0x7D, 0x1D, 0xAD, 0x1F, 0x2F, 0x0F, 0xC9, 0xFE,
4137 0x92, 0xFB, 0x6C, 0xFF, 0xF9, 0x00, 0x38, 0x00, 0xF8, 0xFF, 0xF9,
4138 0xFF, 0x35, 0x00, 0xF8, 0x00, 0x7E, 0xFF, 0x9F, 0xFB, 0x95, 0xFE,
4139 0xC6, 0x0E, 0x7C, 0x1F, 0xC0, 0x1D, 0xA9, 0x0B, 0x38, 0xFD, 0x18,
4140 0xFC, 0xFD, 0xFF, 0xE6, 0x00, 0x1D, 0x00, 0xFB, 0xFF, 0xF7, 0xFF,
4141 0x57, 0x00, 0xFA, 0x00, 0xD6, 0xFE, 0x4C, 0xFB, 0x92, 0x00, 0x54,
4142 0x12, 0xD6, 0x20, 0x41, 0x1B, 0x49, 0x08, 0x20, 0xFC, 0xC3, 0xFC,
4143 0x6D, 0x00, 0xC6, 0x00, 0x09, 0x00, 0xFE, 0xFF, 0xF8, 0xFF, 0x7E,
4144 0x00, 0xE2, 0x00, 0x1A, 0xFE, 0x44, 0xFB, 0x03, 0x03, 0xCA, 0x15,
4145 0x7C, 0x21, 0x4C, 0x18, 0x2B, 0x05, 0x7B, 0xFB, 0x83, 0xFD, 0xBC,
4146 0x00, 0x9E, 0x00, 0xFD, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
4147 0xA8, 0x00, 0xAD, 0x00, 0x56, 0xFD, 0x98, 0xFB, 0xDC, 0x05, 0x04,
4148 0x19, 0x66, 0x21, 0x02, 0x15, 0x69, 0x02, 0x3E, 0xFB, 0x47, 0xFE,
4149 0xEA, 0x00, 0x75, 0x00, 0xF8, 0xFF, 0xFE, 0xFF, 0x0D, 0x00, 0xCE,
4150 0x00, 0x56, 0x00, 0x99, 0xFC, 0x56, 0xFC, 0x0B, 0x09, 0xE0, 0x1B,
4151 0x96, 0x20, 0x83, 0x11, 0x11, 0x00, 0x59, 0xFB, 0xFF, 0xFE, 0xFB,
4152 0x00, 0x4E, 0x00, 0xF7, 0xFF, 0xFB, 0xFF, 0x22, 0x00, 0xEC, 0x00,
4153 0xDE, 0xFF, 0xF5, 0xFB, 0x8A, 0xFD, 0x77, 0x0C, 0x3F, 0x1E, 0x14,
4154 0x1F, 0xF5, 0x0D, 0x31, 0xFE, 0xBB, 0xFB, 0xA2, 0xFF, 0xF5, 0x00,
4155 0x2E, 0x00, 0xF9, 0xFF, 0xF8, 0xFF, 0x40, 0x00, 0xFB, 0x00, 0x47,
4156 0xFF, 0x7B, 0xFB, 0x37, 0xFF, 0x02, 0x10, 0x07, 0x20, 0xF2, 0x1C,
4157 0x78, 0x0A, 0xCA, 0xFC, 0x50, 0xFC, 0x27, 0x00, 0xDC, 0x00, 0x15,
4158 0x00, 0xFC, 0xFF, 0xF7, 0xFF, 0x64, 0x00, 0xF5, 0x00, 0x97, 0xFE,
4159 0x40, 0xFB, 0x5D, 0x01, 0x8B, 0x13, 0x25, 0x21, 0x47, 0x1A, 0x2C,
4160 0x07, 0xDB, 0xFB, 0x05, 0xFD, 0x8C, 0x00, 0xB9, 0x00, 0x04, 0x00,
4161 0xFF, 0xFF, 0xFA, 0xFF, 0x8D, 0x00, 0xD3, 0x00, 0xD6, 0xFD, 0x56,
4162 0xFB, 0xF4, 0x03, 0xF0, 0x16, 0x8A, 0x21, 0x31, 0x17, 0x2B, 0x04,
4163 0x5B, 0xFB, 0xC7, 0xFD, 0xCF, 0x00, 0x90, 0x00, 0xFA, 0xFF, 0x00,
4164 0x00, 0xFF, 0xFF, 0x03, 0x00, 0xB6, 0x00, 0x92, 0x00, 0x13, 0xFD,
4165 0xCD, 0xFB, 0xEE, 0x06, 0x0D, 0x1A, 0x33, 0x21, 0xD0, 0x13, 0x8C,
4166 0x01, 0x3E, 0xFB, 0x88, 0xFE, 0xF3, 0x00, 0x67, 0x00, 0xF7, 0xFF,
4167 0x06, 0x00, 0x1D, 0x00, 0x03, 0xFF, 0xFE, 0x00, 0xA1, 0x02, 0xA6,
4168 0xF8, 0x56, 0x02, 0xA5, 0x28, 0xA5, 0x28, 0x56, 0x02, 0xA6, 0xF8,
4169 0xA1, 0x02, 0xFE, 0x00, 0x03, 0xFF, 0x1D, 0x00, 0x06, 0x00, 0x00,
4170 0x00, 0x21, 0x00, 0xA6, 0xFF, 0x3F, 0xFF, 0x0B, 0x03, 0x42, 0xFE,
4171 0x3E, 0xF8, 0x7F, 0x15, 0xAC, 0x30, 0x7F, 0x15, 0x3E, 0xF8, 0x42,
4172 0xFE, 0x0B, 0x03, 0x3F, 0xFF, 0xA6, 0xFF, 0x21, 0x00, 0x00, 0x00,
4173 0xFA, 0xFF, 0xCE, 0xFF, 0x14, 0x01, 0x00, 0xFD, 0x35, 0x06, 0xD5,
4174 0xF4, 0xDA, 0x15, 0x92, 0x40, 0xAE, 0xFE, 0xF3, 0xFC, 0x68, 0x03,
4175 0x86, 0xFD, 0x51, 0x01, 0x8B, 0xFF, 0x11, 0x00, 0x01, 0x00, 0xEC,
4176 0xFF, 0xF9, 0xFF, 0xC6, 0x00, 0x55, 0xFD, 0x35, 0x06, 0x90, 0xF3,
4177 0xE5, 0x1C, 0x6B, 0x3D, 0x71, 0xFA, 0x34, 0xFF, 0x46, 0x02, 0xFF,
4178 0xFD, 0x2D, 0x01, 0x90, 0xFF, 0x10, 0x00, 0x03, 0x00, 0xDB, 0xFF,
4179 0x2D, 0x00, 0x60, 0x00, 0xE1, 0xFD, 0xCE, 0x05, 0xED, 0xF2, 0xF3,
4180 0x23, 0x20, 0x39, 0x22, 0xF7, 0x44, 0x01, 0x1F, 0x01, 0x89, 0xFE,
4181 0xFB, 0x00, 0x9C, 0xFF, 0x0D, 0x00, 0x06, 0x00, 0xC9, 0xFF, 0x68,
4182 0x00, 0xE5, 0xFF, 0xA0, 0xFE, 0xFB, 0x04, 0x0C, 0xF3, 0xC5, 0x2A,
4183 0xD8, 0x33, 0xC9, 0xF4, 0x0B, 0x03, 0x05, 0x00, 0x1A, 0xFF, 0xC1,
4184 0x00, 0xAD, 0xFF, 0x0A, 0x00, 0x09, 0x00, 0xB5, 0xFF, 0xA5, 0x00,
4185 0x5C, 0xFF, 0x8C, 0xFF, 0xBF, 0x03, 0x06, 0xF4, 0x22, 0x31, 0xC8,
4186 0x2D, 0x63, 0xF3, 0x76, 0x04, 0x08, 0xFF, 0xA7, 0xFF, 0x84, 0x00,
4187 0xC0, 0xFF, 0x07, 0x00, 0x0C, 0x00, 0xA4, 0xFF, 0xE1, 0x00, 0xCB,
4188 0xFE, 0x9B, 0x00, 0x21, 0x02, 0xEE, 0xF5, 0xCD, 0x36, 0x24, 0x27,
4189 0xE1, 0xF2, 0x7A, 0x05, 0x33, 0xFE, 0x2A, 0x00, 0x47, 0x00, 0xD3,
4190 0xFF, 0x04, 0x00, 0x0F, 0x00, 0x95, 0xFF, 0x17, 0x01, 0x3D, 0xFE,
4191 0xBD, 0x01, 0x30, 0x00, 0xCC, 0xF8, 0x92, 0x3B, 0x2A, 0x20, 0x2E,
4192 0xF3, 0x12, 0x06, 0x8F, 0xFD, 0x9A, 0x00, 0x10, 0x00, 0xE5, 0xFF,
4193 0x02, 0x00, 0x10, 0x00, 0x8C, 0xFF, 0x42, 0x01, 0xBB, 0xFD, 0xE4,
4194 0x02, 0x01, 0xFE, 0x9C, 0xFC, 0x45, 0x3F, 0x16, 0x19, 0x2D, 0xF4,
4195 0x41, 0x06, 0x21, 0xFD, 0xF3, 0x00, 0xE0, 0xFF, 0xF4, 0xFF, 0x01,
4196 0x00, 0x10, 0x00, 0x8B, 0xFF, 0x5D, 0x01, 0x4F, 0xFD, 0xFB, 0x03,
4197 0xB2, 0xFB, 0x53, 0x01, 0xC2, 0x41, 0x24, 0x12, 0xBA, 0xF5, 0x0F,
4198 0x06, 0xE9, 0xFC, 0x33, 0x01, 0xBB, 0xFF, 0x00, 0x00, 0x00, 0x00,
4199 0x0D, 0x00, 0x93, 0xFF, 0x63, 0x01, 0x04, 0xFD, 0xEF, 0x04, 0x62,
4200 0xF9, 0xD7, 0x06, 0xF2, 0x42, 0x8D, 0x0B, 0xB0, 0xF7, 0x87, 0x05,
4201 0xE6, 0xFC, 0x58, 0x01, 0xA0, 0xFF, 0x09, 0x00, 0x00, 0x00, 0x00,
4202 0x00, 0x07, 0x00, 0xA5, 0xFF, 0x52, 0x01, 0xE2, 0xFC, 0xAD, 0x05,
4203 0x35, 0xF7, 0x08, 0x0D, 0xCB, 0x42, 0x81, 0x05, 0xE8, 0xF9, 0xBB,
4204 0x04, 0x12, 0xFD, 0x64, 0x01, 0x90, 0xFF, 0x0E, 0x00, 0x00, 0x00,
4205 0xFE, 0xFF, 0xC2, 0xFF, 0x27, 0x01, 0xF1, 0xFC, 0x22, 0x06, 0x54,
4206 0xF5, 0xB8, 0x13, 0x4A, 0x41, 0x29, 0x00, 0x3C, 0xFC, 0xBD, 0x03,
4207 0x66, 0xFD, 0x58, 0x01, 0x8A, 0xFF, 0x11, 0x00, 0x01, 0x00, 0xF1,
4208 0xFF, 0xEB, 0xFF, 0xE1, 0x00, 0x35, 0xFD, 0x40, 0x06, 0xE4, 0xF3,
4209 0xB7, 0x1A, 0x85, 0x3E, 0xA6, 0xFB, 0x86, 0xFE, 0xA0, 0x02, 0xD7,
4210 0xFD, 0x39, 0x01, 0x8E, 0xFF, 0x10, 0x00, 0x03, 0x00, 0xE1, 0xFF,
4211 0x1C, 0x00, 0x82, 0x00, 0xB0, 0xFD, 0xF9, 0x05, 0x0C, 0xF3, 0xCB,
4212 0x21, 0x8F, 0x3A, 0x0D, 0xF8, 0xA9, 0x00, 0x79, 0x01, 0x5D, 0xFE,
4213 0x0B, 0x01, 0x98, 0xFF, 0x0E, 0x00, 0x05, 0x00, 0xCE, 0xFF, 0x55,
4214 0x00, 0x0D, 0x00, 0x60, 0xFE, 0x48, 0x05, 0xEC, 0xF2, 0xB6, 0x28,
4215 0x91, 0x35, 0x68, 0xF5, 0x88, 0x02, 0x5A, 0x00, 0xED, 0xFE, 0xD4,
4216 0x00, 0xA8, 0xFF, 0x0B, 0x00, 0x08, 0x00, 0xBB, 0xFF, 0x92, 0x00,
4217 0x87, 0xFF, 0x3F, 0xFF, 0x2B, 0x04, 0xA1, 0xF3, 0x3D, 0x2F, 0xB8,
4218 0x2F, 0xB8, 0xF3, 0x11, 0x04, 0x52, 0xFF, 0x7C, 0xFF, 0x97, 0x00,
4219 0xBA, 0xFF, 0x08, 0x00, 0x0B, 0x00, 0xA9, 0xFF, 0xCF, 0x00, 0xF8,
4220 0xFE, 0x44, 0x00, 0xAA, 0x02, 0x3E, 0xF5, 0x24, 0x35, 0x3B, 0x29,
4221 0xF2, 0xF2, 0x35, 0x05, 0x70, 0xFE, 0x03, 0x00, 0x5A, 0x00, 0xCD,
4222 0xFF, 0x05, 0x00, 0x0E, 0x00, 0x99, 0xFF, 0x07, 0x01, 0x68, 0xFE,
4223 0x63, 0x01, 0xD0, 0x00, 0xD0, 0xF7, 0x35, 0x3A, 0x55, 0x22, 0x02,
4224 0xF3, 0xEF, 0x05, 0xBC, 0xFD, 0x7A, 0x00, 0x20, 0x00, 0xDF, 0xFF,
4225 0x03, 0x00, 0x10, 0x00, 0x8E, 0xFF, 0x36, 0x01, 0xE1, 0xFD, 0x8A,
4226 0x02, 0xB2, 0xFE, 0x56, 0xFB, 0x40, 0x3E, 0x42, 0x1B, 0xCE, 0xF3,
4227 0x3E, 0x06, 0x3D, 0xFD, 0xDB, 0x00, 0xEE, 0xFF, 0xF0, 0xFF, 0x01,
4228 0x00, 0x11, 0x00, 0x8A, 0xFF, 0x57, 0x01, 0x6D, 0xFD, 0xA8, 0x03,
4229 0x69, 0xFC, 0xC8, 0xFF, 0x20, 0x41, 0x40, 0x14, 0x33, 0xF5, 0x28,
4230 0x06, 0xF5, 0xFC, 0x22, 0x01, 0xC5, 0xFF, 0xFD, 0xFF, 0x00, 0x00,
4231 0x0F, 0x00, 0x8F, 0xFF, 0x64, 0x01, 0x17, 0xFD, 0xA9, 0x04, 0x16,
4232 0xFA, 0x10, 0x05, 0xB8, 0x42, 0x87, 0x0D, 0x0D, 0xF7, 0xB9, 0x05,
4233 0xE2, 0xFC, 0x50, 0x01, 0xA7, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00,
4234 0x00, 0x0A, 0x00, 0x9E, 0xFF, 0x5A, 0x01, 0xE8, 0xFC, 0x7A, 0x05,
4235 0xDA, 0xF7, 0x10, 0x0B, 0xFB, 0x42, 0x4B, 0x07, 0x35, 0xF9, 0x00,
4236 0x05, 0x00, 0xFD, 0x63, 0x01, 0x94, 0xFF, 0x0D, 0x00, 0x00, 0x00,
4237 0x01, 0x00, 0xB8, 0xFF, 0x37, 0x01, 0xE7, 0xFC, 0x07, 0x06, 0xDE,
4238 0xF5, 0x9F, 0x11, 0xE4, 0x41, 0xB8, 0x01, 0x84, 0xFB, 0x0F, 0x04,
4239 0x48, 0xFD, 0x5E, 0x01, 0x8B, 0xFF, 0x10, 0x00, 0x01, 0x00, 0xF5,
4240 0xFF, 0xDD, 0xFF, 0xF9, 0x00, 0x1B, 0xFD, 0x41, 0x06, 0x47, 0xF4,
4241 0x8B, 0x18, 0x81, 0x3F, 0xF1, 0xFC, 0xD5, 0xFD, 0xFA, 0x02, 0xB2,
4242 0xFD, 0x45, 0x01, 0x8C, 0xFF, 0x11, 0x00, 0x02, 0x00, 0xE6, 0xFF,
4243 0x0C, 0x00, 0xA2, 0x00, 0x85, 0xFD, 0x1A, 0x06, 0x3C, 0xF3, 0x9F,
4244 0x1F, 0xE6, 0x3B, 0x0E, 0xF9, 0x07, 0x00, 0xD4, 0x01, 0x33, 0xFE,
4245 0x1B, 0x01, 0x94, 0xFF, 0x0F, 0x00, 0x04, 0x00, 0xD4, 0xFF, 0x43,
4246 0x00, 0x33, 0x00, 0x25, 0xFE, 0x89, 0x05, 0xE0, 0xF2, 0x9C, 0x26,
4247 0x33, 0x37, 0x1E, 0xF6, 0xFD, 0x01, 0xB0, 0x00, 0xC0, 0xFE, 0xE6,
4248 0x00, 0xA2, 0xFF, 0x0C, 0x00, 0x07, 0x00, 0xC1, 0xFF, 0x7F, 0x00,
4249 0xB2, 0xFF, 0xF6, 0xFE, 0x8E, 0x04, 0x51, 0xF3, 0x49, 0x2D, 0x98,
4250 0x31, 0x23, 0xF4, 0xA2, 0x03, 0xA0, 0xFF, 0x51, 0xFF, 0xAA, 0x00,
4251 0xB4, 0xFF, 0x09, 0x00, 0x0A, 0x00, 0xAE, 0xFF, 0xBD, 0x00, 0x25,
4252 0xFF, 0xF1, 0xFF, 0x2B, 0x03, 0xA5, 0xF4, 0x68, 0x33, 0x48, 0x2B,
4253 0x17, 0xF3, 0xE7, 0x04, 0xB1, 0xFE, 0xDB, 0xFF, 0x6C, 0x00, 0xC7,
4254 0xFF, 0x06, 0x00, 0x0D, 0x00, 0x9E, 0xFF, 0xF7, 0x00, 0x94, 0xFE,
4255 0x09, 0x01, 0x6A, 0x01, 0xEB, 0xF6, 0xC1, 0x38, 0x7D, 0x24, 0xE8,
4256 0xF2, 0xC1, 0x05, 0xEE, 0xFD, 0x57, 0x00, 0x31, 0x00, 0xDA, 0xFF,
4257 0x03, 0x00, 0x10, 0x00, 0x91, 0xFF, 0x29, 0x01, 0x09, 0xFE, 0x2F,
4258 0x02, 0x5F, 0xFF, 0x27, 0xFA, 0x20, 0x3D, 0x70, 0x1D, 0x7D, 0xF3,
4259 0x31, 0x06, 0x5E, 0xFD, 0xBF, 0x00, 0xFD, 0xFF, 0xEB, 0xFF, 0x02,
4260 0x00, 0x11, 0x00, 0x8B, 0xFF, 0x4E, 0x01, 0x8E, 0xFD, 0x52, 0x03,
4261 0x20, 0xFD, 0x52, 0xFE, 0x60, 0x40, 0x63, 0x16, 0xB7, 0xF4, 0x39,
4262 0x06, 0x05, 0xFD, 0x0F, 0x01, 0xD1, 0xFF, 0xF9, 0xFF, 0x00, 0x00,
4263 0x10, 0x00, 0x8D, 0xFF, 0x62, 0x01, 0x2E, 0xFD, 0x5E, 0x04, 0xCC,
4264 0xFA, 0x5B, 0x03, 0x5E, 0x42, 0x8E, 0x0F, 0x71, 0xF6, 0xE4, 0x05,
4265 0xE2, 0xFC, 0x45, 0x01, 0xAF, 0xFF, 0x04, 0x00, 0x00, 0x00, 0x00,
4266 0x00, 0x0B, 0x00, 0x99, 0xFF, 0x60, 0x01, 0xF2, 0xFC, 0x40, 0x05,
4267 0x85, 0xF8, 0x26, 0x09, 0x0C, 0x43, 0x26, 0x09, 0x85, 0xF8, 0x40,
4268 0x05, 0xF2, 0xFC, 0x60, 0x01, 0x99, 0xFF, 0x0B, 0x00, 0x00, 0x00,
4269 0x04, 0x00, 0xAF, 0xFF, 0x45, 0x01, 0xE2, 0xFC, 0xE4, 0x05, 0x71,
4270 0xF6, 0x8E, 0x0F, 0x5E, 0x42, 0x5B, 0x03, 0xCC, 0xFA, 0x5E, 0x04,
4271 0x2E, 0xFD, 0x62, 0x01, 0x8D, 0xFF, 0x10, 0x00, 0x00, 0x00, 0xF9,
4272 0xFF, 0xD1, 0xFF, 0x0F, 0x01, 0x05, 0xFD, 0x39, 0x06, 0xB7, 0xF4,
4273 0x63, 0x16, 0x60, 0x40, 0x52, 0xFE, 0x20, 0xFD, 0x52, 0x03, 0x8E,
4274 0xFD, 0x4E, 0x01, 0x8B, 0xFF, 0x11, 0x00, 0x02, 0x00, 0xEB, 0xFF,
4275 0xFD, 0xFF, 0xBF, 0x00, 0x5E, 0xFD, 0x31, 0x06, 0x7D, 0xF3, 0x70,
4276 0x1D, 0x20, 0x3D, 0x27, 0xFA, 0x5F, 0xFF, 0x2F, 0x02, 0x09, 0xFE,
4277 0x29, 0x01, 0x91, 0xFF, 0x10, 0x00, 0x03, 0x00, 0xDA, 0xFF, 0x31,
4278 0x00, 0x57, 0x00, 0xEE, 0xFD, 0xC1, 0x05, 0xE8, 0xF2, 0x7D, 0x24,
4279 0xC1, 0x38, 0xEB, 0xF6, 0x6A, 0x01, 0x09, 0x01, 0x94, 0xFE, 0xF7,
4280 0x00, 0x9E, 0xFF, 0x0D, 0x00, 0x06, 0x00, 0xC7, 0xFF, 0x6C, 0x00,
4281 0xDB, 0xFF, 0xB1, 0xFE, 0xE7, 0x04, 0x17, 0xF3, 0x48, 0x2B, 0x68,
4282 0x33, 0xA5, 0xF4, 0x2B, 0x03, 0xF1, 0xFF, 0x25, 0xFF, 0xBD, 0x00,
4283 0xAE, 0xFF, 0x0A, 0x00, 0x09, 0x00, 0xB4, 0xFF, 0xAA, 0x00, 0x51,
4284 0xFF, 0xA0, 0xFF, 0xA2, 0x03, 0x23, 0xF4, 0x98, 0x31, 0x49, 0x2D,
4285 0x51, 0xF3, 0x8E, 0x04, 0xF6, 0xFE, 0xB2, 0xFF, 0x7F, 0x00, 0xC1,
4286 0xFF, 0x07, 0x00, 0x0C, 0x00, 0xA2, 0xFF, 0xE6, 0x00, 0xC0, 0xFE,
4287 0xB0, 0x00, 0xFD, 0x01, 0x1E, 0xF6, 0x33, 0x37, 0x9C, 0x26, 0xE0,
4288 0xF2, 0x89, 0x05, 0x25, 0xFE, 0x33, 0x00, 0x43, 0x00, 0xD4, 0xFF,
4289 0x04, 0x00, 0x0F, 0x00, 0x94, 0xFF, 0x1B, 0x01, 0x33, 0xFE, 0xD4,
4290 0x01, 0x07, 0x00, 0x0E, 0xF9, 0xE6, 0x3B, 0x9F, 0x1F, 0x3C, 0xF3,
4291 0x1A, 0x06, 0x85, 0xFD, 0xA2, 0x00, 0x0C, 0x00, 0xE6, 0xFF, 0x02,
4292 0x00, 0x11, 0x00, 0x8C, 0xFF, 0x45, 0x01, 0xB2, 0xFD, 0xFA, 0x02,
4293 0xD5, 0xFD, 0xF1, 0xFC, 0x81, 0x3F, 0x8B, 0x18, 0x47, 0xF4, 0x41,
4294 0x06, 0x1B, 0xFD, 0xF9, 0x00, 0xDD, 0xFF, 0xF5, 0xFF, 0x01, 0x00,
4295 0x10, 0x00, 0x8B, 0xFF, 0x5E, 0x01, 0x48, 0xFD, 0x0F, 0x04, 0x84,
4296 0xFB, 0xB8, 0x01, 0xE4, 0x41, 0x9F, 0x11, 0xDE, 0xF5, 0x07, 0x06,
4297 0xE7, 0xFC, 0x37, 0x01, 0xB8, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x0D,
4298 0x00, 0x94, 0xFF, 0x63, 0x01, 0x00, 0xFD, 0x00, 0x05, 0x35, 0xF9,
4299 0x4B, 0x07, 0xFB, 0x42, 0x10, 0x0B, 0xDA, 0xF7, 0x7A, 0x05, 0xE8,
4300 0xFC, 0x5A, 0x01, 0x9E, 0xFF, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00,
4301 0x07, 0x00, 0xA7, 0xFF, 0x50, 0x01, 0xE2, 0xFC, 0xB9, 0x05, 0x0D,
4302 0xF7, 0x87, 0x0D, 0xB8, 0x42, 0x10, 0x05, 0x16, 0xFA, 0xA9, 0x04,
4303 0x17, 0xFD, 0x64, 0x01, 0x8F, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0xFD,
4304 0xFF, 0xC5, 0xFF, 0x22, 0x01, 0xF5, 0xFC, 0x28, 0x06, 0x33, 0xF5,
4305 0x40, 0x14, 0x20, 0x41, 0xC8, 0xFF, 0x69, 0xFC, 0xA8, 0x03, 0x6D,
4306 0xFD, 0x57, 0x01, 0x8A, 0xFF, 0x11, 0x00, 0x01, 0x00, 0xF0, 0xFF,
4307 0xEE, 0xFF, 0xDB, 0x00, 0x3D, 0xFD, 0x3E, 0x06, 0xCE, 0xF3, 0x42,
4308 0x1B, 0x40, 0x3E, 0x56, 0xFB, 0xB2, 0xFE, 0x8A, 0x02, 0xE1, 0xFD,
4309 0x36, 0x01, 0x8E, 0xFF, 0x10, 0x00, 0x03, 0x00, 0xDF, 0xFF, 0x20,
4310 0x00, 0x7A, 0x00, 0xBC, 0xFD, 0xEF, 0x05, 0x02, 0xF3, 0x55, 0x22,
4311 0x35, 0x3A, 0xD0, 0xF7, 0xD0, 0x00, 0x63, 0x01, 0x68, 0xFE, 0x07,
4312 0x01, 0x99, 0xFF, 0x0E, 0x00, 0x05, 0x00, 0xCD, 0xFF, 0x5A, 0x00,
4313 0x03, 0x00, 0x70, 0xFE, 0x35, 0x05, 0xF2, 0xF2, 0x3B, 0x29, 0x24,
4314 0x35, 0x3E, 0xF5, 0xAA, 0x02, 0x44, 0x00, 0xF8, 0xFE, 0xCF, 0x00,
4315 0xA9, 0xFF, 0x0B, 0x00, 0x08, 0x00, 0xBA, 0xFF, 0x97, 0x00, 0x7C,
4316 0xFF, 0x52, 0xFF, 0x11, 0x04, 0xB8, 0xF3, 0xB8, 0x2F, 0x3D, 0x2F,
4317 0xA1, 0xF3, 0x2B, 0x04, 0x3F, 0xFF, 0x87, 0xFF, 0x92, 0x00, 0xBB,
4318 0xFF, 0x08, 0x00, 0x0B, 0x00, 0xA8, 0xFF, 0xD4, 0x00, 0xED, 0xFE,
4319 0x5A, 0x00, 0x88, 0x02, 0x68, 0xF5, 0x91, 0x35, 0xB6, 0x28, 0xEC,
4320 0xF2, 0x48, 0x05, 0x60, 0xFE, 0x0D, 0x00, 0x55, 0x00, 0xCE, 0xFF,
4321 0x05, 0x00, 0x0E, 0x00, 0x98, 0xFF, 0x0B, 0x01, 0x5D, 0xFE, 0x79,
4322 0x01, 0xA9, 0x00, 0x0D, 0xF8, 0x8F, 0x3A, 0xCB, 0x21, 0x0C, 0xF3,
4323 0xF9, 0x05, 0xB0, 0xFD, 0x82, 0x00, 0x1C, 0x00, 0xE1, 0xFF, 0x03,
4324 0x00, 0x10, 0x00, 0x8E, 0xFF, 0x39, 0x01, 0xD7, 0xFD, 0xA0, 0x02,
4325 0x86, 0xFE, 0xA6, 0xFB, 0x85, 0x3E, 0xB7, 0x1A, 0xE4, 0xF3, 0x40,
4326 0x06, 0x35, 0xFD, 0xE1, 0x00, 0xEB, 0xFF, 0xF1, 0xFF, 0x01, 0x00,
4327 0x11, 0x00, 0x8A, 0xFF, 0x58, 0x01, 0x66, 0xFD, 0xBD, 0x03, 0x3C,
4328 0xFC, 0x29, 0x00, 0x4A, 0x41, 0xB8, 0x13, 0x54, 0xF5, 0x22, 0x06,
4329 0xF1, 0xFC, 0x27, 0x01, 0xC2, 0xFF, 0xFE, 0xFF, 0x00, 0x00, 0x0E,
4330 0x00, 0x90, 0xFF, 0x64, 0x01, 0x12, 0xFD, 0xBB, 0x04, 0xE8, 0xF9,
4331 0x81, 0x05, 0xCB, 0x42, 0x08, 0x0D, 0x35, 0xF7, 0xAD, 0x05, 0xE2,
4332 0xFC, 0x52, 0x01, 0xA5, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
4333 0x09, 0x00, 0xA0, 0xFF, 0x58, 0x01, 0xE6, 0xFC, 0x87, 0x05, 0xB0,
4334 0xF7, 0x8D, 0x0B, 0xF2, 0x42, 0xD7, 0x06, 0x62, 0xF9, 0xEF, 0x04,
4335 0x04, 0xFD, 0x63, 0x01, 0x93, 0xFF, 0x0D, 0x00, 0x00, 0x00, 0x00,
4336 0x00, 0xBB, 0xFF, 0x33, 0x01, 0xE9, 0xFC, 0x0F, 0x06, 0xBA, 0xF5,
4337 0x24, 0x12, 0xC2, 0x41, 0x53, 0x01, 0xB2, 0xFB, 0xFB, 0x03, 0x4F,
4338 0xFD, 0x5D, 0x01, 0x8B, 0xFF, 0x10, 0x00, 0x01, 0x00, 0xF4, 0xFF,
4339 0xE0, 0xFF, 0xF3, 0x00, 0x21, 0xFD, 0x41, 0x06, 0x2D, 0xF4, 0x16,
4340 0x19, 0x45, 0x3F, 0x9C, 0xFC, 0x01, 0xFE, 0xE4, 0x02, 0xBB, 0xFD,
4341 0x42, 0x01, 0x8C, 0xFF, 0x10, 0x00, 0x02, 0x00, 0xE5, 0xFF, 0x10,
4342 0x00, 0x9A, 0x00, 0x8F, 0xFD, 0x12, 0x06, 0x2E, 0xF3, 0x2A, 0x20,
4343 0x92, 0x3B, 0xCC, 0xF8, 0x30, 0x00, 0xBD, 0x01, 0x3D, 0xFE, 0x17,
4344 0x01, 0x95, 0xFF, 0x0F, 0x00, 0x04, 0x00, 0xD3, 0xFF, 0x47, 0x00,
4345 0x2A, 0x00, 0x33, 0xFE, 0x7A, 0x05, 0xE1, 0xF2, 0x24, 0x27, 0xCD,
4346 0x36, 0xEE, 0xF5, 0x21, 0x02, 0x9B, 0x00, 0xCB, 0xFE, 0xE1, 0x00,
4347 0xA4, 0xFF, 0x0C, 0x00, 0x07, 0x00, 0xC0, 0xFF, 0x84, 0x00, 0xA7,
4348 0xFF, 0x08, 0xFF, 0x76, 0x04, 0x63, 0xF3, 0xC8, 0x2D, 0x22, 0x31,
4349 0x06, 0xF4, 0xBF, 0x03, 0x8C, 0xFF, 0x5C, 0xFF, 0xA5, 0x00, 0xB5,
4350 0xFF, 0x09, 0x00, 0x0A, 0x00, 0xAD, 0xFF, 0xC1, 0x00, 0x1A, 0xFF,
4351 0x05, 0x00, 0x0B, 0x03, 0xC9, 0xF4, 0xD8, 0x33, 0xC5, 0x2A, 0x0C,
4352 0xF3, 0xFB, 0x04, 0xA0, 0xFE, 0xE5, 0xFF, 0x68, 0x00, 0xC9, 0xFF,
4353 0x06, 0x00, 0x0D, 0x00, 0x9C, 0xFF, 0xFB, 0x00, 0x89, 0xFE, 0x1F,
4354 0x01, 0x44, 0x01, 0x22, 0xF7, 0x20, 0x39, 0xF3, 0x23, 0xED, 0xF2,
4355 0xCE, 0x05, 0xE1, 0xFD, 0x60, 0x00, 0x2D, 0x00, 0xDB, 0xFF, 0x03,
4356 0x00, 0x10, 0x00, 0x90, 0xFF, 0x2D, 0x01, 0xFF, 0xFD, 0x46, 0x02,
4357 0x34, 0xFF, 0x71, 0xFA, 0x6B, 0x3D, 0xE5, 0x1C, 0x90, 0xF3, 0x35,
4358 0x06, 0x55, 0xFD, 0xC6, 0x00, 0xF9, 0xFF, 0xEC, 0xFF, 0x01, 0x00,
4359 0x11, 0x00, 0x8B, 0xFF, 0x51, 0x01, 0x86, 0xFD, 0x68, 0x03, 0xF3,
4360 0xFC, 0xAE, 0xFE, 0x92, 0x40, 0xDA, 0x15, 0xD5, 0xF4, 0x35, 0x06,
4361 0x00, 0xFD, 0x14, 0x01, 0xCE, 0xFF, 0xFA, 0xFF, 0x00, 0x00, 0x0F,
4362 0x00, 0x8D, 0xFF, 0x63, 0x01, 0x28, 0xFD, 0x71, 0x04, 0x9E, 0xFA,
4363 0xC7, 0x03, 0x79, 0x42, 0x0B, 0x0F, 0x97, 0xF6, 0xDA, 0x05, 0xE2,
4364 0xFC, 0x48, 0x01, 0xAD, 0xFF, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
4365 0x0B, 0x00, 0x9A, 0xFF, 0x5F, 0x01, 0xEF, 0xFC, 0x4F, 0x05, 0x5A,
4366 0xF8, 0x9F, 0x09, 0x0A, 0x43, 0xAE, 0x08, 0xB1, 0xF8, 0x30, 0x05,
4367 0xF5, 0xFC, 0x61, 0x01, 0x97, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x03,
4368 0x00, 0xB1, 0xFF, 0x41, 0x01, 0xE3, 0xFC, 0xED, 0x05, 0x4C, 0xF6,
4369 0x11, 0x10, 0x42, 0x42, 0xF1, 0x02, 0xFA, 0xFA, 0x4B, 0x04, 0x34,
4370 0xFD, 0x61, 0x01, 0x8C, 0xFF, 0x10, 0x00, 0x01, 0x00, 0xF8, 0xFF,
4371 0xD4, 0xFF, 0x0A, 0x01, 0x0A, 0xFD, 0x3C, 0x06, 0x9A, 0xF4, 0xED,
4372 0x16, 0x2A, 0x40, 0xF8, 0xFD, 0x4D, 0xFD, 0x3C, 0x03, 0x97, 0xFD,
4373 0x4C, 0x01, 0x8B, 0xFF, 0x11, 0x00, 0x02, 0x00, 0xEA, 0xFF, 0x00,
4374 0x00, 0xB8, 0x00, 0x67, 0xFD, 0x2C, 0x06, 0x6B, 0xF3, 0xFC, 0x1D,
4375 0xD3, 0x3C, 0xDF, 0xF9, 0x89, 0xFF, 0x18, 0x02, 0x13, 0xFE, 0x26,
4376 0x01, 0x92, 0xFF, 0x0F, 0x00, 0x04, 0x00, 0xD9, 0xFF, 0x36, 0x00,
4377 0x4E, 0x00, 0xFB, 0xFD, 0xB4, 0x05, 0xE4, 0xF2, 0x04, 0x25, 0x5F,
4378 0x38, 0xB6, 0xF6, 0x90, 0x01, 0xF3, 0x00, 0x9F, 0xFE, 0xF3, 0x00,
4379 0x9F, 0xFF, 0x0D, 0x00, 0x06, 0x00, 0xC6, 0xFF, 0x71, 0x00, 0xD1,
4380 0xFF, 0xC2, 0xFE, 0xD1, 0x04, 0x23, 0xF3, 0xC9, 0x2B, 0xF5, 0x32,
4381 0x83, 0xF4, 0x49, 0x03, 0xDC, 0xFF, 0x30, 0xFF, 0xB8, 0x00, 0xB0,
4382 0xFF, 0x0A, 0x00, 0x09, 0x00, 0xB3, 0xFF, 0xAE, 0x00, 0x46, 0xFF,
4383 0xB4, 0xFF, 0x85, 0x03, 0x42, 0xF4, 0x0E, 0x32, 0xCA, 0x2C, 0x41,
4384 0xF3, 0xA5, 0x04, 0xE4, 0xFE, 0xBC, 0xFF, 0x7A, 0x00, 0xC3, 0xFF,
4385 0x07, 0x00, 0x0D, 0x00, 0xA1, 0xFF, 0xEA, 0x00, 0xB5, 0xFE, 0xC6,
4386 0x00, 0xD9, 0x01, 0x4F, 0xF6, 0x99, 0x37, 0x16, 0x26, 0xE0, 0xF2,
4387 0x98, 0x05, 0x16, 0xFE, 0x3C, 0x00, 0x3F, 0x00, 0xD6, 0xFF, 0x04,
4388 0x00, 0x0F, 0x00, 0x93, 0xFF, 0x1F, 0x01, 0x28, 0xFE, 0xEB, 0x01,
4389 0xDD, 0xFF, 0x52, 0xF9, 0x36, 0x3C, 0x13, 0x1F, 0x4B, 0xF3, 0x20,
4390 0x06, 0x7B, 0xFD, 0xA9, 0x00, 0x08, 0x00, 0xE7, 0xFF, 0x02, 0x00,
4391 0x11, 0x00, 0x8C, 0xFF, 0x47, 0x01, 0xA9, 0xFD, 0x10, 0x03, 0xA8,
4392 0xFD, 0x47, 0xFD, 0xBB, 0x3F, 0x01, 0x18, 0x62, 0xF4, 0x40, 0x06,
4393 0x15, 0xFD, 0xFF, 0x00, 0xDA, 0xFF, 0xF6, 0xFF, 0x01, 0x00, 0x10,
4394 0x00, 0x8B, 0xFF, 0x5F, 0x01, 0x41, 0xFD, 0x23, 0x04, 0x56, 0xFB,
4395 0x1F, 0x02, 0x06, 0x42, 0x19, 0x11, 0x02, 0xF6, 0xFF, 0x05, 0xE5,
4396 0xFC, 0x3B, 0x01, 0xB6, 0xFF, 0x02, 0x00, 0x00, 0x00, 0x0D, 0x00,
4397 0x95, 0xFF, 0x62, 0x01, 0xFC, 0xFC, 0x10, 0x05, 0x09, 0xF9, 0xC1,
4398 0x07, 0x03, 0x43, 0x94, 0x0A, 0x05, 0xF8, 0x6C, 0x05, 0xEA, 0xFC,
4399 0x5C, 0x01, 0x9D, 0xFF, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06,
4400 0x00, 0xA9, 0xFF, 0x4D, 0x01, 0xE1, 0xFC, 0xC4, 0x05, 0xE6, 0xF6,
4401 0x08, 0x0E, 0xA5, 0x42, 0xA1, 0x04, 0x43, 0xFA, 0x97, 0x04, 0x1D,
4402 0xFD, 0x64, 0x01, 0x8F, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0xFC, 0xFF,
4403 0xC8, 0xFF, 0x1E, 0x01, 0xF8, 0xFC, 0x2D, 0x06, 0x13, 0xF5, 0xC8,
4404 0x14, 0xF2, 0x40, 0x69, 0xFF, 0x97, 0xFC, 0x92, 0x03, 0x75, 0xFD,
4405 0x55, 0x01, 0x8A, 0xFF, 0x11, 0x00, 0x01, 0x00, 0xEF, 0xFF, 0xF2,
4406 0xFF, 0xD4, 0x00, 0x45, 0xFD, 0x3B, 0x06, 0xB8, 0xF3, 0xCE, 0x1B,
4407 0xFB, 0x3D, 0x08, 0xFB, 0xDE, 0xFE, 0x73, 0x02, 0xEB, 0xFD, 0x33,
4408 0x01, 0x8F, 0xFF, 0x10, 0x00, 0x03, 0x00, 0xDE, 0xFF, 0x25, 0x00,
4409 0x71, 0x00, 0xC8, 0xFD, 0xE5, 0x05, 0xFA, 0xF2, 0xDF, 0x22, 0xDB,
4410 0x39, 0x94, 0xF7, 0xF7, 0x00, 0x4C, 0x01, 0x73, 0xFE, 0x03, 0x01,
4411 0x9A, 0xFF, 0x0E, 0x00, 0x05, 0x00, 0xCC, 0xFF, 0x5E, 0x00, 0xF9,
4412 0xFF, 0x80, 0xFE, 0x23, 0x05, 0xF9, 0xF2, 0xC0, 0x29, 0xB8, 0x34,
4413 0x16, 0xF5, 0xCB, 0x02, 0x2F, 0x00, 0x03, 0xFF, 0xCA, 0x00, 0xAA,
4414 0xFF, 0x0B, 0x00, 0x08, 0x00, 0xB8, 0xFF, 0x9B, 0x00, 0x72, 0xFF,
4415 0x65, 0xFF, 0xF6, 0x03, 0xD1, 0xF3, 0x31, 0x30, 0xC1, 0x2E, 0x8B,
4416 0xF3, 0x45, 0x04, 0x2D, 0xFF, 0x92, 0xFF, 0x8D, 0x00, 0xBD, 0xFF,
4417 0x08, 0x00, 0x0C, 0x00, 0xA6, 0xFF, 0xD8, 0x00, 0xE2, 0xFE, 0x6F,
4418 0x00, 0x66, 0x02, 0x93, 0xF5, 0xFB, 0x35, 0x31, 0x28, 0xE7, 0xF2,
4419 0x59, 0x05, 0x51, 0xFE, 0x17, 0x00, 0x50, 0x00, 0xD0, 0xFF, 0x05,
4420 0x00, 0x0E, 0x00, 0x97, 0xFF, 0x0F, 0x01, 0x53, 0xFE, 0x90, 0x01,
4421 0x81, 0x00, 0x4B, 0xF8, 0xE6, 0x3A, 0x3F, 0x21, 0x16, 0xF3, 0x02,
4422 0x06, 0xA5, 0xFD, 0x8A, 0x00, 0x18, 0x00, 0xE2, 0xFF, 0x02, 0x00,
4423 0x10, 0x00, 0x8D, 0xFF, 0x3C, 0x01, 0xCE, 0xFD, 0xB7, 0x02, 0x5A,
4424 0xFE, 0xF7, 0xFB, 0xC6, 0x3E, 0x2C, 0x1A, 0xFC, 0xF3, 0x41, 0x06,
4425 0x2E, 0xFD, 0xE7, 0x00, 0xE7, 0xFF, 0xF2, 0xFF, 0x01, 0x00, 0x10,
4426 0x00, 0x8B, 0xFF, 0x5A, 0x01, 0x5E, 0xFD, 0xD2, 0x03, 0x0E, 0xFC,
4427 0x8B, 0x00, 0x75, 0x41, 0x32, 0x13, 0x75, 0xF5, 0x1C, 0x06, 0xEE,
4428 0xFC, 0x2B, 0x01, 0xC0, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x0E, 0x00,
4429 0x91, 0xFF, 0x64, 0x01, 0x0D, 0xFD, 0xCD, 0x04, 0xBB, 0xF9, 0xF2,
4430 0x05, 0xD9, 0x42, 0x88, 0x0C, 0x5E, 0xF7, 0xA1, 0x05, 0xE3, 0xFC,
4431 0x54, 0x01, 0xA3, 0xFF, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
4432 0x00, 0xA2, 0xFF, 0x56, 0x01, 0xE5, 0xFC, 0x94, 0x05, 0x87, 0xF7,
4433 0x0A, 0x0C, 0xE6, 0x42, 0x64, 0x06, 0x8E, 0xF9, 0xDE, 0x04, 0x09,
4434 0xFD, 0x64, 0x01, 0x92, 0xFF, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00,
4435 0xBD, 0xFF, 0x2F, 0x01, 0xEC, 0xFC, 0x16, 0x06, 0x98, 0xF5, 0xAB,
4436 0x12, 0x9C, 0x41, 0xEE, 0x00, 0xE0, 0xFB, 0xE6, 0x03, 0x57, 0xFD,
4437 0x5B, 0x01, 0x8B, 0xFF, 0x10, 0x00, 0x01, 0x00, 0xF3, 0xFF, 0xE4,
4438 0xFF, 0xED, 0x00, 0x27, 0xFD, 0x41, 0x06, 0x14, 0xF4, 0xA1, 0x19,
4439 0x06, 0x3F, 0x49, 0xFC, 0x2E, 0xFE, 0xCD, 0x02, 0xC4, 0xFD, 0x3F,
4440 0x01, 0x8D, 0xFF, 0x10, 0x00, 0x02, 0x00, 0xE3, 0xFF, 0x14, 0x00,
4441 0x92, 0x00, 0x9A, 0xFD, 0x0A, 0x06, 0x22, 0xF3, 0xB4, 0x20, 0x3C,
4442 0x3B, 0x8B, 0xF8, 0x58, 0x00, 0xA7, 0x01, 0x48, 0xFE, 0x13, 0x01,
4443 0x96, 0xFF, 0x0F, 0x00, 0x04, 0x00, 0xD1, 0xFF, 0x4C, 0x00, 0x20,
4444 0x00, 0x42, 0xFE, 0x6A, 0x05, 0xE3, 0xF2, 0xAB, 0x27, 0x66, 0x36,
4445 0xC0, 0xF5, 0x44, 0x02, 0x85, 0x00, 0xD7, 0xFE, 0xDD, 0x00, 0xA5,
4446 0xFF, 0x0C, 0x00, 0x07, 0x00, 0xBE, 0xFF, 0x89, 0x00, 0x9D, 0xFF,
4447 0x1A, 0xFF, 0x5E, 0x04, 0x76, 0xF3, 0x45, 0x2E, 0xAA, 0x30, 0xEB,
4448 0xF3, 0xDB, 0x03, 0x79, 0xFF, 0x67, 0xFF, 0xA0, 0x00, 0xB7, 0xFF,
4449 0x09, 0x00, 0x0B, 0x00, 0xAC, 0xFF, 0xC6, 0x00, 0x0E, 0xFF, 0x1A,
4450 0x00, 0xEB, 0x02, 0xEF, 0xF4, 0x49, 0x34, 0x43, 0x2A, 0x02, 0xF3,
4451 0x0F, 0x05, 0x90, 0xFE, 0xEF, 0xFF, 0x63, 0x00, 0xCA, 0xFF, 0x06,
4452 0x00, 0x0E, 0x00, 0x9B, 0xFF, 0xFF, 0x00, 0x7E, 0xFE, 0x36, 0x01,
4453 0x1E, 0x01, 0x5B, 0xF7, 0x7E, 0x39, 0x69, 0x23, 0xF3, 0xF2, 0xD9,
4454 0x05, 0xD4, 0xFD, 0x69, 0x00, 0x29, 0x00, 0xDD, 0xFF, 0x03, 0x00,
4455 0x10, 0x00, 0x90, 0xFF, 0x30, 0x01, 0xF5, 0xFD, 0x5C, 0x02, 0x09,
4456 0xFF, 0xBC, 0xFA, 0xB5, 0x3D, 0x5A, 0x1C, 0xA3, 0xF3, 0x38, 0x06,
4457 0x4D, 0xFD, 0xCD, 0x00, 0xF5, 0xFF, 0xED, 0xFF, 0x01, 0x00, 0x11,
4458 0x00, 0x8B, 0xFF, 0x53, 0x01, 0x7E, 0xFD, 0x7D, 0x03, 0xC5, 0xFC,
4459 0x0B, 0xFF, 0xC3, 0x40, 0x51, 0x15, 0xF4, 0xF4, 0x31, 0x06, 0xFC,
4460 0xFC, 0x19, 0x01, 0xCB, 0xFF, 0xFB, 0xFF, 0x00, 0x00, 0x0F, 0x00,
4461 0x8E, 0xFF, 0x63, 0x01, 0x22, 0xFD, 0x84, 0x04, 0x71, 0xFA, 0x34,
4462 0x04, 0x90, 0x42, 0x89, 0x0E, 0xBE, 0xF6, 0xCF, 0x05, 0xE1, 0xFC,
4463 0x4A, 0x01, 0xAB, 0xFF, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B,
4464 0x00, 0x9B, 0xFF, 0x5D, 0x01, 0xEC, 0xFC, 0x5D, 0x05, 0x2F, 0xF8,
4465 0x19, 0x0A, 0x07, 0x43, 0x37, 0x08, 0xDD, 0xF8, 0x21, 0x05, 0xF8,
4466 0xFC, 0x62, 0x01, 0x96, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x03, 0x00,
4467 0xB4, 0xFF, 0x3E, 0x01, 0xE4, 0xFC, 0xF6, 0x05, 0x26, 0xF6, 0x95,
4468 0x10, 0x26, 0x42, 0x87, 0x02, 0x28, 0xFB, 0x37, 0x04, 0x3B, 0xFD,
4469 0x60, 0x01, 0x8C, 0xFF, 0x10, 0x00, 0x01, 0x00, 0xF7, 0xFF, 0xD7,
4470 0xFF, 0x04, 0x01, 0x0F, 0xFD, 0x3E, 0x06, 0x7D, 0xF4, 0x76, 0x17,
4471 0xF4, 0x3F, 0x9F, 0xFD, 0x7B, 0xFD, 0x26, 0x03, 0xA0, 0xFD, 0x4A,
4472 0x01, 0x8B, 0xFF, 0x11, 0x00, 0x02, 0x00, 0xE9, 0xFF, 0x04, 0x00,
4473 0xB1, 0x00, 0x71, 0xFD, 0x26, 0x06, 0x5A, 0xF3, 0x88, 0x1E, 0x87,
4474 0x3C, 0x98, 0xF9, 0xB3, 0xFF, 0x02, 0x02, 0x1E, 0xFE, 0x22, 0x01,
4475 0x93, 0xFF, 0x0F, 0x00, 0x04, 0x00, 0xD7, 0xFF, 0x3A, 0x00, 0x45,
4476 0x00, 0x09, 0xFE, 0xA7, 0x05, 0xE1, 0xF2, 0x8D, 0x25, 0xFD, 0x37,
4477 0x82, 0xF6, 0xB5, 0x01, 0xDC, 0x00, 0xAA, 0xFE, 0xEE, 0x00, 0xA0,
4478 0xFF, 0x0D, 0x00, 0x06, 0x00, 0xC4, 0xFF, 0x76, 0x00, 0xC7, 0xFF,
4479 0xD3, 0xFE, 0xBC, 0x04, 0x31, 0xF3, 0x4A, 0x2C, 0x83, 0x32, 0x61,
4480 0xF4, 0x68, 0x03, 0xC8, 0xFF, 0x3B, 0xFF, 0xB3, 0x00, 0xB1, 0xFF,
4481 0x0A, 0x00, 0x0A, 0x00, 0xB1, 0xFF, 0xB3, 0x00, 0x3B, 0xFF, 0xC8,
4482 0xFF, 0x68, 0x03, 0x61, 0xF4, 0x83, 0x32, 0x4A, 0x2C, 0x31, 0xF3,
4483 0xBC, 0x04, 0xD3, 0xFE, 0xC7, 0xFF, 0x76, 0x00, 0xC4, 0xFF, 0x06,
4484 0x00, 0x0D, 0x00, 0xA0, 0xFF, 0xEE, 0x00, 0xAA, 0xFE, 0xDC, 0x00,
4485 0xB5, 0x01, 0x82, 0xF6, 0xFD, 0x37, 0x8D, 0x25, 0xE1, 0xF2, 0xA7,
4486 0x05, 0x09, 0xFE, 0x45, 0x00, 0x3A, 0x00, 0xD7, 0xFF, 0x04, 0x00,
4487 0x0F, 0x00, 0x93, 0xFF, 0x22, 0x01, 0x1E, 0xFE, 0x02, 0x02, 0xB3,
4488 0xFF, 0x98, 0xF9, 0x87, 0x3C, 0x88, 0x1E, 0x5A, 0xF3, 0x26, 0x06,
4489 0x71, 0xFD, 0xB1, 0x00, 0x04, 0x00, 0xE9, 0xFF, 0x02, 0x00, 0x11,
4490 0x00, 0x8B, 0xFF, 0x4A, 0x01, 0xA0, 0xFD, 0x26, 0x03, 0x7B, 0xFD,
4491 0x9F, 0xFD, 0xF4, 0x3F, 0x76, 0x17, 0x7D, 0xF4, 0x3E, 0x06, 0x0F,
4492 0xFD, 0x04, 0x01, 0xD7, 0xFF, 0xF7, 0xFF, 0x01, 0x00, 0x10, 0x00,
4493 0x8C, 0xFF, 0x60, 0x01, 0x3B, 0xFD, 0x37, 0x04, 0x28, 0xFB, 0x87,
4494 0x02, 0x26, 0x42, 0x95, 0x10, 0x26, 0xF6, 0xF6, 0x05, 0xE4, 0xFC,
4495 0x3E, 0x01, 0xB4, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x96,
4496 0xFF, 0x62, 0x01, 0xF8, 0xFC, 0x21, 0x05, 0xDD, 0xF8, 0x37, 0x08,
4497 0x07, 0x43, 0x19, 0x0A, 0x2F, 0xF8, 0x5D, 0x05, 0xEC, 0xFC, 0x5D,
4498 0x01, 0x9B, 0xFF, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
4499 0xAB, 0xFF, 0x4A, 0x01, 0xE1, 0xFC, 0xCF, 0x05, 0xBE, 0xF6, 0x89,
4500 0x0E, 0x90, 0x42, 0x34, 0x04, 0x71, 0xFA, 0x84, 0x04, 0x22, 0xFD,
4501 0x63, 0x01, 0x8E, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0xFB, 0xFF, 0xCB,
4502 0xFF, 0x19, 0x01, 0xFC, 0xFC, 0x31, 0x06, 0xF4, 0xF4, 0x51, 0x15,
4503 0xC3, 0x40, 0x0B, 0xFF, 0xC5, 0xFC, 0x7D, 0x03, 0x7E, 0xFD, 0x53,
4504 0x01, 0x8B, 0xFF, 0x11, 0x00, 0x01, 0x00, 0xED, 0xFF, 0xF5, 0xFF,
4505 0xCD, 0x00, 0x4D, 0xFD, 0x38, 0x06, 0xA3, 0xF3, 0x5A, 0x1C, 0xB5,
4506 0x3D, 0xBC, 0xFA, 0x09, 0xFF, 0x5C, 0x02, 0xF5, 0xFD, 0x30, 0x01,
4507 0x90, 0xFF, 0x10, 0x00, 0x03, 0x00, 0xDD, 0xFF, 0x29, 0x00, 0x69,
4508 0x00, 0xD4, 0xFD, 0xD9, 0x05, 0xF3, 0xF2, 0x69, 0x23, 0x7E, 0x39,
4509 0x5B, 0xF7, 0x1E, 0x01, 0x36, 0x01, 0x7E, 0xFE, 0xFF, 0x00, 0x9B,
4510 0xFF, 0x0E, 0x00, 0x06, 0x00, 0xCA, 0xFF, 0x63, 0x00, 0xEF, 0xFF,
4511 0x90, 0xFE, 0x0F, 0x05, 0x02, 0xF3, 0x43, 0x2A, 0x49, 0x34, 0xEF,
4512 0xF4, 0xEB, 0x02, 0x1A, 0x00, 0x0E, 0xFF, 0xC6, 0x00, 0xAC, 0xFF,
4513 0x0B, 0x00, 0x09, 0x00, 0xB7, 0xFF, 0xA0, 0x00, 0x67, 0xFF, 0x79,
4514 0xFF, 0xDB, 0x03, 0xEB, 0xF3, 0xAA, 0x30, 0x45, 0x2E, 0x76, 0xF3,
4515 0x5E, 0x04, 0x1A, 0xFF, 0x9D, 0xFF, 0x89, 0x00, 0xBE, 0xFF, 0x07,
4516 0x00, 0x0C, 0x00, 0xA5, 0xFF, 0xDD, 0x00, 0xD7, 0xFE, 0x85, 0x00,
4517 0x44, 0x02, 0xC0, 0xF5, 0x66, 0x36, 0xAB, 0x27, 0xE3, 0xF2, 0x6A,
4518 0x05, 0x42, 0xFE, 0x20, 0x00, 0x4C, 0x00, 0xD1, 0xFF, 0x04, 0x00,
4519 0x0F, 0x00, 0x96, 0xFF, 0x13, 0x01, 0x48, 0xFE, 0xA7, 0x01, 0x58,
4520 0x00, 0x8B, 0xF8, 0x3C, 0x3B, 0xB4, 0x20, 0x22, 0xF3, 0x0A, 0x06,
4521 0x9A, 0xFD, 0x92, 0x00, 0x14, 0x00, 0xE3, 0xFF, 0x02, 0x00, 0x10,
4522 0x00, 0x8D, 0xFF, 0x3F, 0x01, 0xC4, 0xFD, 0xCD, 0x02, 0x2E, 0xFE,
4523 0x49, 0xFC, 0x06, 0x3F, 0xA1, 0x19, 0x14, 0xF4, 0x41, 0x06, 0x27,
4524 0xFD, 0xED, 0x00, 0xE4, 0xFF, 0xF3, 0xFF, 0x01, 0x00, 0x10, 0x00,
4525 0x8B, 0xFF, 0x5B, 0x01, 0x57, 0xFD, 0xE6, 0x03, 0xE0, 0xFB, 0xEE,
4526 0x00, 0x9C, 0x41, 0xAB, 0x12, 0x98, 0xF5, 0x16, 0x06, 0xEC, 0xFC,
4527 0x2F, 0x01, 0xBD, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x92,
4528 0xFF, 0x64, 0x01, 0x09, 0xFD, 0xDE, 0x04, 0x8E, 0xF9, 0x64, 0x06,
4529 0xE6, 0x42, 0x0A, 0x0C, 0x87, 0xF7, 0x94, 0x05, 0xE5, 0xFC, 0x56,
4530 0x01, 0xA2, 0xFF, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
4531 0xA3, 0xFF, 0x54, 0x01, 0xE3, 0xFC, 0xA1, 0x05, 0x5E, 0xF7, 0x88,
4532 0x0C, 0xD9, 0x42, 0xF2, 0x05, 0xBB, 0xF9, 0xCD, 0x04, 0x0D, 0xFD,
4533 0x64, 0x01, 0x91, 0xFF, 0x0E, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC0,
4534 0xFF, 0x2B, 0x01, 0xEE, 0xFC, 0x1C, 0x06, 0x75, 0xF5, 0x32, 0x13,
4535 0x75, 0x41, 0x8B, 0x00, 0x0E, 0xFC, 0xD2, 0x03, 0x5E, 0xFD, 0x5A,
4536 0x01, 0x8B, 0xFF, 0x10, 0x00, 0x01, 0x00, 0xF2, 0xFF, 0xE7, 0xFF,
4537 0xE7, 0x00, 0x2E, 0xFD, 0x41, 0x06, 0xFC, 0xF3, 0x2C, 0x1A, 0xC6,
4538 0x3E, 0xF7, 0xFB, 0x5A, 0xFE, 0xB7, 0x02, 0xCE, 0xFD, 0x3C, 0x01,
4539 0x8D, 0xFF, 0x10, 0x00, 0x02, 0x00, 0xE2, 0xFF, 0x18, 0x00, 0x8A,
4540 0x00, 0xA5, 0xFD, 0x02, 0x06, 0x16, 0xF3, 0x3F, 0x21, 0xE6, 0x3A,
4541 0x4B, 0xF8, 0x81, 0x00, 0x90, 0x01, 0x53, 0xFE, 0x0F, 0x01, 0x97,
4542 0xFF, 0x0E, 0x00, 0x05, 0x00, 0xD0, 0xFF, 0x50, 0x00, 0x17, 0x00,
4543 0x51, 0xFE, 0x59, 0x05, 0xE7, 0xF2, 0x31, 0x28, 0xFB, 0x35, 0x93,
4544 0xF5, 0x66, 0x02, 0x6F, 0x00, 0xE2, 0xFE, 0xD8, 0x00, 0xA6, 0xFF,
4545 0x0C, 0x00, 0x08, 0x00, 0xBD, 0xFF, 0x8D, 0x00, 0x92, 0xFF, 0x2D,
4546 0xFF, 0x45, 0x04, 0x8B, 0xF3, 0xC1, 0x2E, 0x31, 0x30, 0xD1, 0xF3,
4547 0xF6, 0x03, 0x65, 0xFF, 0x72, 0xFF, 0x9B, 0x00, 0xB8, 0xFF, 0x08,
4548 0x00, 0x0B, 0x00, 0xAA, 0xFF, 0xCA, 0x00, 0x03, 0xFF, 0x2F, 0x00,
4549 0xCB, 0x02, 0x16, 0xF5, 0xB8, 0x34, 0xC0, 0x29, 0xF9, 0xF2, 0x23,
4550 0x05, 0x80, 0xFE, 0xF9, 0xFF, 0x5E, 0x00, 0xCC, 0xFF, 0x05, 0x00,
4551 0x0E, 0x00, 0x9A, 0xFF, 0x03, 0x01, 0x73, 0xFE, 0x4C, 0x01, 0xF7,
4552 0x00, 0x94, 0xF7, 0xDB, 0x39, 0xDF, 0x22, 0xFA, 0xF2, 0xE5, 0x05,
4553 0xC8, 0xFD, 0x71, 0x00, 0x25, 0x00, 0xDE, 0xFF, 0x03, 0x00, 0x10,
4554 0x00, 0x8F, 0xFF, 0x33, 0x01, 0xEB, 0xFD, 0x73, 0x02, 0xDE, 0xFE,
4555 0x08, 0xFB, 0xFB, 0x3D, 0xCE, 0x1B, 0xB8, 0xF3, 0x3B, 0x06, 0x45,
4556 0xFD, 0xD4, 0x00, 0xF2, 0xFF, 0xEF, 0xFF, 0x01, 0x00, 0x11, 0x00,
4557 0x8A, 0xFF, 0x55, 0x01, 0x75, 0xFD, 0x92, 0x03, 0x97, 0xFC, 0x69,
4558 0xFF, 0xF2, 0x40, 0xC8, 0x14, 0x13, 0xF5, 0x2D, 0x06, 0xF8, 0xFC,
4559 0x1E, 0x01, 0xC8, 0xFF, 0xFC, 0xFF, 0x00, 0x00, 0x0F, 0x00, 0x8F,
4560 0xFF, 0x64, 0x01, 0x1D, 0xFD, 0x97, 0x04, 0x43, 0xFA, 0xA1, 0x04,
4561 0xA5, 0x42, 0x08, 0x0E, 0xE6, 0xF6, 0xC4, 0x05, 0xE1, 0xFC, 0x4D,
4562 0x01, 0xA9, 0xFF, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00,
4563 0x9D, 0xFF, 0x5C, 0x01, 0xEA, 0xFC, 0x6C, 0x05, 0x05, 0xF8, 0x94,
4564 0x0A, 0x03, 0x43, 0xC1, 0x07, 0x09, 0xF9, 0x10, 0x05, 0xFC, 0xFC,
4565 0x62, 0x01, 0x95, 0xFF, 0x0D, 0x00, 0x00, 0x00, 0x02, 0x00, 0xB6,
4566 0xFF, 0x3B, 0x01, 0xE5, 0xFC, 0xFF, 0x05, 0x02, 0xF6, 0x19, 0x11,
4567 0x06, 0x42, 0x1F, 0x02, 0x56, 0xFB, 0x23, 0x04, 0x41, 0xFD, 0x5F,
4568 0x01, 0x8B, 0xFF, 0x10, 0x00, 0x01, 0x00, 0xF6, 0xFF, 0xDA, 0xFF,
4569 0xFF, 0x00, 0x15, 0xFD, 0x40, 0x06, 0x62, 0xF4, 0x01, 0x18, 0xBB,
4570 0x3F, 0x47, 0xFD, 0xA8, 0xFD, 0x10, 0x03, 0xA9, 0xFD, 0x47, 0x01,
4571 0x8C, 0xFF, 0x11, 0x00, 0x02, 0x00, 0xE7, 0xFF, 0x08, 0x00, 0xA9,
4572 0x00, 0x7B, 0xFD, 0x20, 0x06, 0x4B, 0xF3, 0x13, 0x1F, 0x36, 0x3C,
4573 0x52, 0xF9, 0xDD, 0xFF, 0xEB, 0x01, 0x28, 0xFE, 0x1F, 0x01, 0x93,
4574 0xFF, 0x0F, 0x00, 0x04, 0x00, 0xD6, 0xFF, 0x3F, 0x00, 0x3C, 0x00,
4575 0x16, 0xFE, 0x98, 0x05, 0xE0, 0xF2, 0x16, 0x26, 0x99, 0x37, 0x4F,
4576 0xF6, 0xD9, 0x01, 0xC6, 0x00, 0xB5, 0xFE, 0xEA, 0x00, 0xA1, 0xFF,
4577 0x0D, 0x00, 0x07, 0x00, 0xC3, 0xFF, 0x7A, 0x00, 0xBC, 0xFF, 0xE4,
4578 0xFE, 0xA5, 0x04, 0x41, 0xF3, 0xCA, 0x2C, 0x0E, 0x32, 0x42, 0xF4,
4579 0x85, 0x03, 0xB4, 0xFF, 0x46, 0xFF, 0xAE, 0x00, 0xB3, 0xFF, 0x09,
4580 0x00, 0x0A, 0x00, 0xB0, 0xFF, 0xB8, 0x00, 0x30, 0xFF, 0xDC, 0xFF,
4581 0x49, 0x03, 0x83, 0xF4, 0xF5, 0x32, 0xC9, 0x2B, 0x23, 0xF3, 0xD1,
4582 0x04, 0xC2, 0xFE, 0xD1, 0xFF, 0x71, 0x00, 0xC6, 0xFF, 0x06, 0x00,
4583 0x0D, 0x00, 0x9F, 0xFF, 0xF3, 0x00, 0x9F, 0xFE, 0xF3, 0x00, 0x90,
4584 0x01, 0xB6, 0xF6, 0x5F, 0x38, 0x04, 0x25, 0xE4, 0xF2, 0xB4, 0x05,
4585 0xFB, 0xFD, 0x4E, 0x00, 0x36, 0x00, 0xD9, 0xFF, 0x04, 0x00, 0x0F,
4586 0x00, 0x92, 0xFF, 0x26, 0x01, 0x13, 0xFE, 0x18, 0x02, 0x89, 0xFF,
4587 0xDF, 0xF9, 0xD3, 0x3C, 0xFC, 0x1D, 0x6B, 0xF3, 0x2C, 0x06, 0x67,
4588 0xFD, 0xB8, 0x00, 0x00, 0x00, 0xEA, 0xFF, 0x02, 0x00, 0x11, 0x00,
4589 0x8B, 0xFF, 0x4C, 0x01, 0x97, 0xFD, 0x3C, 0x03, 0x4D, 0xFD, 0xF8,
4590 0xFD, 0x2A, 0x40, 0xED, 0x16, 0x9A, 0xF4, 0x3C, 0x06, 0x0A, 0xFD,
4591 0x0A, 0x01, 0xD4, 0xFF, 0xF8, 0xFF, 0x01, 0x00, 0x10, 0x00, 0x8C,
4592 0xFF, 0x61, 0x01, 0x34, 0xFD, 0x4B, 0x04, 0xFA, 0xFA, 0xF1, 0x02,
4593 0x42, 0x42, 0x11, 0x10, 0x4C, 0xF6, 0xED, 0x05, 0xE3, 0xFC, 0x41,
4594 0x01, 0xB1, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x97, 0xFF,
4595 0x61, 0x01, 0xF5, 0xFC, 0x30, 0x05, 0xB1, 0xF8, 0xAE, 0x08, 0x0A,
4596 0x43, 0x9F, 0x09, 0x5A, 0xF8, 0x4F, 0x05, 0xEF, 0xFC, 0x5F, 0x01,
4597 0x9A, 0xFF, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0xAD,
4598 0xFF, 0x48, 0x01, 0xE2, 0xFC, 0xDA, 0x05, 0x97, 0xF6, 0x0B, 0x0F,
4599 0x79, 0x42, 0xC7, 0x03, 0x9E, 0xFA, 0x71, 0x04, 0x28, 0xFD, 0x63,
4600 0x01, 0x8D, 0xFF, 0x0F, 0x00
4601};
4602
4603static u16
4604CoefficientSizes[] = {
4605 /* Playback */
4606 0x00C0, 0x5000, 0x0060, 0x2800, 0x0040, 0x0060, 0x1400, 0x0000,
4607 /* Record */
4608 0x0020, 0x1260, 0x0020, 0x1260, 0x0000, 0x0040, 0x1260, 0x0000,
4609};
4610
4611#ifndef JUST_DATA
4612
4613static u16
4614nm256_getStartOffset (u8 which)
4615{
4616 u16 offset = 0;
4617
4618 while (which-- > 0)
4619 offset += CoefficientSizes[which];
4620
4621 return offset;
4622}
4623
4624static void
4625nm256_loadOneCoefficient (struct nm256_info *card, int devnum, u32 port,
4626 u16 which)
4627{
4628 u32 coeffBuf = (which < 8) ? card->coeffBuf : card->allCoeffBuf;
4629 u16 offset = nm256_getStartOffset (which);
4630 u16 size = CoefficientSizes[which];
4631
4632 card->coeffsCurrent = 0;
4633
4634 if (nm256_debug)
4635 printk (KERN_INFO "NM256: Loading coefficient buffer 0x%x-0x%x with coefficient %d, size %d, port 0x%x\n",
4636 coeffBuf, coeffBuf + size - 1, which, size, port);
4637 nm256_writeBuffer8 (card, coefficients + offset, 1, coeffBuf, size);
4638 nm256_writePort32 (card, 2, port + 0, coeffBuf);
4639 /* ??? Record seems to behave differently than playback. */
4640 if (devnum == 0)
4641 size--;
4642 nm256_writePort32 (card, 2, port + 4, coeffBuf + size);
4643}
4644
4645static void
4646nm256_loadAllCoefficients (struct nm256_info *card)
4647{
4648 nm256_writeBuffer8 (card, coefficients, 1, card->allCoeffBuf,
4649 NM_TOTAL_COEFF_COUNT * 4);
4650 card->coeffsCurrent = 1;
4651}
4652
4653static void
4654nm256_loadCoefficient (struct nm256_info *card, int which, int number)
4655{
4656 static u16 addrs[3] = { 0x1c, 0x21c, 0x408 };
4657 /* The enable register for the specified engine. */
4658 u32 poffset = (which == 1 ? 0x200 : 1);
4659
4660 if (nm256_readPort8 (card, 2, poffset) & 1) {
4661 printk (KERN_ERR "NM256: Engine was enabled while loading coefficients!\n");
4662 return;
4663 }
4664
4665 /* The recording engine uses coefficient values 8-15. */
4666 if (which == 1)
4667 number += 8;
4668
4669 if (! nm256_cachedCoefficients (card))
4670 nm256_loadOneCoefficient (card, which, addrs[which], number);
4671 else {
4672 u32 base = card->allCoeffBuf;
4673 u32 offset = nm256_getStartOffset (number);
4674 u32 endOffset = offset + CoefficientSizes[number];
4675
4676 if (nm256_debug)
4677 printk (KERN_DEBUG "loading coefficient %d at port 0x%x, offset %d (0x%x-0x%x)\n",
4678 number, addrs[which], offset, base + offset,
4679 base + endOffset - 1);
4680
4681 if (! card->coeffsCurrent)
4682 nm256_loadAllCoefficients (card);
4683
4684 nm256_writePort32 (card, 2, addrs[which], base + offset);
4685 nm256_writePort32 (card, 2, addrs[which] + 4, base + endOffset - 1);
4686 }
4687}
4688
4689#endif /* JUST_DATA */
4690
4691#endif
4692
4693/*
4694 * Local variables:
4695 * c-basic-offset: 4
4696 * End:
4697 */
diff --git a/sound/oss/opl3.c b/sound/oss/opl3.c
index fc273e550944..7781c13c1476 100644
--- a/sound/oss/opl3.c
+++ b/sound/oss/opl3.c
@@ -34,7 +34,6 @@
34 34
35#include "sound_config.h" 35#include "sound_config.h"
36 36
37#include "opl3.h"
38#include "opl3_hw.h" 37#include "opl3_hw.h"
39 38
40#define MAX_VOICE 18 39#define MAX_VOICE 18
@@ -73,7 +72,6 @@ typedef struct opl_devinfo
73 unsigned char cmask; 72 unsigned char cmask;
74 73
75 int is_opl4; 74 int is_opl4;
76 int *osp;
77} opl_devinfo; 75} opl_devinfo;
78 76
79static struct opl_devinfo *devc = NULL; 77static struct opl_devinfo *devc = NULL;
@@ -144,7 +142,7 @@ static int opl3_ioctl(int dev, unsigned int cmd, void __user * arg)
144 } 142 }
145} 143}
146 144
147int opl3_detect(int ioaddr, int *osp) 145static int opl3_detect(int ioaddr)
148{ 146{
149 /* 147 /*
150 * This function returns 1 if the FM chip is present at the given I/O port 148 * This function returns 1 if the FM chip is present at the given I/O port
@@ -182,7 +180,6 @@ int opl3_detect(int ioaddr, int *osp)
182 goto cleanup_devc; 180 goto cleanup_devc;
183 } 181 }
184 182
185 devc->osp = osp;
186 devc->base = ioaddr; 183 devc->base = ioaddr;
187 184
188 /* Reset timers 1 and 2 */ 185 /* Reset timers 1 and 2 */
@@ -1105,7 +1102,7 @@ static struct synth_operations opl3_operations =
1105 .setup_voice = opl3_setup_voice 1102 .setup_voice = opl3_setup_voice
1106}; 1103};
1107 1104
1108int opl3_init(int ioaddr, int *osp, struct module *owner) 1105static int opl3_init(int ioaddr, struct module *owner)
1109{ 1106{
1110 int i; 1107 int i;
1111 int me; 1108 int me;
@@ -1194,9 +1191,6 @@ int opl3_init(int ioaddr, int *osp, struct module *owner)
1194 return me; 1191 return me;
1195} 1192}
1196 1193
1197EXPORT_SYMBOL(opl3_init);
1198EXPORT_SYMBOL(opl3_detect);
1199
1200static int me; 1194static int me;
1201 1195
1202static int io = -1; 1196static int io = -1;
@@ -1209,12 +1203,12 @@ static int __init init_opl3 (void)
1209 1203
1210 if (io != -1) /* User loading pure OPL3 module */ 1204 if (io != -1) /* User loading pure OPL3 module */
1211 { 1205 {
1212 if (!opl3_detect(io, NULL)) 1206 if (!opl3_detect(io))
1213 { 1207 {
1214 return -ENODEV; 1208 return -ENODEV;
1215 } 1209 }
1216 1210
1217 me = opl3_init(io, NULL, THIS_MODULE); 1211 me = opl3_init(io, THIS_MODULE);
1218 } 1212 }
1219 1213
1220 return 0; 1214 return 0;
diff --git a/sound/oss/opl3.h b/sound/oss/opl3.h
deleted file mode 100644
index 0bc9a4bcda13..000000000000
--- a/sound/oss/opl3.h
+++ /dev/null
@@ -1,5 +0,0 @@
1
2int opl3_detect (int ioaddr, int *osp);
3int opl3_init(int ioaddr, int *osp, struct module *owner);
4
5void enable_opl3_mode(int left, int right, int both);
diff --git a/sound/oss/opl3sa2.c b/sound/oss/opl3sa2.c
deleted file mode 100644
index e20051f1be4d..000000000000
--- a/sound/oss/opl3sa2.c
+++ /dev/null
@@ -1,1020 +0,0 @@
1/*
2 * sound/oss/opl3sa2.c
3 *
4 * A low level driver for Yamaha OPL3-SA2 and SA3 cards.
5 * NOTE: All traces of the name OPL3-SAx have now (December 2000) been
6 * removed from the driver code, as an email exchange with Yamaha
7 * provided the information that the YMF-719 is indeed just a
8 * re-badged 715.
9 *
10 * Copyright 1998-2001 Scott Murray <scott@spiteful.org>
11 *
12 * Originally based on the CS4232 driver (in cs4232.c) by Hannu Savolainen
13 * and others. Now incorporates code/ideas from pss.c, also by Hannu
14 * Savolainen. Both of those files are distributed with the following
15 * license:
16 *
17 * "Copyright (C) by Hannu Savolainen 1993-1997
18 *
19 * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
20 * Version 2 (June 1991). See the "COPYING" file distributed with this software
21 * for more info."
22 *
23 * As such, in accordance with the above license, this file, opl3sa2.c, is
24 * distributed under the GNU GENERAL PUBLIC LICENSE (GPL) Version 2 (June 1991).
25 * See the "COPYING" file distributed with this software for more information.
26 *
27 * Change History
28 * --------------
29 * Scott Murray Original driver (Jun 14, 1998)
30 * Paul J.Y. Lahaie Changed probing / attach code order
31 * Scott Murray Added mixer support (Dec 03, 1998)
32 * Scott Murray Changed detection code to be more forgiving,
33 * added force option as last resort,
34 * fixed ioctl return values. (Dec 30, 1998)
35 * Scott Murray Simpler detection code should work all the time now
36 * (with thanks to Ben Hutchings for the heuristic),
37 * removed now unnecessary force option. (Jan 5, 1999)
38 * Christoph Hellwig Adapted to module_init/module_exit (Mar 4, 2000)
39 * Scott Murray Reworked SA2 versus SA3 mixer code, updated chipset
40 * version detection code (again!). (Dec 5, 2000)
41 * Scott Murray Adjusted master volume mixer scaling. (Dec 6, 2000)
42 * Scott Murray Based on a patch by Joel Yliluoma (aka Bisqwit),
43 * integrated wide mixer and adjusted mic, bass, treble
44 * scaling. (Dec 6, 2000)
45 * Scott Murray Based on a patch by Peter Englmaier, integrated
46 * ymode and loopback options. (Dec 6, 2000)
47 * Scott Murray Inspired by a patch by Peter Englmaier, and based on
48 * what ALSA does, added initialization code for the
49 * default DMA and IRQ settings. (Dec 6, 2000)
50 * Scott Murray Added some more checks to the card detection code,
51 * based on what ALSA does. (Dec 12, 2000)
52 * Scott Murray Inspired by similar patches from John Fremlin,
53 * Jim Radford, Mike Rolig, and Ingmar Steen, added 2.4
54 * ISA PnP API support, mainly based on bits from
55 * sb_card.c and awe_wave.c. (Dec 12, 2000)
56 * Scott Murray Some small cleanups to the init code output.
57 * (Jan 7, 2001)
58 * Zwane Mwaikambo Added PM support. (Dec 4 2001)
59 *
60 * Adam Belay Converted driver to new PnP Layer (Oct 12, 2002)
61 * Zwane Mwaikambo Code, data structure cleanups. (Feb 15 2002)
62 * Zwane Mwaikambo Free resources during auxiliary device probe
63 * failures (Apr 29 2002)
64 *
65 */
66
67#include <linux/pnp.h>
68#include <linux/init.h>
69#include <linux/module.h>
70#include <linux/delay.h>
71#include "sound_config.h"
72
73#include "ad1848.h"
74#include "mpu401.h"
75
76#define OPL3SA2_MODULE_NAME "opl3sa2"
77#define PFX OPL3SA2_MODULE_NAME ": "
78
79/* Useful control port indexes: */
80#define OPL3SA2_PM 0x01
81#define OPL3SA2_SYS_CTRL 0x02
82#define OPL3SA2_IRQ_CONFIG 0x03
83#define OPL3SA2_DMA_CONFIG 0x06
84#define OPL3SA2_MASTER_LEFT 0x07
85#define OPL3SA2_MASTER_RIGHT 0x08
86#define OPL3SA2_MIC 0x09
87#define OPL3SA2_MISC 0x0A
88
89#define OPL3SA3_WIDE 0x14
90#define OPL3SA3_BASS 0x15
91#define OPL3SA3_TREBLE 0x16
92
93/* Useful constants: */
94#define DEFAULT_VOLUME 50
95#define DEFAULT_MIC 50
96#define DEFAULT_TIMBRE 0
97
98/* Power saving modes */
99#define OPL3SA2_PM_MODE0 0x00
100#define OPL3SA2_PM_MODE1 0x04 /* PSV */
101#define OPL3SA2_PM_MODE2 0x05 /* PSV | PDX */
102#define OPL3SA2_PM_MODE3 0x27 /* ADOWN | PSV | PDN | PDX */
103
104
105/* For checking against what the card returns: */
106#define VERSION_UNKNOWN 0
107#define VERSION_YMF711 1
108#define VERSION_YMF715 2
109#define VERSION_YMF715B 3
110#define VERSION_YMF715E 4
111/* also assuming that anything > 4 but <= 7 is a 715E */
112
113/* Chipset type constants for use below */
114#define CHIPSET_UNKNOWN -1
115#define CHIPSET_OPL3SA2 0
116#define CHIPSET_OPL3SA3 1
117static const char *CHIPSET_TABLE[] = {"OPL3-SA2", "OPL3-SA3"};
118
119#ifdef CONFIG_PNP
120#define OPL3SA2_CARDS_MAX 4
121#else
122#define OPL3SA2_CARDS_MAX 1
123#endif
124
125/* This should be pretty obvious */
126static int opl3sa2_cards_num;
127
128typedef struct {
129 /* device resources */
130 unsigned short cfg_port;
131 struct address_info cfg;
132 struct address_info cfg_mss;
133 struct address_info cfg_mpu;
134#ifdef CONFIG_PNP
135 /* PnP Stuff */
136 struct pnp_dev* pdev;
137 int activated; /* Whether said devices have been activated */
138#endif
139 unsigned int card;
140 int chipset; /* What's my version(s)? */
141 char *chipset_name;
142
143 /* mixer data */
144 int mixer;
145 unsigned int volume_l;
146 unsigned int volume_r;
147 unsigned int mic;
148 unsigned int bass_l;
149 unsigned int bass_r;
150 unsigned int treble_l;
151 unsigned int treble_r;
152 unsigned int wide_l;
153 unsigned int wide_r;
154} opl3sa2_state_t;
155static opl3sa2_state_t opl3sa2_state[OPL3SA2_CARDS_MAX];
156
157
158
159/* Our parameters */
160static int __initdata io = -1;
161static int __initdata mss_io = -1;
162static int __initdata mpu_io = -1;
163static int __initdata irq = -1;
164static int __initdata dma = -1;
165static int __initdata dma2 = -1;
166static int __initdata ymode = -1;
167static int __initdata loopback = -1;
168
169#ifdef CONFIG_PNP
170/* PnP specific parameters */
171static int __initdata isapnp = 1;
172static int __initdata multiple = 1;
173
174/* Whether said devices have been activated */
175static int opl3sa2_activated[OPL3SA2_CARDS_MAX];
176#else
177static int __initdata isapnp; /* = 0 */
178static int __initdata multiple; /* = 0 */
179#endif
180
181MODULE_DESCRIPTION("Module for OPL3-SA2 and SA3 sound cards (uses AD1848 MSS driver).");
182MODULE_AUTHOR("Scott Murray <scott@spiteful.org>");
183MODULE_LICENSE("GPL");
184
185
186module_param(io, int, 0);
187MODULE_PARM_DESC(io, "Set I/O base of OPL3-SA2 or SA3 card (usually 0x370. Address must be even and must be from 0x100 to 0xFFE)");
188
189module_param(mss_io, int, 0);
190MODULE_PARM_DESC(mss_io, "Set MSS (audio) I/O base (0x530, 0xE80, or other. Address must end in 0 or 4 and must be from 0x530 to 0xF48)");
191
192module_param(mpu_io, int, 0);
193MODULE_PARM_DESC(mpu_io, "Set MIDI I/O base (0x330 or other. Address must be even and must be from 0x300 to 0x334)");
194
195module_param(irq, int, 0);
196MODULE_PARM_DESC(irq, "Set MSS (audio) IRQ (5, 7, 9, 10, 11, 12)");
197
198module_param(dma, int, 0);
199MODULE_PARM_DESC(dma, "Set MSS (audio) first DMA channel (0, 1, 3)");
200
201module_param(dma2, int, 0);
202MODULE_PARM_DESC(dma2, "Set MSS (audio) second DMA channel (0, 1, 3)");
203
204module_param(ymode, int, 0);
205MODULE_PARM_DESC(ymode, "Set Yamaha 3D enhancement mode (0 = Desktop/Normal, 1 = Notebook PC (1), 2 = Notebook PC (2), 3 = Hi-Fi)");
206
207module_param(loopback, int, 0);
208MODULE_PARM_DESC(loopback, "Set A/D input source. Useful for echo cancellation (0 = Mic Rch (default), 1 = Mono output loopback)");
209
210#ifdef CONFIG_PNP
211module_param(isapnp, bool, 0);
212MODULE_PARM_DESC(isapnp, "When set to 0, ISA PnP support will be disabled");
213
214module_param(multiple, bool, 0);
215MODULE_PARM_DESC(multiple, "When set to 0, will not search for multiple cards");
216#endif
217
218
219/*
220 * Standard read and write functions
221*/
222
223static inline void opl3sa2_write(unsigned short port,
224 unsigned char index,
225 unsigned char data)
226{
227 outb_p(index, port);
228 outb(data, port + 1);
229}
230
231
232static inline void opl3sa2_read(unsigned short port,
233 unsigned char index,
234 unsigned char* data)
235{
236 outb_p(index, port);
237 *data = inb(port + 1);
238}
239
240
241/*
242 * All of the mixer functions...
243 */
244
245static void opl3sa2_set_volume(opl3sa2_state_t* devc, int left, int right)
246{
247 static unsigned char scale[101] = {
248 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0e, 0x0e, 0x0e,
249 0x0e, 0x0e, 0x0e, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0c,
250 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0b, 0x0b, 0x0b, 0x0b,
251 0x0b, 0x0b, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x09, 0x09,
252 0x09, 0x09, 0x09, 0x09, 0x09, 0x08, 0x08, 0x08, 0x08, 0x08,
253 0x08, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x06, 0x06,
254 0x06, 0x06, 0x06, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
255 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03,
256 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01,
257 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
258 0x00
259 };
260 unsigned char vol;
261
262 vol = scale[left];
263
264 /* If level is zero, turn on mute */
265 if(!left)
266 vol |= 0x80;
267
268 opl3sa2_write(devc->cfg_port, OPL3SA2_MASTER_LEFT, vol);
269
270 vol = scale[right];
271
272 /* If level is zero, turn on mute */
273 if(!right)
274 vol |= 0x80;
275
276 opl3sa2_write(devc->cfg_port, OPL3SA2_MASTER_RIGHT, vol);
277}
278
279
280static void opl3sa2_set_mic(opl3sa2_state_t* devc, int level)
281{
282 unsigned char vol = 0x1F;
283
284 if((level >= 0) && (level <= 100))
285 vol = 0x1F - (unsigned char) (32 * level / 101);
286
287 /* If level is zero, turn on mute */
288 if(!level)
289 vol |= 0x80;
290
291 opl3sa2_write(devc->cfg_port, OPL3SA2_MIC, vol);
292}
293
294
295static void opl3sa3_set_bass(opl3sa2_state_t* devc, int left, int right)
296{
297 unsigned char bass;
298
299 bass = left ? ((unsigned char) (8 * left / 101)) : 0;
300 bass |= (right ? ((unsigned char) (8 * right / 101)) : 0) << 4;
301
302 opl3sa2_write(devc->cfg_port, OPL3SA3_BASS, bass);
303}
304
305
306static void opl3sa3_set_treble(opl3sa2_state_t* devc, int left, int right)
307{
308 unsigned char treble;
309
310 treble = left ? ((unsigned char) (8 * left / 101)) : 0;
311 treble |= (right ? ((unsigned char) (8 * right / 101)) : 0) << 4;
312
313 opl3sa2_write(devc->cfg_port, OPL3SA3_TREBLE, treble);
314}
315
316
317
318
319static void opl3sa2_mixer_reset(opl3sa2_state_t* devc)
320{
321 if (devc) {
322 opl3sa2_set_volume(devc, DEFAULT_VOLUME, DEFAULT_VOLUME);
323 devc->volume_l = devc->volume_r = DEFAULT_VOLUME;
324
325 opl3sa2_set_mic(devc, DEFAULT_MIC);
326 devc->mic = DEFAULT_MIC;
327
328 if (devc->chipset == CHIPSET_OPL3SA3) {
329 opl3sa3_set_bass(devc, DEFAULT_TIMBRE, DEFAULT_TIMBRE);
330 devc->bass_l = devc->bass_r = DEFAULT_TIMBRE;
331 opl3sa3_set_treble(devc, DEFAULT_TIMBRE, DEFAULT_TIMBRE);
332 devc->treble_l = devc->treble_r = DEFAULT_TIMBRE;
333 }
334 }
335}
336
337static inline void arg_to_vol_mono(unsigned int vol, int* value)
338{
339 int left;
340
341 left = vol & 0x00ff;
342 if (left > 100)
343 left = 100;
344 *value = left;
345}
346
347
348static inline void arg_to_vol_stereo(unsigned int vol, int* aleft, int* aright)
349{
350 arg_to_vol_mono(vol, aleft);
351 arg_to_vol_mono(vol >> 8, aright);
352}
353
354
355static inline int ret_vol_mono(int vol)
356{
357 return ((vol << 8) | vol);
358}
359
360
361static inline int ret_vol_stereo(int left, int right)
362{
363 return ((right << 8) | left);
364}
365
366
367static int opl3sa2_mixer_ioctl(int dev, unsigned int cmd, void __user *arg)
368{
369 int retval, value, cmdf = cmd & 0xff;
370 int __user *p = (int __user *)arg;
371
372 opl3sa2_state_t* devc = &opl3sa2_state[dev];
373
374 switch (cmdf) {
375 case SOUND_MIXER_VOLUME:
376 case SOUND_MIXER_MIC:
377 case SOUND_MIXER_DEVMASK:
378 case SOUND_MIXER_STEREODEVS:
379 case SOUND_MIXER_RECMASK:
380 case SOUND_MIXER_RECSRC:
381 case SOUND_MIXER_CAPS:
382 break;
383
384 default:
385 return -EINVAL;
386 }
387
388 if (((cmd >> 8) & 0xff) != 'M')
389 return -EINVAL;
390
391 retval = 0;
392 if (_SIOC_DIR (cmd) & _SIOC_WRITE) {
393 switch (cmdf) {
394 case SOUND_MIXER_VOLUME:
395 retval = get_user(value, (unsigned __user *) arg);
396 if (retval)
397 break;
398 arg_to_vol_stereo(value, &devc->volume_l, &devc->volume_r);
399 opl3sa2_set_volume(devc, devc->volume_l, devc->volume_r);
400 value = ret_vol_stereo(devc->volume_l, devc->volume_r);
401 retval = put_user(value, p);
402 break;
403
404 case SOUND_MIXER_MIC:
405 retval = get_user(value, (unsigned __user *) arg);
406 if (retval)
407 break;
408 arg_to_vol_mono(value, &devc->mic);
409 opl3sa2_set_mic(devc, devc->mic);
410 value = ret_vol_mono(devc->mic);
411 retval = put_user(value, p);
412 break;
413
414 default:
415 retval = -EINVAL;
416 }
417 }
418 else {
419 /*
420 * Return parameters
421 */
422 switch (cmdf) {
423 case SOUND_MIXER_DEVMASK:
424 retval = put_user(SOUND_MASK_VOLUME | SOUND_MASK_MIC, p);
425 break;
426
427 case SOUND_MIXER_STEREODEVS:
428 retval = put_user(SOUND_MASK_VOLUME, p);
429 break;
430
431 case SOUND_MIXER_RECMASK:
432 /* No recording devices */
433 retval = put_user(0, p);
434 break;
435
436 case SOUND_MIXER_CAPS:
437 retval = put_user(SOUND_CAP_EXCL_INPUT, p);
438 break;
439
440 case SOUND_MIXER_RECSRC:
441 /* No recording source */
442 retval = put_user(0, p);
443 break;
444
445 case SOUND_MIXER_VOLUME:
446 value = ret_vol_stereo(devc->volume_l, devc->volume_r);
447 retval = put_user(value, p);
448 break;
449
450 case SOUND_MIXER_MIC:
451 value = ret_vol_mono(devc->mic);
452 put_user(value, p);
453 break;
454
455 default:
456 retval = -EINVAL;
457 }
458 }
459 return retval;
460}
461/* opl3sa2_mixer_ioctl end */
462
463
464static int opl3sa3_mixer_ioctl(int dev, unsigned int cmd, void __user * arg)
465{
466 int value, retval, cmdf = cmd & 0xff;
467
468 opl3sa2_state_t* devc = &opl3sa2_state[dev];
469
470 switch (cmdf) {
471 case SOUND_MIXER_BASS:
472 value = ret_vol_stereo(devc->bass_l, devc->bass_r);
473 retval = put_user(value, (int __user *) arg);
474 break;
475
476 case SOUND_MIXER_TREBLE:
477 value = ret_vol_stereo(devc->treble_l, devc->treble_r);
478 retval = put_user(value, (int __user *) arg);
479 break;
480
481 case SOUND_MIXER_DIGITAL1:
482 value = ret_vol_stereo(devc->wide_l, devc->wide_r);
483 retval = put_user(value, (int __user *) arg);
484 break;
485
486 default:
487 retval = -EINVAL;
488 }
489 return retval;
490}
491/* opl3sa3_mixer_ioctl end */
492
493
494static struct mixer_operations opl3sa2_mixer_operations =
495{
496 .owner = THIS_MODULE,
497 .id = "OPL3-SA2",
498 .name = "Yamaha OPL3-SA2",
499 .ioctl = opl3sa2_mixer_ioctl
500};
501
502static struct mixer_operations opl3sa3_mixer_operations =
503{
504 .owner = THIS_MODULE,
505 .id = "OPL3-SA3",
506 .name = "Yamaha OPL3-SA3",
507 .ioctl = opl3sa3_mixer_ioctl
508};
509
510/* End of mixer-related stuff */
511
512
513/*
514 * Component probe, attach, unload functions
515 */
516
517static inline void __exit unload_opl3sa2_mpu(struct address_info *hw_config)
518{
519 unload_mpu401(hw_config);
520}
521
522
523static void __init attach_opl3sa2_mss(struct address_info* hw_config, struct resource *ports)
524{
525 int initial_mixers;
526
527 initial_mixers = num_mixers;
528 attach_ms_sound(hw_config, ports, THIS_MODULE); /* Slot 0 */
529 if (hw_config->slots[0] != -1) {
530 /* Did the MSS driver install? */
531 if(num_mixers == (initial_mixers + 1)) {
532 /* The MSS mixer is installed, reroute mixers appropriately */
533 AD1848_REROUTE(SOUND_MIXER_LINE1, SOUND_MIXER_CD);
534 AD1848_REROUTE(SOUND_MIXER_LINE2, SOUND_MIXER_SYNTH);
535 AD1848_REROUTE(SOUND_MIXER_LINE3, SOUND_MIXER_LINE);
536 }
537 else {
538 printk(KERN_ERR PFX "MSS mixer not installed?\n");
539 }
540 }
541}
542
543
544static inline void __exit unload_opl3sa2_mss(struct address_info* hw_config)
545{
546 unload_ms_sound(hw_config);
547}
548
549
550static int __init probe_opl3sa2(struct address_info* hw_config, int card)
551{
552 unsigned char misc;
553 unsigned char tmp;
554 unsigned char version;
555
556 /*
557 * Try and allocate our I/O port range.
558 */
559 if (!request_region(hw_config->io_base, 2, OPL3SA2_MODULE_NAME)) {
560 printk(KERN_ERR PFX "Control I/O port %#x not free\n",
561 hw_config->io_base);
562 goto out_nodev;
563 }
564
565 /*
566 * Check if writing to the read-only version bits of the miscellaneous
567 * register succeeds or not (it should not).
568 */
569 opl3sa2_read(hw_config->io_base, OPL3SA2_MISC, &misc);
570 opl3sa2_write(hw_config->io_base, OPL3SA2_MISC, misc ^ 0x07);
571 opl3sa2_read(hw_config->io_base, OPL3SA2_MISC, &tmp);
572 if(tmp != misc) {
573 printk(KERN_ERR PFX "Control I/O port %#x is not a YMF7xx chipset!\n",
574 hw_config->io_base);
575 goto out_region;
576 }
577
578 /*
579 * Check if the MIC register is accessible.
580 */
581 opl3sa2_read(hw_config->io_base, OPL3SA2_MIC, &tmp);
582 opl3sa2_write(hw_config->io_base, OPL3SA2_MIC, 0x8a);
583 opl3sa2_read(hw_config->io_base, OPL3SA2_MIC, &tmp);
584 if((tmp & 0x9f) != 0x8a) {
585 printk(KERN_ERR
586 PFX "Control I/O port %#x is not a YMF7xx chipset!\n",
587 hw_config->io_base);
588 goto out_region;
589 }
590 opl3sa2_write(hw_config->io_base, OPL3SA2_MIC, tmp);
591
592 /*
593 * Determine chipset type (SA2 or SA3)
594 *
595 * This is done by looking at the chipset version in the lower 3 bits
596 * of the miscellaneous register.
597 */
598 version = misc & 0x07;
599 printk(KERN_DEBUG PFX "Chipset version = %#x\n", version);
600 switch (version) {
601 case 0:
602 opl3sa2_state[card].chipset = CHIPSET_UNKNOWN;
603 printk(KERN_ERR
604 PFX "Unknown Yamaha audio controller version\n");
605 break;
606
607 case VERSION_YMF711:
608 opl3sa2_state[card].chipset = CHIPSET_OPL3SA2;
609 printk(KERN_INFO PFX "Found OPL3-SA2 (YMF711)\n");
610 break;
611
612 case VERSION_YMF715:
613 opl3sa2_state[card].chipset = CHIPSET_OPL3SA3;
614 printk(KERN_INFO
615 PFX "Found OPL3-SA3 (YMF715 or YMF719)\n");
616 break;
617
618 case VERSION_YMF715B:
619 opl3sa2_state[card].chipset = CHIPSET_OPL3SA3;
620 printk(KERN_INFO
621 PFX "Found OPL3-SA3 (YMF715B or YMF719B)\n");
622 break;
623
624 case VERSION_YMF715E:
625 default:
626 opl3sa2_state[card].chipset = CHIPSET_OPL3SA3;
627 printk(KERN_INFO
628 PFX "Found OPL3-SA3 (YMF715E or YMF719E)\n");
629 break;
630 }
631
632 if (opl3sa2_state[card].chipset != CHIPSET_UNKNOWN) {
633 /* Generate a pretty name */
634 opl3sa2_state[card].chipset_name = (char *)CHIPSET_TABLE[opl3sa2_state[card].chipset];
635 return 0;
636 }
637
638out_region:
639 release_region(hw_config->io_base, 2);
640out_nodev:
641 return -ENODEV;
642}
643
644
645static void __init attach_opl3sa2(struct address_info* hw_config, int card)
646{
647 /* Initialize IRQ configuration to IRQ-B: -, IRQ-A: WSS+MPU+OPL3 */
648 opl3sa2_write(hw_config->io_base, OPL3SA2_IRQ_CONFIG, 0x0d);
649
650 /* Initialize DMA configuration */
651 if(hw_config->dma2 == hw_config->dma) {
652 /* Want DMA configuration DMA-B: -, DMA-A: WSS-P+WSS-R */
653 opl3sa2_write(hw_config->io_base, OPL3SA2_DMA_CONFIG, 0x03);
654 }
655 else {
656 /* Want DMA configuration DMA-B: WSS-R, DMA-A: WSS-P */
657 opl3sa2_write(hw_config->io_base, OPL3SA2_DMA_CONFIG, 0x21);
658 }
659}
660
661
662static void __init attach_opl3sa2_mixer(struct address_info *hw_config, int card)
663{
664 struct mixer_operations* mixer_operations;
665 opl3sa2_state_t* devc = &opl3sa2_state[card];
666
667 /* Install master mixer */
668 if (devc->chipset == CHIPSET_OPL3SA3) {
669 mixer_operations = &opl3sa3_mixer_operations;
670 }
671 else {
672 mixer_operations = &opl3sa2_mixer_operations;
673 }
674
675 devc->cfg_port = hw_config->io_base;
676 devc->mixer = sound_install_mixer(MIXER_DRIVER_VERSION,
677 mixer_operations->name,
678 mixer_operations,
679 sizeof(struct mixer_operations),
680 devc);
681 if(devc->mixer < 0) {
682 printk(KERN_ERR PFX "Could not install %s master mixer\n",
683 mixer_operations->name);
684 }
685 else {
686 opl3sa2_mixer_reset(devc);
687
688 }
689}
690
691
692static void opl3sa2_clear_slots(struct address_info* hw_config)
693{
694 int i;
695
696 for(i = 0; i < 6; i++) {
697 hw_config->slots[i] = -1;
698 }
699}
700
701
702static void __init opl3sa2_set_ymode(struct address_info* hw_config, int ymode)
703{
704 /*
705 * Set the Yamaha 3D enhancement mode (aka Ymersion) if asked to and
706 * it's supported.
707 *
708 * 0: Desktop (aka normal) 5-12 cm speakers
709 * 1: Notebook PC mode 1 3 cm speakers
710 * 2: Notebook PC mode 2 1.5 cm speakers
711 * 3: Hi-fi 16-38 cm speakers
712 */
713 if(ymode >= 0 && ymode <= 3) {
714 unsigned char sys_ctrl;
715
716 opl3sa2_read(hw_config->io_base, OPL3SA2_SYS_CTRL, &sys_ctrl);
717 sys_ctrl = (sys_ctrl & 0xcf) | ((ymode & 3) << 4);
718 opl3sa2_write(hw_config->io_base, OPL3SA2_SYS_CTRL, sys_ctrl);
719 }
720 else {
721 printk(KERN_ERR PFX "not setting ymode, it must be one of 0,1,2,3\n");
722 }
723}
724
725
726static void __init opl3sa2_set_loopback(struct address_info* hw_config, int loopback)
727{
728 if(loopback >= 0 && loopback <= 1) {
729 unsigned char misc;
730
731 opl3sa2_read(hw_config->io_base, OPL3SA2_MISC, &misc);
732 misc = (misc & 0xef) | ((loopback & 1) << 4);
733 opl3sa2_write(hw_config->io_base, OPL3SA2_MISC, misc);
734 }
735 else {
736 printk(KERN_ERR PFX "not setting loopback, it must be either 0 or 1\n");
737 }
738}
739
740
741static void __exit unload_opl3sa2(struct address_info* hw_config, int card)
742{
743 /* Release control ports */
744 release_region(hw_config->io_base, 2);
745
746 /* Unload mixer */
747 if(opl3sa2_state[card].mixer >= 0)
748 sound_unload_mixerdev(opl3sa2_state[card].mixer);
749
750}
751
752#ifdef CONFIG_PNP
753static struct pnp_device_id pnp_opl3sa2_list[] = {
754 {.id = "YMH0021", .driver_data = 0},
755 {.id = ""}
756};
757
758MODULE_DEVICE_TABLE(pnp, pnp_opl3sa2_list);
759
760static int opl3sa2_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
761{
762 int card = opl3sa2_cards_num;
763
764 /* we don't actually want to return an error as the user may have specified
765 * no multiple card search
766 */
767
768 if (opl3sa2_cards_num == OPL3SA2_CARDS_MAX)
769 return 0;
770 opl3sa2_activated[card] = 1;
771
772 /* Our own config: */
773 opl3sa2_state[card].cfg.io_base = pnp_port_start(dev, 4);
774 opl3sa2_state[card].cfg.irq = pnp_irq(dev, 0);
775 opl3sa2_state[card].cfg.dma = pnp_dma(dev, 0);
776 opl3sa2_state[card].cfg.dma2 = pnp_dma(dev, 1);
777
778 /* The MSS config: */
779 opl3sa2_state[card].cfg_mss.io_base = pnp_port_start(dev, 1);
780 opl3sa2_state[card].cfg_mss.irq = pnp_irq(dev, 0);
781 opl3sa2_state[card].cfg_mss.dma = pnp_dma(dev, 0);
782 opl3sa2_state[card].cfg_mss.dma2 = pnp_dma(dev, 1);
783 opl3sa2_state[card].cfg_mss.card_subtype = 1; /* No IRQ or DMA setup */
784
785 opl3sa2_state[card].cfg_mpu.io_base = pnp_port_start(dev, 3);
786 opl3sa2_state[card].cfg_mpu.irq = pnp_irq(dev, 0);
787 opl3sa2_state[card].cfg_mpu.dma = -1;
788 opl3sa2_state[card].cfg_mpu.dma2 = -1;
789 opl3sa2_state[card].cfg_mpu.always_detect = 1; /* It's there, so use shared IRQs */
790
791 /* Call me paranoid: */
792 opl3sa2_clear_slots(&opl3sa2_state[card].cfg);
793 opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mss);
794 opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mpu);
795
796 opl3sa2_state[card].pdev = dev;
797 opl3sa2_cards_num++;
798
799 return 0;
800}
801
802static struct pnp_driver opl3sa2_driver = {
803 .name = "opl3sa2",
804 .id_table = pnp_opl3sa2_list,
805 .probe = opl3sa2_pnp_probe,
806};
807
808#endif /* CONFIG_PNP */
809
810/* End of component functions */
811
812/*
813 * Install OPL3-SA2 based card(s).
814 *
815 * Need to have ad1848 and mpu401 loaded ready.
816 */
817static int __init init_opl3sa2(void)
818{
819 int card, max;
820
821 /* Sanitize isapnp and multiple settings */
822 isapnp = isapnp != 0 ? 1 : 0;
823 multiple = multiple != 0 ? 1 : 0;
824
825 max = (multiple && isapnp) ? OPL3SA2_CARDS_MAX : 1;
826
827#ifdef CONFIG_PNP
828 if (isapnp){
829 pnp_register_driver(&opl3sa2_driver);
830 if(!opl3sa2_cards_num){
831 printk(KERN_INFO PFX "No PnP cards found\n");
832 isapnp = 0;
833 }
834 max = opl3sa2_cards_num;
835 }
836#endif
837
838 for (card = 0; card < max; card++) {
839 /* If a user wants an I/O then assume they meant it */
840 struct resource *ports;
841 int base;
842
843 if (!isapnp) {
844 if (io == -1 || irq == -1 || dma == -1 ||
845 dma2 == -1 || mss_io == -1) {
846 printk(KERN_ERR
847 PFX "io, mss_io, irq, dma, and dma2 must be set\n");
848 return -EINVAL;
849 }
850 opl3sa2_cards_num++;
851
852 /*
853 * Our own config:
854 * (NOTE: IRQ and DMA aren't used, so they're set to
855 * give pretty output from conf_printf. :)
856 */
857 opl3sa2_state[card].cfg.io_base = io;
858 opl3sa2_state[card].cfg.irq = irq;
859 opl3sa2_state[card].cfg.dma = dma;
860 opl3sa2_state[card].cfg.dma2 = dma2;
861
862 /* The MSS config: */
863 opl3sa2_state[card].cfg_mss.io_base = mss_io;
864 opl3sa2_state[card].cfg_mss.irq = irq;
865 opl3sa2_state[card].cfg_mss.dma = dma;
866 opl3sa2_state[card].cfg_mss.dma2 = dma2;
867 opl3sa2_state[card].cfg_mss.card_subtype = 1; /* No IRQ or DMA setup */
868
869 opl3sa2_state[card].cfg_mpu.io_base = mpu_io;
870 opl3sa2_state[card].cfg_mpu.irq = irq;
871 opl3sa2_state[card].cfg_mpu.dma = -1;
872 opl3sa2_state[card].cfg_mpu.always_detect = 1; /* Use shared IRQs */
873
874 /* Call me paranoid: */
875 opl3sa2_clear_slots(&opl3sa2_state[card].cfg);
876 opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mss);
877 opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mpu);
878 }
879
880 /* FIXME: leak */
881 if (probe_opl3sa2(&opl3sa2_state[card].cfg, card))
882 return -ENODEV;
883
884 base = opl3sa2_state[card].cfg_mss.io_base;
885
886 if (!request_region(base, 4, "WSS config"))
887 goto failed;
888
889 ports = request_region(base + 4, 4, "ad1848");
890 if (!ports)
891 goto failed2;
892
893 if (!probe_ms_sound(&opl3sa2_state[card].cfg_mss, ports)) {
894 /*
895 * If one or more cards are already registered, don't
896 * return an error but print a warning. Note, this
897 * should never really happen unless the hardware or
898 * ISA PnP screwed up.
899 */
900 release_region(base + 4, 4);
901 failed2:
902 release_region(base, 4);
903 failed:
904 release_region(opl3sa2_state[card].cfg.io_base, 2);
905
906 if (opl3sa2_cards_num) {
907 printk(KERN_WARNING
908 PFX "There was a problem probing one "
909 " of the ISA PNP cards, continuing\n");
910 opl3sa2_cards_num--;
911 continue;
912 } else
913 return -ENODEV;
914 }
915
916 attach_opl3sa2(&opl3sa2_state[card].cfg, card);
917 conf_printf(opl3sa2_state[card].chipset_name, &opl3sa2_state[card].cfg);
918 attach_opl3sa2_mixer(&opl3sa2_state[card].cfg, card);
919 attach_opl3sa2_mss(&opl3sa2_state[card].cfg_mss, ports);
920
921 /* ewww =) */
922 opl3sa2_state[card].card = card;
923
924 /*
925 * Set the Yamaha 3D enhancement mode (aka Ymersion) if asked to and
926 * it's supported.
927 */
928 if (ymode != -1) {
929 if (opl3sa2_state[card].chipset == CHIPSET_OPL3SA2) {
930 printk(KERN_ERR
931 PFX "ymode not supported on OPL3-SA2\n");
932 }
933 else {
934 opl3sa2_set_ymode(&opl3sa2_state[card].cfg, ymode);
935 }
936 }
937
938
939 /* Set A/D input to Mono loopback if asked to. */
940 if (loopback != -1) {
941 opl3sa2_set_loopback(&opl3sa2_state[card].cfg, loopback);
942 }
943
944 /* Attach MPU if we've been asked to do so, failure isn't fatal */
945 if (opl3sa2_state[card].cfg_mpu.io_base != -1) {
946 int base = opl3sa2_state[card].cfg_mpu.io_base;
947 struct resource *ports;
948 ports = request_region(base, 2, "mpu401");
949 if (!ports)
950 goto out;
951 if (!probe_mpu401(&opl3sa2_state[card].cfg_mpu, ports)) {
952 release_region(base, 2);
953 goto out;
954 }
955 if (attach_mpu401(&opl3sa2_state[card].cfg_mpu, THIS_MODULE)) {
956 printk(KERN_ERR PFX "failed to attach MPU401\n");
957 opl3sa2_state[card].cfg_mpu.slots[1] = -1;
958 }
959 }
960 }
961
962out:
963 if (isapnp) {
964 printk(KERN_NOTICE PFX "%d PnP card(s) found.\n", opl3sa2_cards_num);
965 }
966
967 return 0;
968}
969
970
971/*
972 * Uninstall OPL3-SA2 based card(s).
973 */
974static void __exit cleanup_opl3sa2(void)
975{
976 int card;
977
978 for(card = 0; card < opl3sa2_cards_num; card++) {
979 if (opl3sa2_state[card].cfg_mpu.slots[1] != -1) {
980 unload_opl3sa2_mpu(&opl3sa2_state[card].cfg_mpu);
981 }
982 unload_opl3sa2_mss(&opl3sa2_state[card].cfg_mss);
983 unload_opl3sa2(&opl3sa2_state[card].cfg, card);
984#ifdef CONFIG_PNP
985 pnp_unregister_driver(&opl3sa2_driver);
986#endif
987 }
988}
989
990module_init(init_opl3sa2);
991module_exit(cleanup_opl3sa2);
992
993#ifndef MODULE
994static int __init setup_opl3sa2(char *str)
995{
996 /* io, irq, dma, dma2,... */
997#ifdef CONFIG_PNP
998 int ints[11];
999#else
1000 int ints[9];
1001#endif
1002 str = get_options(str, ARRAY_SIZE(ints), ints);
1003
1004 io = ints[1];
1005 irq = ints[2];
1006 dma = ints[3];
1007 dma2 = ints[4];
1008 mss_io = ints[5];
1009 mpu_io = ints[6];
1010 ymode = ints[7];
1011 loopback = ints[8];
1012#ifdef CONFIG_PNP
1013 isapnp = ints[9];
1014 multiple = ints[10];
1015#endif
1016 return 1;
1017}
1018
1019__setup("opl3sa2=", setup_opl3sa2);
1020#endif