ixj.c
上传用户:sy_wanhua
上传日期:2013-07-25
资源大小:3048k
文件大小:236k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

C/C++

  1. retval = j->daa_mode;
  2. j->ex.bits.pstn_ring = 0;
  3. break;
  4. case IXJCTL_SET_FILTER:
  5. if (copy_from_user(&jf, (char *) arg, sizeof(ti)))
  6. return -EFAULT;
  7. retval = ixj_init_filter(board, &jf);
  8. break;
  9. case IXJCTL_GET_FILTER_HIST:
  10. retval = j->filter_hist[arg];
  11. break;
  12. case IXJCTL_INIT_TONE:
  13. copy_from_user(&ti, (char *) arg, sizeof(ti));
  14. retval = ixj_init_tone(board, &ti);
  15. break;
  16. case IXJCTL_TONE_CADENCE:
  17. retval = ixj_build_cadence(board, (IXJ_CADENCE *) arg);
  18. break;
  19. case IXJCTL_FILTER_CADENCE:
  20. retval = ixj_build_filter_cadence(board, (IXJ_FILTER_CADENCE *) arg);
  21. break;
  22. case IXJCTL_INTERCOM_STOP:
  23. ixj[board].intercom = -1;
  24. ixj[arg].intercom = -1;
  25. ixj_record_stop(board);
  26. ixj_record_stop(arg);
  27. ixj_play_stop(board);
  28. ixj_play_stop(arg);
  29. idle(board);
  30. idle(arg);
  31. break;
  32. case IXJCTL_INTERCOM_START:
  33. ixj[board].intercom = arg;
  34. ixj[arg].intercom = board;
  35. ixj_play_start(arg);
  36. ixj_record_start(board);
  37. ixj_play_start(board);
  38. ixj_record_start(arg);
  39. idle(board);
  40. idle(arg);
  41. break;
  42. }
  43. return retval;
  44. }
  45. static int ixj_fasync(int fd, struct file *file_p, int mode)
  46. {
  47. IXJ *j = &ixj[NUM(file_p->f_dentry->d_inode->i_rdev)];
  48. return fasync_helper(fd, file_p, mode, &j->async_queue);
  49. }
  50. struct file_operations ixj_fops =
  51. {
  52. NULL, /* ixj_lseek */
  53. ixj_enhanced_read,
  54. ixj_enhanced_write,
  55. NULL, /* ixj_readdir */
  56. ixj_poll,
  57. ixj_ioctl,
  58. NULL, /* ixj_mmap */
  59. //  ixj_open,
  60. NULL, /* ixj_open */
  61. NULL, /* ixj_flush */
  62. ixj_release,
  63. NULL, /* ixj_fsync */
  64. ixj_fasync, /* ixj_fasync */
  65. NULL, /* media change */
  66. NULL, /* revalidate */
  67. NULL /* lock */
  68. };
  69. static int ixj_linetest(int board)
  70. {
  71. unsigned long jifwait;
  72. IXJ *j = &ixj[board];
  73. if (!j->flags.pots_correct) {
  74. j->flags.pots_correct = 1; // Testing
  75. daa_int_read(board); //Clear DAA Interrupt flags
  76. //
  77. // Hold all relays in the normally de-energized position.
  78. //
  79. j->pld_slicw.bits.rly1 = 0;
  80. j->pld_slicw.bits.rly2 = 0;
  81. j->pld_slicw.bits.rly3 = 0;
  82. outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01);
  83. j->pld_scrw.bits.daafsyncen = 0; // Turn off DAA Frame Sync
  84. outb_p(j->pld_scrw.byte, j->XILINXbase);
  85. j->pld_slicr.byte = inb_p(j->XILINXbase + 0x01);
  86. if (j->pld_slicr.bits.potspstn) {
  87. j->flags.pots_pstn = 1;
  88. j->flags.pots_correct = 0;
  89. LED_SetState(0x4, board);
  90. } else {
  91. j->flags.pots_pstn = 0;
  92. j->pld_slicw.bits.rly1 = 0;
  93. j->pld_slicw.bits.rly2 = 0;
  94. j->pld_slicw.bits.rly3 = 1;
  95. outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01);
  96. j->pld_scrw.bits.daafsyncen = 0; // Turn off DAA Frame Sync
  97. outb_p(j->pld_scrw.byte, j->XILINXbase);
  98. daa_set_mode(board, SOP_PU_CONVERSATION);
  99. jifwait = jiffies + hertz;
  100. while (time_before(jiffies, jifwait)) {
  101. current->state = TASK_INTERRUPTIBLE;
  102. schedule_timeout(1);
  103. }
  104. daa_int_read(board);
  105. daa_set_mode(board, SOP_PU_SLEEP);
  106. if (j->m_DAAShadowRegs.XOP_REGS.XOP.xr0.bitreg.VDD_OK) {
  107. j->flags.pots_correct = 0; // Should not be line voltage on POTS port.
  108. LED_SetState(0x4, board);
  109. j->pld_slicw.bits.rly3 = 0;
  110. outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01);
  111. } else {
  112. j->flags.pots_correct = 1;
  113. LED_SetState(0x8, board);
  114. j->pld_slicw.bits.rly1 = 1;
  115. j->pld_slicw.bits.rly2 = 0;
  116. j->pld_slicw.bits.rly3 = 0;
  117. outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01);
  118. }
  119. }
  120. }
  121. if (!j->flags.pstn_present) {
  122. j->pld_slicw.bits.rly3 = 0;
  123. outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01);
  124. daa_set_mode(board, SOP_PU_CONVERSATION);
  125. jifwait = jiffies + hertz;
  126. while (time_before(jiffies, jifwait)) {
  127. current->state = TASK_INTERRUPTIBLE;
  128. schedule_timeout(1);
  129. }
  130. daa_int_read(board);
  131. daa_set_mode(board, SOP_PU_SLEEP);
  132. if (j->m_DAAShadowRegs.XOP_REGS.XOP.xr0.bitreg.VDD_OK) {
  133. j->flags.pstn_present = 1;
  134. } else {
  135. j->flags.pstn_present = 0;
  136. }
  137. }
  138. if (j->flags.pstn_present) {
  139. if (j->flags.pots_correct) {
  140. LED_SetState(0xA, board);
  141. } else {
  142. LED_SetState(0x6, board);
  143. }
  144. } else {
  145. if (j->flags.pots_correct) {
  146. LED_SetState(0x9, board);
  147. } else {
  148. LED_SetState(0x5, board);
  149. }
  150. }
  151. return j->flags.pstn_present;
  152. }
  153. static int ixj_selfprobe(int board)
  154. {
  155. unsigned short cmd;
  156. unsigned long jif;
  157. int cnt;
  158. BYTES bytes;
  159. IXJ *j = &ixj[board];
  160. if (ixjdebug > 0)
  161. printk(KERN_INFO "Write IDLE to Software Control Registern");
  162. if (ixj_WriteDSPCommand(0x0000, board)) /* Write IDLE to Software Control Register */
  163. return -1;
  164. // The read values of the SSR should be 0x00 for the IDLE command
  165. if (j->ssr.low || j->ssr.high)
  166. return -1;
  167. if (ixjdebug > 0)
  168. printk(KERN_INFO "Get Device ID Coden");
  169. if (ixj_WriteDSPCommand(0x3400, board)) /* Get Device ID Code */
  170. return -1;
  171. j->dsp.low = j->ssr.low;
  172. j->dsp.high = j->ssr.high;
  173. if (ixjdebug > 0)
  174. printk(KERN_INFO "Get Device Version Coden");
  175. if (ixj_WriteDSPCommand(0x3800, board)) /* Get Device Version Code */
  176. return -1;
  177. j->ver.low = j->ssr.low;
  178. j->ver.high = j->ssr.high;
  179. if (!j->cardtype) {
  180. if (j->dsp.low == 0x21) {
  181. //      j->XILINXbase = j->DSPbase + 0x10;
  182. bytes.high = bytes.low = inb_p(j->XILINXbase + 0x02);
  183. outb_p(bytes.low ^ 0xFF, j->XILINXbase + 0x02);
  184. // Test for Internet LineJACK or Internet PhoneJACK Lite
  185. bytes.low = inb_p(j->XILINXbase + 0x02);
  186. if (bytes.low == bytes.high) //  Register is read only on
  187. //  Internet PhoneJack Lite
  188.  {
  189. j->cardtype = 400; // Internet PhoneJACK Lite
  190. if (check_region(j->XILINXbase, 4)) {
  191. printk(KERN_INFO "ixj: can't get I/O address 0x%xn", j->XILINXbase);
  192. return -1;
  193. }
  194. request_region(j->XILINXbase, 4, "ixj control");
  195. j->pld_slicw.pcib.e1 = 1;
  196. outb_p(j->pld_slicw.byte, j->XILINXbase);
  197. } else {
  198. j->cardtype = 300; // Internet LineJACK
  199. if (check_region(j->XILINXbase, 8)) {
  200. printk(KERN_INFO "ixj: can't get I/O address 0x%xn", j->XILINXbase);
  201. return -1;
  202. }
  203. request_region(j->XILINXbase, 8, "ixj control");
  204. }
  205. } else if (j->dsp.low == 0x22) {
  206. j->cardtype = 500; // Internet PhoneJACK PCI
  207. request_region(j->XILINXbase, 4, "ixj control");
  208. j->pld_slicw.pcib.e1 = 1;
  209. outb_p(j->pld_slicw.byte, j->XILINXbase);
  210. } else
  211. j->cardtype = 100; // Internet PhoneJACK
  212. } else {
  213. switch (j->cardtype) {
  214. case 100: // Internet PhoneJACK
  215. if (!j->dsp.low != 0x20) {
  216. j->dsp.high = 0x80;
  217. j->dsp.low = 0x20;
  218. ixj_WriteDSPCommand(0x3800, board);
  219. j->ver.low = j->ssr.low;
  220. j->ver.high = j->ssr.high;
  221. }
  222. break;
  223. case 300: // Internet LineJACK
  224. if (check_region(j->XILINXbase, 8)) {
  225. printk(KERN_INFO "ixj: can't get I/O address 0x%xn", j->XILINXbase);
  226. return -1;
  227. }
  228. request_region(j->XILINXbase, 8, "ixj control");
  229. break;
  230. case 400: //Internet PhoneJACK Lite
  231. case 500: //Internet PhoneJACK PCI
  232. if (check_region(j->XILINXbase, 4)) {
  233. printk(KERN_INFO "ixj: can't get I/O address 0x%xn", j->XILINXbase);
  234. return -1;
  235. }
  236. request_region(j->XILINXbase, 4, "ixj control");
  237. j->pld_slicw.pcib.e1 = 1;
  238. outb_p(j->pld_slicw.byte, j->XILINXbase);
  239. break;
  240. case 600: //Internet PhoneCARD
  241. break;
  242. }
  243. }
  244. if (j->dsp.low == 0x20 || j->cardtype == 400 || j->cardtype == 500) {
  245. if (ixjdebug > 0)
  246. printk(KERN_INFO "Write CODEC config to Software Control Registern");
  247. if (ixj_WriteDSPCommand(0xC462, board)) /* Write CODEC config to Software Control Register */
  248. return -1;
  249. if (ixjdebug > 0)
  250. printk(KERN_INFO "Write CODEC timing to Software Control Registern");
  251. if (j->cardtype == 100) {
  252. cmd = 0x9FF2;
  253. } else {
  254. cmd = 0x9FF5;
  255. }
  256. if (ixj_WriteDSPCommand(cmd, board)) /* Write CODEC timing to Software Control Register */
  257. return -1;
  258. } else {
  259. if (set_base_frame(board, 30) != 30)
  260. return -1;
  261. if (ixjdebug > 0)
  262. printk(KERN_INFO "Write CODEC config to Software Control Registern");
  263. if (j->cardtype == 600) {
  264. if (ixj_WriteDSPCommand(0xC528, board)) /* Write CODEC config to Software Control Register */
  265. return -1;
  266. }
  267. if (j->cardtype == 300) {
  268. if (ixj_WriteDSPCommand(0xC528, board)) /* Write CODEC config to Software Control Register */
  269. return -1;
  270. if (ixjdebug > 0)
  271. printk(KERN_INFO "Turn on the PLD Clock at 8Khzn");
  272. j->pld_clock.byte = 0;
  273. outb_p(j->pld_clock.byte, j->XILINXbase + 0x04);
  274. }
  275. }
  276. if (j->dsp.low == 0x20) {
  277. if (ixjdebug > 0)
  278. printk(KERN_INFO "Configure GPIO pinsn");
  279. j->gpio.bytes.high = 0x09;
  280. /*  bytes.low = 0xEF;  0xF7 */
  281. j->gpio.bits.gpio1 = 1;
  282. j->gpio.bits.gpio2 = 1;
  283. j->gpio.bits.gpio3 = 0;
  284. j->gpio.bits.gpio4 = 1;
  285. j->gpio.bits.gpio5 = 1;
  286. j->gpio.bits.gpio6 = 1;
  287. j->gpio.bits.gpio7 = 1;
  288. ixj_WriteDSPCommand(ixj[board].gpio.word, board); /* Set GPIO pin directions */
  289. if (ixjdebug > 0)
  290. printk(KERN_INFO "Enable SLICn");
  291. j->gpio.bytes.high = 0x0B;
  292. j->gpio.bytes.low = 0x00;
  293. j->gpio.bits.gpio1 = 0;
  294. j->gpio.bits.gpio2 = 1;
  295. j->gpio.bits.gpio5 = 0;
  296. ixj_WriteDSPCommand(ixj[board].gpio.word, board); /* send the ring stop signal */
  297. j->port = PORT_POTS;
  298. } else {
  299. if (j->cardtype == 300) {
  300. LED_SetState(0x1, board);
  301. jif = jiffies + (hertz / 10);
  302. while (time_before(jiffies, jif)) {
  303. current->state = TASK_INTERRUPTIBLE;
  304. schedule_timeout(1);
  305. }
  306. LED_SetState(0x2, board);
  307. jif = jiffies + (hertz / 10);
  308. while (time_before(jiffies, jif)) {
  309. current->state = TASK_INTERRUPTIBLE;
  310. schedule_timeout(1);
  311. }
  312. LED_SetState(0x4, board);
  313. jif = jiffies + (hertz / 10);
  314. while (time_before(jiffies, jif)) {
  315. current->state = TASK_INTERRUPTIBLE;
  316. schedule_timeout(1);
  317. }
  318. LED_SetState(0x8, board);
  319. jif = jiffies + (hertz / 10);
  320. while (time_before(jiffies, jif)) {
  321. current->state = TASK_INTERRUPTIBLE;
  322. schedule_timeout(1);
  323. }
  324. LED_SetState(0x0, board);
  325. daa_get_version(board);
  326. if (ixjdebug > 0)
  327. printk("Loading DAA Coefficientsn");
  328. DAA_Coeff_US(board);
  329. if (!ixj_daa_write(board))
  330. printk("DAA write failed on board %dn", board);
  331. ixj_daa_cid_reset(board);
  332. j->flags.pots_correct = 0;
  333. j->flags.pstn_present = 0;
  334. ixj_linetest(board);
  335. if (j->flags.pots_correct) {
  336. j->pld_scrw.bits.daafsyncen = 0; // Turn off DAA Frame Sync
  337. outb_p(j->pld_scrw.byte, j->XILINXbase);
  338. j->pld_slicw.bits.rly1 = 1;
  339. j->pld_slicw.bits.spken = 1;
  340. outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01);
  341. SLIC_SetState(PLD_SLIC_STATE_STANDBY, board);
  342. j->port = PORT_POTS;
  343. }
  344. if (ixjdebug > 0)
  345. printk(KERN_INFO "Enable Mixern");
  346. ixj_mixer(0x0000, board); //Master Volume Left unmute 0db
  347. ixj_mixer(0x0100, board); //Master Volume Right unmute 0db
  348. ixj_mixer(0x0F00, board); //Mono Out Volume unmute 0db
  349. ixj_mixer(0x0C00, board); //Mono1 Volume unmute 0db
  350. ixj_mixer(0x0200, board); //Voice Left Volume unmute 0db
  351. ixj_mixer(0x0300, board); //Voice Right Volume unmute 0db
  352. ixj_mixer(0x110C, board); //Voice Left and Right out
  353. ixj_mixer(0x1401, board); //Mono1 switch on mixer left
  354. ixj_mixer(0x1501, board); //Mono1 switch on mixer right
  355. ixj_mixer(0x1700, board); //Clock select
  356. ixj_mixer(0x1800, board); //ADC Source select
  357. } else {
  358. if (j->cardtype == 600)
  359. j->port = PORT_SPEAKER;
  360. else {
  361. j->port = PORT_POTS;
  362. SLIC_SetState(PLD_SLIC_STATE_STANDBY, board);
  363. }
  364. }
  365. }
  366. j->intercom = -1;
  367. j->framesread = j->frameswritten = 0;
  368. j->rxreadycheck = j->txreadycheck = 0;
  369. if (ixj_WriteDSPCommand(0x0000, board)) /* Write IDLE to Software Control Register */
  370. return -1;
  371. // The read values of the SSR should be 0x00 for the IDLE command
  372. if (j->ssr.low || j->ssr.high)
  373. return -1;
  374. if (ixjdebug > 0)
  375. printk(KERN_INFO "Enable Line Monitorn");
  376. if (ixjdebug > 0)
  377. printk(KERN_INFO "Set Line Monitor to Asyncronous Moden");
  378. if (ixj_WriteDSPCommand(0x7E01, board)) // Asynchronous Line Monitor
  379. return -1;
  380. if (ixjdebug > 0)
  381. printk(KERN_INFO "Enable DTMF Detectorsn");
  382. if (ixj_WriteDSPCommand(0x5151, board)) // Enable DTMF detection
  383. return -1;
  384. if (ixj_WriteDSPCommand(0x6E01, board)) // Set Asyncronous Tone Generation
  385. return -1;
  386. set_rec_depth(board, 2); // Set Record Channel Limit to 2 frames
  387. set_play_depth(board, 2); // Set Playback Channel Limit to 2 frames
  388. j->ex.bits.dtmf_ready = 0;
  389. j->dtmf_state = 0;
  390. j->dtmf_wp = ixj[board].dtmf_rp = 0;
  391. j->rec_mode = ixj[board].play_mode = -1;
  392. j->flags.ringing = 0;
  393. j->maxrings = MAXRINGS;
  394. j->ring_cadence = USA_RING_CADENCE;
  395. j->drybuffer = 0;
  396. j->winktime = 320;
  397. j->flags.dtmf_oob = 0;
  398. for (cnt = 0; cnt < 4; cnt++)
  399. j->cadence_f[cnt].enable = 0;
  400. /* must be a device on the specified address */
  401. /* Register with the Telephony for Linux subsystem */
  402. j->p.f_op = &ixj_fops;
  403. j->p.open = ixj_open;
  404. phone_register_device(&j->p, PHONE_UNIT_ANY);
  405. add_caps(board);
  406. return 0;
  407. }
  408. int ixj_read_proc(char *buf, char **start, off_t offset, int len, int unused)
  409. {
  410. int cnt;
  411. IXJ *j;
  412. len = 0;
  413. len += sprintf(buf + len, "n%s", ixj_c_rcsid);
  414. len += sprintf(buf + len, "n%s", ixj_h_rcsid);
  415. len += sprintf(buf + len, "n%s", ixjuser_h_rcsid);
  416. for (cnt = 0; cnt < IXJMAX; cnt++) {
  417. j = &ixj[cnt];
  418. if (j->DSPbase) {
  419. len += sprintf(buf + len, "nCard Num %d", cnt);
  420. len += sprintf(buf + len, "nDSP Base Address 0x%4.4x", j->DSPbase);
  421. if (j->cardtype != 100)
  422. len += sprintf(buf + len, "nXILINX Base Address 0x%4.4x", j->XILINXbase);
  423. len += sprintf(buf + len, "nDSP Type %2.2x%2.2x", j->dsp.high, j->dsp.low);
  424. len += sprintf(buf + len, "nDSP Version %2.2x.%2.2x", j->ver.high, j->ver.low);
  425. len += sprintf(buf + len, "nSerial Number %8.8x", j->serial);
  426. switch (j->cardtype) {
  427. case (100):
  428. len += sprintf(buf + len, "nCard Type = Internet PhoneJACK");
  429. break;
  430. case (300):
  431. len += sprintf(buf + len, "nCard Type = Internet LineJACK");
  432. if (j->flags.g729_loaded)
  433. len += sprintf(buf + len, " w/G.729 A/B");
  434. break;
  435. case (400):
  436. len += sprintf(buf + len, "nCard Type = Internet PhoneJACK Lite");
  437. if (j->flags.g729_loaded)
  438. len += sprintf(buf + len, " w/G.729 A/B");
  439. break;
  440. case (500):
  441. len += sprintf(buf + len, "nCard Type = Internet PhoneJACK PCI");
  442. if (j->flags.g729_loaded)
  443. len += sprintf(buf + len, " w/G.729 A/B");
  444. break;
  445. case (600):
  446. len += sprintf(buf + len, "nCard Type = Internet PhoneCARD");
  447. if (j->flags.g729_loaded)
  448. len += sprintf(buf + len, " w/G.729 A/B");
  449. len += sprintf(buf + len, "nSmart Cable %spresent", j->pccr1.bits.drf ? "not " : "");
  450. if (!j->pccr1.bits.drf)
  451. len += sprintf(buf + len, "nSmart Cable type %d", j->flags.pcmciasct);
  452. break;
  453. default:
  454. len += sprintf(buf + len, "nCard Type = %d", j->cardtype);
  455. break;
  456. }
  457. len += sprintf(buf + len, "nCapabilities %d", j->caps);
  458. if (j->dsp.low != 0x20)
  459. len += sprintf(buf + len, "nDSP Processor load %d", j->proc_load);
  460. len += sprintf(buf + len, "nPlay CODEC ");
  461. switch (j->play_codec) {
  462. case G723_63:
  463. len += sprintf(buf + len, "G.723.1 6.3");
  464. break;
  465. case G723_53:
  466. len += sprintf(buf + len, "G.723.1 5.3");
  467. break;
  468. case TS85:
  469. len += sprintf(buf + len, "TrueSpeech 8.5");
  470. break;
  471. case TS48:
  472. len += sprintf(buf + len, "TrueSpeech 4.8");
  473. break;
  474. case TS41:
  475. len += sprintf(buf + len, "TrueSpeech 4.1");
  476. break;
  477. case G728:
  478. len += sprintf(buf + len, "G.728");
  479. break;
  480. case G729:
  481. len += sprintf(buf + len, "G.729");
  482. break;
  483. case ULAW:
  484. len += sprintf(buf + len, "uLaw");
  485. break;
  486. case ALAW:
  487. len += sprintf(buf + len, "aLaw");
  488. break;
  489. case LINEAR16:
  490. len += sprintf(buf + len, "16 bit Linear");
  491. break;
  492. case LINEAR8:
  493. len += sprintf(buf + len, "8 bit Linear");
  494. break;
  495. case WSS:
  496. len += sprintf(buf + len, "Windows Sound System");
  497. break;
  498. default:
  499. len += sprintf(buf + len, "NO CODEC CHOSEN");
  500. break;
  501. }
  502. len += sprintf(buf + len, "nRecord CODEC ");
  503. switch (j->rec_codec) {
  504. case G723_63:
  505. len += sprintf(buf + len, "G.723.1 6.3");
  506. break;
  507. case G723_53:
  508. len += sprintf(buf + len, "G.723.1 5.3");
  509. break;
  510. case TS85:
  511. len += sprintf(buf + len, "TrueSpeech 8.5");
  512. break;
  513. case TS48:
  514. len += sprintf(buf + len, "TrueSpeech 4.8");
  515. break;
  516. case TS41:
  517. len += sprintf(buf + len, "TrueSpeech 4.1");
  518. break;
  519. case G728:
  520. len += sprintf(buf + len, "G.728");
  521. break;
  522. case G729:
  523. len += sprintf(buf + len, "G.729");
  524. break;
  525. case ULAW:
  526. len += sprintf(buf + len, "uLaw");
  527. break;
  528. case ALAW:
  529. len += sprintf(buf + len, "aLaw");
  530. break;
  531. case LINEAR16:
  532. len += sprintf(buf + len, "16 bit Linear");
  533. break;
  534. case LINEAR8:
  535. len += sprintf(buf + len, "8 bit Linear");
  536. break;
  537. case WSS:
  538. len += sprintf(buf + len, "Windows Sound System");
  539. break;
  540. default:
  541. len += sprintf(buf + len, "NO CODEC CHOSEN");
  542. break;
  543. }
  544. switch (j->aec_level) {
  545. case AEC_OFF:
  546. len += sprintf(buf + len, "n AEC OFF");
  547. break;
  548. case AEC_LOW:
  549. len += sprintf(buf + len, "n AEC LOW");
  550. break;
  551. case AEC_MED:
  552. len += sprintf(buf + len, "n AEC MED");
  553. break;
  554. case AEC_HIGH:
  555. len += sprintf(buf + len, "n AEC HIGH");
  556. break;
  557. }
  558. len += sprintf(buf + len, "nHook state %d", j->r_hook); // ixj_hookstate(cnt));
  559. if (j->cardtype == 300) {
  560. len += sprintf(buf + len, "nPOTS Correct %d", j->flags.pots_correct);
  561. len += sprintf(buf + len, "nPSTN Present %d", j->flags.pstn_present);
  562. len += sprintf(buf + len, "nPOTS to PSTN %d", j->flags.pots_pstn);
  563. switch (j->daa_mode) {
  564. case SOP_PU_SLEEP:
  565. len += sprintf(buf + len, "nDAA PSTN On Hook");
  566. break;
  567. case SOP_PU_RINGING:
  568. len += sprintf(buf + len, "nDAA PSTN Ringing");
  569. break;
  570. case SOP_PU_CONVERSATION:
  571. len += sprintf(buf + len, "nDAA PSTN Off Hook");
  572. break;
  573. case SOP_PU_PULSEDIALING:
  574. len += sprintf(buf + len, "nDAA PSTN Pulse Dialing");
  575. break;
  576. }
  577. }
  578. switch (j->port) {
  579. case PORT_POTS:
  580. len += sprintf(buf + len, "nPort POTS");
  581. break;
  582. case PORT_PSTN:
  583. len += sprintf(buf + len, "nPort PSTN");
  584. break;
  585. case PORT_SPEAKER:
  586. len += sprintf(buf + len, "nPort SPEAKER/MIC");
  587. break;
  588. case PORT_HANDSET:
  589. len += sprintf(buf + len, "nPort HANDSET");
  590. break;
  591. }
  592. if (j->dsp.low == 0x21 || j->dsp.low == 0x22) {
  593. len += sprintf(buf + len, "nSLIC state ");
  594. switch (SLIC_GetState(cnt)) {
  595. case PLD_SLIC_STATE_OC:
  596. len += sprintf(buf + len, "OC");
  597. break;
  598. case PLD_SLIC_STATE_RINGING:
  599. len += sprintf(buf + len, "RINGING");
  600. break;
  601. case PLD_SLIC_STATE_ACTIVE:
  602. len += sprintf(buf + len, "ACTIVE");
  603. break;
  604. case PLD_SLIC_STATE_OHT: // On-hook transmit
  605. len += sprintf(buf + len, "OHT");
  606. break;
  607. case PLD_SLIC_STATE_TIPOPEN:
  608. len += sprintf(buf + len, "TIPOPEN");
  609. break;
  610. case PLD_SLIC_STATE_STANDBY:
  611. len += sprintf(buf + len, "STANDBY");
  612. break;
  613. case PLD_SLIC_STATE_APR: // Active polarity reversal
  614. len += sprintf(buf + len, "APR");
  615. break;
  616. case PLD_SLIC_STATE_OHTPR: // OHT polarity reversal
  617. len += sprintf(buf + len, "OHTPR");
  618. break;
  619. default:
  620. len += sprintf(buf + len, "%d", SLIC_GetState(cnt));
  621. break;
  622. }
  623. }
  624. #ifdef PERFMON_STATS
  625. len += sprintf(buf + len, "nTimer Checks %ld", j->timerchecks);
  626. len += sprintf(buf + len, "nRX Ready Checks %ld", j->rxreadycheck);
  627. len += sprintf(buf + len, "nTX Ready Checks %ld", j->txreadycheck);
  628. len += sprintf(buf + len, "nBase Frame %2.2x.%2.2x", j->baseframe.high, j->baseframe.low);
  629. len += sprintf(buf + len, "nFrames Read %ld", j->framesread);
  630. len += sprintf(buf + len, "nFrames Written %ld", j->frameswritten);
  631. len += sprintf(buf + len, "nDry Buffer %ld", j->drybuffer);
  632. len += sprintf(buf + len, "nRead Waits %ld", j->read_wait);
  633. len += sprintf(buf + len, "nWrite Waits %ld", j->write_wait);
  634. #endif
  635. len += sprintf(buf + len, "n");
  636. }
  637. }
  638. return len;
  639. }
  640. static struct proc_dir_entry ixj_proc_entry =
  641. {
  642. 0,
  643. 3, "ixj",
  644. S_IFREG | S_IRUGO,
  645. 1, 0, 0,
  646. 0,
  647. NULL,
  648. &ixj_read_proc
  649. };
  650. MODULE_DESCRIPTION("Internet Phone/Internet LineJack module - www.quicknet.net");
  651. MODULE_AUTHOR("Ed Okerson <eokerson@quicknet.net>");
  652. #ifdef CONFIG_PCMCIA
  653. #ifdef PCMCIA_DEBUG
  654. static int pc_debug = PCMCIA_DEBUG;
  655. MODULE_PARM(pc_debug, "i");
  656. #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
  657. #else
  658. #define DEBUG(n, args...)
  659. #endif
  660. typedef struct ixj_info_t {
  661. int ndev;
  662. dev_node_t node;
  663. struct ixj *port;
  664. } ixj_info_t;
  665. static dev_link_t *ixj_attach(void);
  666. static void ixj_detach(dev_link_t *);
  667. static void ixj_config(dev_link_t * link);
  668. static void ixj_cs_release(u_long arg);
  669. static int ixj_event(event_t event, int priority,
  670.      event_callback_args_t * args);
  671. static dev_info_t dev_info = "ixj_cs";
  672. static dev_link_t *dev_list = NULL;
  673. static void cs_error(client_handle_t handle, int func, int ret)
  674. {
  675. error_info_t err =
  676. {func, ret};
  677. CardServices(ReportError, handle, &err);
  678. }
  679. static dev_link_t *ixj_attach(void)
  680. {
  681. client_reg_t client_reg;
  682. dev_link_t *link;
  683. int ret;
  684. DEBUG(0, "ixj_attach()n");
  685. /* Create new ixj device */
  686. link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
  687. memset(link, 0, sizeof(struct dev_link_t));
  688. link->release.function = &ixj_cs_release;
  689. link->release.data = (u_long) link;
  690. link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
  691. link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
  692. link->io.IOAddrLines = 3;
  693. link->conf.Vcc = 50;
  694. link->conf.IntType = INT_MEMORY_AND_IO;
  695. link->priv = kmalloc(sizeof(struct ixj_info_t), GFP_KERNEL);
  696. memset(link->priv, 0, sizeof(struct ixj_info_t));
  697. /* Register with Card Services */
  698. link->next = dev_list;
  699. dev_list = link;
  700. client_reg.dev_info = &dev_info;
  701. client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
  702. client_reg.EventMask =
  703.     CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
  704.     CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
  705.     CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
  706. client_reg.event_handler = &ixj_event;
  707. client_reg.Version = 0x0210;
  708. client_reg.event_callback_args.client_data = link;
  709. ret = CardServices(RegisterClient, &link->handle, &client_reg);
  710. if (ret != CS_SUCCESS) {
  711. cs_error(link->handle, RegisterClient, ret);
  712. ixj_detach(link);
  713. return NULL;
  714. }
  715. return link;
  716. }
  717. static void ixj_detach(dev_link_t * link)
  718. {
  719. dev_link_t **linkp;
  720. long flags;
  721. int ret;
  722. DEBUG(0, "ixj_detach(0x%p)n", link);
  723. for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
  724. if (*linkp == link)
  725. break;
  726. if (*linkp == NULL)
  727. return;
  728. save_flags(flags);
  729. cli();
  730. if (link->state & DEV_RELEASE_PENDING) {
  731. del_timer(&link->release);
  732. link->state &= ~DEV_RELEASE_PENDING;
  733. }
  734. restore_flags(flags);
  735. if (link->state & DEV_CONFIG)
  736. ixj_cs_release((u_long) link);
  737. if (link->handle) {
  738. ret = CardServices(DeregisterClient, link->handle);
  739. if (ret != CS_SUCCESS)
  740. cs_error(link->handle, DeregisterClient, ret);
  741. }
  742. /* Unlink device structure, free bits */
  743. *linkp = link->next;
  744. kfree_s(link->priv, sizeof(ixj_info_t));
  745. kfree_s(link, sizeof(struct dev_link_t));
  746. }
  747. #define CS_CHECK(fn, args...) 
  748. while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
  749. #define CFG_CHECK(fn, args...) 
  750. if (CardServices(fn, args) != 0) goto next_entry
  751. void ixj_get_serial(dev_link_t * link, IXJ * j)
  752. {
  753. client_handle_t handle;
  754. tuple_t tuple;
  755. u_short buf[128];
  756. char *str;
  757. int last_ret, last_fn, i, place;
  758. handle = link->handle;
  759. DEBUG(0, "ixj_get_serial(0x%p)n", link);
  760. tuple.TupleData = (cisdata_t *) buf;
  761. tuple.TupleOffset = 0;
  762. tuple.TupleDataMax = 80;
  763. tuple.Attributes = 0;
  764. tuple.DesiredTuple = CISTPL_VERS_1;
  765. CS_CHECK(GetFirstTuple, handle, &tuple);
  766. CS_CHECK(GetTupleData, handle, &tuple);
  767. str = (char *) buf;
  768. printk("PCMCIA Version %d.%dn", str[0], str[1]);
  769. str += 2;
  770. printk("%s", str);
  771. str = str + strlen(str) + 1;
  772. printk(" %s", str);
  773. str = str + strlen(str) + 1;
  774. place = 1;
  775. for (i = strlen(str) - 1; i >= 0; i--) {
  776. switch (str[i]) {
  777. case '0':
  778. case '1':
  779. case '2':
  780. case '3':
  781. case '4':
  782. case '5':
  783. case '6':
  784. case '7':
  785. case '8':
  786. case '9':
  787. j->serial += (str[i] - 48) * place;
  788. break;
  789. case 'A':
  790. case 'B':
  791. case 'C':
  792. case 'D':
  793. case 'E':
  794. case 'F':
  795. j->serial += (str[i] - 55) * place;
  796. break;
  797. case 'a':
  798. case 'b':
  799. case 'c':
  800. case 'd':
  801. case 'e':
  802. case 'f':
  803. j->serial += (str[i] - 87) * place;
  804. break;
  805. }
  806. place = place * 0x10;
  807. }
  808. str = str + strlen(str) + 1;
  809. printk(" version %sn", str);
  810.       cs_failed:
  811. return;
  812. }
  813. void ixj_config(dev_link_t * link)
  814. {
  815. client_handle_t handle;
  816. ixj_info_t *info;
  817. tuple_t tuple;
  818. u_short buf[128];
  819. cisparse_t parse;
  820. config_info_t conf;
  821. cistpl_cftable_entry_t *cfg = &parse.cftable_entry;
  822. cistpl_cftable_entry_t dflt =
  823. {0};
  824. int last_ret, last_fn;
  825. handle = link->handle;
  826. info = link->priv;
  827. DEBUG(0, "ixj_config(0x%p)n", link);
  828. tuple.TupleData = (cisdata_t *) buf;
  829. tuple.TupleOffset = 0;
  830. tuple.TupleDataMax = 255;
  831. tuple.Attributes = 0;
  832. tuple.DesiredTuple = CISTPL_CONFIG;
  833. CS_CHECK(GetFirstTuple, handle, &tuple);
  834. CS_CHECK(GetTupleData, handle, &tuple);
  835. CS_CHECK(ParseTuple, handle, &tuple, &parse);
  836. link->conf.ConfigBase = parse.config.base;
  837. link->conf.Present = parse.config.rmask[0];
  838. link->state |= DEV_CONFIG;
  839. CS_CHECK(GetConfigurationInfo, handle, &conf);
  840. tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
  841. tuple.Attributes = 0;
  842. CS_CHECK(GetFirstTuple, handle, &tuple);
  843. while (1) {
  844. CFG_CHECK(GetTupleData, handle, &tuple);
  845. CFG_CHECK(ParseTuple, handle, &tuple, &parse);
  846. if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
  847. cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
  848. link->conf.ConfigIndex = cfg->index;
  849. link->io.BasePort1 = io->win[0].base;
  850. link->io.NumPorts1 = io->win[0].len;
  851. if (io->nwin == 2) {
  852. link->io.BasePort2 = io->win[1].base;
  853. link->io.NumPorts2 = io->win[1].len;
  854. }
  855. CFG_CHECK(RequestIO, link->handle, &link->io);
  856. /* If we've got this far, we're done */
  857. break;
  858. }
  859.       next_entry:
  860. if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
  861. dflt = *cfg;
  862. CS_CHECK(GetNextTuple, handle, &tuple);
  863. }
  864. CS_CHECK(RequestConfiguration, handle, &link->conf);
  865. ixj[0].DSPbase = link->io.BasePort1;
  866. ixj[0].XILINXbase = link->io.BasePort1 + 0x10;
  867. ixj[0].cardtype = 600;
  868. ixj_selfprobe(0);
  869. info->ndev = 1;
  870. info->node.major = PHONE_MAJOR;
  871. link->dev = &info->node;
  872. ixj_get_serial(link, &ixj[0]);
  873. link->state &= ~DEV_CONFIG_PENDING;
  874. return;
  875.       cs_failed:
  876. cs_error(link->handle, last_fn, last_ret);
  877. ixj_cs_release((u_long) link);
  878. }
  879. void ixj_cs_release(u_long arg)
  880. {
  881. dev_link_t *link = (dev_link_t *) arg;
  882. ixj_info_t *info = link->priv;
  883. DEBUG(0, "ixj_cs_release(0x%p)n", link);
  884. info->ndev = 0;
  885. link->dev = NULL;
  886. CardServices(ReleaseConfiguration, link->handle);
  887. CardServices(ReleaseIO, link->handle, &link->io);
  888. link->state &= ~DEV_CONFIG;
  889. }
  890. int ixj_event(event_t event, int priority,
  891.       event_callback_args_t * args)
  892. {
  893. dev_link_t *link = args->client_data;
  894. DEBUG(1, "ixj_event(0x%06x)n", event);
  895. switch (event) {
  896. case CS_EVENT_CARD_REMOVAL:
  897. link->state &= ~DEV_PRESENT;
  898. if (link->state & DEV_CONFIG) {
  899. link->release.expires = RUN_AT(HZ / 20);
  900. link->state |= DEV_RELEASE_PENDING;
  901. add_timer(&link->release);
  902. }
  903. break;
  904. case CS_EVENT_CARD_INSERTION:
  905. link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
  906. ixj_config(link);
  907. break;
  908. case CS_EVENT_PM_SUSPEND:
  909. link->state |= DEV_SUSPEND;
  910. /* Fall through... */
  911. case CS_EVENT_RESET_PHYSICAL:
  912. if (link->state & DEV_CONFIG)
  913. CardServices(ReleaseConfiguration, link->handle);
  914. break;
  915. case CS_EVENT_PM_RESUME:
  916. link->state &= ~DEV_SUSPEND;
  917. /* Fall through... */
  918. case CS_EVENT_CARD_RESET:
  919. if (DEV_OK(link))
  920. CardServices(RequestConfiguration, link->handle, &link->conf);
  921. break;
  922. }
  923. return 0;
  924. }
  925. #endif // PCMCIA
  926. static void cleanup(void)
  927. {
  928. int cnt;
  929. del_timer(&ixj_timer);
  930. for (cnt = 0; cnt < IXJMAX; cnt++) {
  931. if (ixj[cnt].cardtype == 300) {
  932. ixj[cnt].pld_scrw.bits.daafsyncen = 0; // Turn off DAA Frame Sync
  933. outb_p(ixj[cnt].pld_scrw.byte, ixj[cnt].XILINXbase);
  934. ixj[cnt].pld_slicw.bits.rly1 = 0;
  935. ixj[cnt].pld_slicw.bits.rly2 = 0;
  936. ixj[cnt].pld_slicw.bits.rly3 = 0;
  937. outb_p(ixj[cnt].pld_slicw.byte, ixj[cnt].XILINXbase + 0x01);
  938. LED_SetState(0x0, cnt);
  939. release_region(ixj[cnt].XILINXbase, 8);
  940. }
  941. if (ixj[cnt].cardtype == 400 || ixj[cnt].cardtype == 500) {
  942. release_region(ixj[cnt].XILINXbase, 4);
  943. }
  944. if (ixj[cnt].DSPbase) {
  945. release_region(ixj[cnt].DSPbase, 16);
  946. phone_unregister_device(&ixj[cnt].p);
  947. }
  948. if (ixj[cnt].read_buffer)
  949. kfree(ixj[cnt].read_buffer);
  950. if (ixj[cnt].write_buffer)
  951. kfree(ixj[cnt].write_buffer);
  952. #ifdef CONFIG_ISAPNP
  953. if (ixj[cnt].dev)
  954. ixj[cnt].dev->deactivate(ixj[cnt].dev);
  955. #endif
  956. #ifdef CONFIG_PCMCIA
  957. DEBUG(0, "ixj_cs: unloadingn");
  958. unregister_pcmcia_driver(&dev_info);
  959. while (dev_list != NULL)
  960. ixj_detach(dev_list);
  961. #endif
  962. }
  963. proc_unregister(&proc_root, ixj_proc_entry.low_ino);
  964. }
  965. // Typedefs
  966. typedef struct {
  967. BYTE length;
  968. DWORD bits;
  969. } DATABLOCK;
  970. static void PCIEE_WriteBit(WORD wEEPROMAddress, BYTE lastLCC, BYTE byData)
  971. {
  972. lastLCC = lastLCC & 0xfb;
  973. lastLCC = lastLCC | (byData ? 4 : 0);
  974. outb(lastLCC, wEEPROMAddress); //set data out bit as appropriate
  975. udelay(1000);
  976. lastLCC = lastLCC | 0x01;
  977. outb(lastLCC, wEEPROMAddress); //SK rising edge
  978. byData = byData << 1;
  979. lastLCC = lastLCC & 0xfe;
  980. udelay(1000);
  981. outb(lastLCC, wEEPROMAddress); //after delay, SK falling edge
  982. }
  983. static BYTE PCIEE_ReadBit(WORD wEEPROMAddress, BYTE lastLCC)
  984. {
  985. udelay(1000);
  986. lastLCC = lastLCC | 0x01;
  987. outb(lastLCC, wEEPROMAddress); //SK rising edge
  988. lastLCC = lastLCC & 0xfe;
  989. udelay(1000);
  990. outb(lastLCC, wEEPROMAddress); //after delay, SK falling edge
  991. return ((inb(wEEPROMAddress) >> 3) & 1);
  992. }
  993. static BOOL PCIEE_ReadWord(WORD wAddress, WORD wLoc, WORD * pwResult)
  994. {
  995. BYTE lastLCC;
  996. WORD wEEPROMAddress = wAddress + 3;
  997. DWORD i;
  998. BYTE byResult;
  999. *pwResult = 0;
  1000. lastLCC = inb(wEEPROMAddress);
  1001. lastLCC = lastLCC | 0x02;
  1002. lastLCC = lastLCC & 0xfe;
  1003. outb(lastLCC, wEEPROMAddress); // CS hi, SK lo
  1004. udelay(1000); // delay
  1005. PCIEE_WriteBit(wEEPROMAddress, lastLCC, 1);
  1006. PCIEE_WriteBit(wEEPROMAddress, lastLCC, 1);
  1007. PCIEE_WriteBit(wEEPROMAddress, lastLCC, 0);
  1008. for (i = 0; i < 8; i++) {
  1009. PCIEE_WriteBit(wEEPROMAddress, lastLCC, wLoc & 0x80 ? 1 : 0);
  1010. wLoc <<= 1;
  1011. }
  1012. for (i = 0; i < 16; i++) {
  1013. byResult = PCIEE_ReadBit(wEEPROMAddress, lastLCC);
  1014. *pwResult = (*pwResult << 1) | byResult;
  1015. }
  1016. udelay(1000); // another delay
  1017. lastLCC = lastLCC & 0xfd;
  1018. outb(lastLCC, wEEPROMAddress); // negate CS
  1019. return 0;
  1020. }
  1021. static DWORD PCIEE_GetSerialNumber(WORD wAddress)
  1022. {
  1023. WORD wLo, wHi;
  1024. if (PCIEE_ReadWord(wAddress, 62, &wLo))
  1025. return 0;
  1026. if (PCIEE_ReadWord(wAddress, 63, &wHi))
  1027. return 0;
  1028. return (((DWORD) wHi << 16) | wLo);
  1029. }
  1030. #ifndef CONFIG_PCMCIA
  1031. #ifndef CONFIG_ISAPNP
  1032. static int dspio[IXJMAX + 1] =
  1033. {0,};
  1034. static int xio[IXJMAX + 1] =
  1035. {0,};
  1036. MODULE_PARM(dspio, "1-" __MODULE_STRING(IXJMAX) "i");
  1037. MODULE_PARM(xio, "1-" __MODULE_STRING(IXJMAX) "i");
  1038. #endif
  1039. #endif
  1040. #ifdef MODULE
  1041. void cleanup_module(void)
  1042. {
  1043. cleanup();
  1044. }
  1045. int init_module(void)
  1046. #else
  1047. int __init ixj_init(void)
  1048. #endif
  1049. {
  1050. int result;
  1051. int i = 0;
  1052. int cnt = 0;
  1053. int probe = 0;
  1054. #ifdef CONFIG_ISAPNP
  1055. int func = 0x110;
  1056. struct pnp_dev *dev = NULL, *old_dev = NULL;
  1057. #endif
  1058. #ifdef CONFIG_PCI
  1059. struct pci_dev *pci = NULL;
  1060. #endif
  1061. #ifdef CONFIG_PCMCIA
  1062. servinfo_t serv;
  1063. DEBUG(0, "%sn", version);
  1064. CardServices(GetCardServicesInfo, &serv);
  1065. if (serv.Revision != CS_RELEASE_CODE) {
  1066. printk(KERN_NOTICE "ixj_cs: Card Services release "
  1067.        "does not match!n");
  1068. return -1;
  1069. }
  1070. register_pcmcia_driver(&dev_info, &ixj_attach, &ixj_detach);
  1071. probe = 0;
  1072. #else
  1073. #ifdef CONFIG_ISAPNP
  1074. while (1) {
  1075. do {
  1076. old_dev = dev;
  1077. dev = isapnp_find_dev(NULL, ISAPNP_VENDOR('Q', 'T', 'I'),
  1078.  ISAPNP_FUNCTION(func), old_dev);
  1079. if (!dev)
  1080. break;
  1081. result = dev->prepare(dev);
  1082. if (result < 0) {
  1083. printk("preparing failed %d n", result);
  1084. break;
  1085. }
  1086. if (!(dev->resource[0].flags & IORESOURCE_IO))
  1087. return -ENODEV;
  1088. dev->resource[0].flags |= IORESOURCE_AUTO;
  1089. if (func != 0x110)
  1090. dev->resource[1].flags |= IORESOURCE_AUTO;
  1091. if (dev->activate(dev) < 0) {
  1092. printk("isapnp configure failed (out of resources?)n");
  1093. return -ENOMEM;
  1094. }
  1095. ixj[cnt].DSPbase = dev->resource[0].start; /* get real port */
  1096. if (func != 0x110)
  1097. ixj[cnt].XILINXbase = dev->resource[1].start; /* get real port */
  1098. result = check_region(ixj[cnt].DSPbase, 16);
  1099. if (result) {
  1100. printk(KERN_INFO "ixj: can't get I/O address 0x%xn", ixj[cnt].DSPbase);
  1101. cleanup();
  1102. return result;
  1103. }
  1104. request_region(ixj[cnt].DSPbase, 16, "ixj DSP");
  1105. switch (func) {
  1106. case (0x110):
  1107. ixj[cnt].cardtype = 100;
  1108. break;
  1109. case (0x310):
  1110. ixj[cnt].cardtype = 300;
  1111. break;
  1112. case (0x410):
  1113. ixj[cnt].cardtype = 400;
  1114. break;
  1115. }
  1116. probe = ixj_selfprobe(cnt);
  1117. ixj[cnt].serial = dev->bus->serial;
  1118. ixj[cnt].dev = dev;
  1119. switch (func) {
  1120. case 0x110:
  1121. printk(KERN_INFO "ixj: found Internet PhoneJACK at 0x%xn", ixj[cnt].DSPbase);
  1122. break;
  1123. case 0x310:
  1124. printk(KERN_INFO "ixj: found Internet LineJACK at 0x%xn", ixj[cnt].DSPbase);
  1125. break;
  1126. case 0x410:
  1127. printk(KERN_INFO "ixj: found Internet PhoneJACK Lite at 0x%xn", ixj[cnt].DSPbase);
  1128. break;
  1129. }
  1130. cnt++;
  1131. } while (dev);
  1132. if (func == 0x410)
  1133. break;
  1134. if (func == 0x310)
  1135. func = 0x410;
  1136. if (func == 0x110)
  1137. func = 0x310;
  1138. dev = NULL;
  1139. }
  1140. #else //CONFIG_ISAPNP
  1141. /* Use passed parameters for older kernels without PnP */
  1142. for (i = 0; i < IXJMAX; i++) {
  1143. if (dspio[i]) {
  1144. ixj[cnt].DSPbase = dspio[i];
  1145. ixj[cnt].XILINXbase = xio[i];
  1146. ixj[cnt].cardtype = 0;
  1147. result = check_region(ixj[cnt].DSPbase, 16);
  1148. if (result) {
  1149. printk(KERN_INFO "ixj: can't get I/O address 0x%xn", ixj[cnt].DSPbase);
  1150. cleanup();
  1151. return result;
  1152. }
  1153. request_region(ixj[cnt].DSPbase, 16, "ixj DSP");
  1154. probe = ixj_selfprobe(cnt);
  1155. ixj[cnt].dev = NULL;
  1156. cnt++;
  1157. }
  1158. }
  1159. #endif // !CONFIG_ISAPNP
  1160. #endif // CONFIG_PCMCIA
  1161. #ifdef CONFIG_PCI
  1162. if (pci_present()) {
  1163. for (i = 0; i < IXJMAX - cnt; i++) {
  1164. pci = pci_find_device(0x15E2, 0x0500, pci);
  1165. if (!pci)
  1166. break;
  1167. {
  1168. ixj[cnt].DSPbase = pci->base_address[0] & PCI_BASE_ADDRESS_IO_MASK;
  1169. ixj[cnt].XILINXbase = ixj[cnt].DSPbase + 0x10;
  1170. ixj[cnt].serial = PCIEE_GetSerialNumber(pci->base_address[2] & PCI_BASE_ADDRESS_IO_MASK);
  1171. result = check_region(ixj[cnt].DSPbase, 16);
  1172. if (result) {
  1173. printk(KERN_INFO "ixj: can't get I/O address 0x%xn", ixj[cnt].DSPbase);
  1174. cleanup();
  1175. return result;
  1176. }
  1177. request_region(ixj[cnt].DSPbase, 16, "ixj DSP");
  1178. ixj[cnt].cardtype = 500;
  1179. probe = ixj_selfprobe(cnt);
  1180. if (probe)
  1181. printk(KERN_INFO "ixj: found Internet PhoneJACK PCI at 0x%xn", ixj[cnt].DSPbase);
  1182. cnt++;
  1183. }
  1184. }
  1185. }
  1186. #endif
  1187. printk("%sn", ixj_c_rcsid);
  1188. proc_register(&proc_root, &ixj_proc_entry);
  1189. ixj_init_timer();
  1190. ixj_add_timer();
  1191. return probe;
  1192. }
  1193. static void DAA_Coeff_US(int board)
  1194. {
  1195. IXJ *j = &ixj[board];
  1196. int i;
  1197. //-----------------------------------------------
  1198. // CAO
  1199. for (i = 0; i < ALISDAA_CALLERID_SIZE; i++) {
  1200. j->m_DAAShadowRegs.CAO_REGS.CAO.CallerID[i] = 0;
  1201. }
  1202. // Bytes for IM-filter part 1 (04): 0E,32,E2,2F,C2,5A,C0,00
  1203. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[7] = 0x0E;
  1204. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[6] = 0x32;
  1205. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[5] = 0xE2;
  1206. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[4] = 0x2F;
  1207. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[3] = 0xC2;
  1208. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[2] = 0x5A;
  1209. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[1] = 0xC0;
  1210. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[0] = 0x00;
  1211. // Bytes for IM-filter part 2 (05): 72,85,00,0E,2B,3A,D0,08
  1212. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[7] = 0x72;
  1213. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[6] = 0x85;
  1214. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[5] = 0x00;
  1215. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[4] = 0x0E;
  1216. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[3] = 0x2B;
  1217. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[2] = 0x3A;
  1218. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[1] = 0xD0;
  1219. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[0] = 0x08;
  1220. // Bytes for FRX-filter       (08): 03,8F,48,F2,8F,48,70,08
  1221. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[7] = 0x03;
  1222. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[6] = 0x8F;
  1223. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[5] = 0x48;
  1224. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[4] = 0xF2;
  1225. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[3] = 0x8F;
  1226. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[2] = 0x48;
  1227. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[1] = 0x70;
  1228. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[0] = 0x08;
  1229. // Bytes for FRR-filter       (07): 04,8F,38,7F,9B,EA,B0,08
  1230. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[7] = 0x04;
  1231. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[6] = 0x8F;
  1232. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[5] = 0x38;
  1233. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[4] = 0x7F;
  1234. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[3] = 0x9B;
  1235. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[2] = 0xEA;
  1236. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[1] = 0xB0;
  1237. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[0] = 0x08;
  1238. // Bytes for AX-filter        (0A): 16,55,DD,CA
  1239. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[3] = 0x16;
  1240. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[2] = 0x55;
  1241. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[1] = 0xDD;
  1242. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[0] = 0xCA;
  1243. // Bytes for AR-filter        (09): 52,D3,11,42
  1244. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[3] = 0x52;
  1245. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[2] = 0xD3;
  1246. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[1] = 0x11;
  1247. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[0] = 0x42;
  1248. // Bytes for TH-filter part 1 (00): 00,42,48,81,B3,80,00,98
  1249. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[7] = 0x00;
  1250. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[6] = 0x42;
  1251. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[5] = 0x48;
  1252. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[4] = 0x81;
  1253. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[3] = 0xB3;
  1254. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[2] = 0x80;
  1255. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[1] = 0x00;
  1256. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[0] = 0x98;
  1257. // Bytes for TH-filter part 2 (01): 02,F2,33,A0,68,AB,8A,AD
  1258. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[7] = 0x02;
  1259. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[6] = 0xF2;
  1260. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[5] = 0x33;
  1261. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[4] = 0xA0;
  1262. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[3] = 0x68;
  1263. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[2] = 0xAB;
  1264. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[1] = 0x8A;
  1265. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[0] = 0xAD;
  1266. // Bytes for TH-filter part 3 (02): 00,88,DA,54,A4,BA,2D,BB
  1267. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[7] = 0x00;
  1268. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[6] = 0x88;
  1269. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[5] = 0xDA;
  1270. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[4] = 0x54;
  1271. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[3] = 0xA4;
  1272. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[2] = 0xBA;
  1273. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[1] = 0x2D;
  1274. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[0] = 0xBB;
  1275. // ;  (10K, 0.68uF)
  1276. // 
  1277. // Bytes for Ringing part 1 (03):1B,3B,9B,BA,D4,1C,B3,23
  1278. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[7] = 0x1B;
  1279. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[6] = 0x3B;
  1280. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[5] = 0x9B;
  1281. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[4] = 0xBA;
  1282. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[3] = 0xD4;
  1283. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[2] = 0x1C;
  1284. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[1] = 0xB3;
  1285. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[0] = 0x23;
  1286. // Bytes for Ringing part 2 (06):13,42,A6,BA,D4,73,CA,D5
  1287. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[7] = 0x13;
  1288. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[6] = 0x42;
  1289. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[5] = 0xA6;
  1290. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[4] = 0xBA;
  1291. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[3] = 0xD4;
  1292. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[2] = 0x73;
  1293. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[1] = 0xCA;
  1294. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[0] = 0xD5;
  1295. // 
  1296. // Levelmetering Ringing        (0D):B2,45,0F,8E      
  1297. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[3] = 0xB2;
  1298. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[2] = 0x45;
  1299. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[1] = 0x0F;
  1300. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[0] = 0x8E;
  1301. // Caller ID 1st Tone           (0E):CA,0E,CA,09,99,99,99,99
  1302. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[7] = 0xCA;
  1303. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[6] = 0x0E;
  1304. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[5] = 0xCA;
  1305. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[4] = 0x09;
  1306. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[3] = 0x99;
  1307. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[2] = 0x99;
  1308. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[1] = 0x99;
  1309. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[0] = 0x99;
  1310. // Caller ID 2nd Tone           (0F):FD,B5,BA,07,DA,00,00,00
  1311. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[7] = 0xFD;
  1312. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[6] = 0xB5;
  1313. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[5] = 0xBA;
  1314. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[4] = 0x07;
  1315. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[3] = 0xDA;
  1316. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[2] = 0x00;
  1317. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[1] = 0x00;
  1318. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[0] = 0x00;
  1319. // 
  1320. // ;CR Registers
  1321. // Config. Reg. 0 (filters)       (cr0):FE ; CLK gen. by crystal
  1322. j->m_DAAShadowRegs.SOP_REGS.SOP.cr0.reg = 0xFF;
  1323. // Config. Reg. 1 (dialing)       (cr1):05
  1324. j->m_DAAShadowRegs.SOP_REGS.SOP.cr1.reg = 0x05;
  1325. // Config. Reg. 2 (caller ID)     (cr2):04
  1326. j->m_DAAShadowRegs.SOP_REGS.SOP.cr2.reg = 0x04;
  1327. // Config. Reg. 3 (testloops)     (cr3):03 ; SEL Bit==0, HP-disabled
  1328. j->m_DAAShadowRegs.SOP_REGS.SOP.cr3.reg = 0x03;
  1329. // Config. Reg. 4 (analog gain)   (cr4):01
  1330. j->m_DAAShadowRegs.SOP_REGS.SOP.cr4.reg = 0x02; //0x01;
  1331. // Config. Reg. 5 (Version)       (cr5):02
  1332. // Config. Reg. 6 (Reserved)      (cr6):00
  1333. // Config. Reg. 7 (Reserved)      (cr7):00
  1334. // 
  1335. // ;xr Registers
  1336. // Ext. Reg. 0 (Interrupt Reg.)   (xr0):02
  1337. j->m_DAAShadowRegs.XOP_xr0_W.reg = 0x02; // SO_1 set to '1' because it is inverted.
  1338. // Ext. Reg. 1 (Interrupt enable) (xr1):1C // Cadence, RING, Caller ID, VDD_OK
  1339. j->m_DAAShadowRegs.XOP_REGS.XOP.xr1.reg = 0x3C;
  1340. // Ext. Reg. 2 (Cadence Time Out) (xr2):7D
  1341. j->m_DAAShadowRegs.XOP_REGS.XOP.xr2.reg = 0x7D;
  1342. // Ext. Reg. 3 (DC Char)          (xr3):32 ; B-Filter Off == 1
  1343. j->m_DAAShadowRegs.XOP_REGS.XOP.xr3.reg = 0x12; //0x32;
  1344. // Ext. Reg. 4 (Cadence)          (xr4):00
  1345. j->m_DAAShadowRegs.XOP_REGS.XOP.xr4.reg = 0x00;
  1346. // Ext. Reg. 5 (Ring timer)       (xr5):22
  1347. j->m_DAAShadowRegs.XOP_REGS.XOP.xr5.reg = 0x22;
  1348. // Ext. Reg. 6 (Power State)      (xr6):00
  1349. j->m_DAAShadowRegs.XOP_xr6_W.reg = 0x00;
  1350. // Ext. Reg. 7 (Vdd)              (xr7):40
  1351. j->m_DAAShadowRegs.XOP_REGS.XOP.xr7.reg = 0x40; // 0x40 ??? Should it be 0x00?
  1352. // 
  1353. // DTMF Tone 1                     (0B): 11,B3,5A,2C ;   697 Hz  
  1354. //                                       12,33,5A,C3 ;  770 Hz  
  1355. //                                       13,3C,5B,32 ;  852 Hz  
  1356. //                                       1D,1B,5C,CC ;  941 Hz  
  1357. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[3] = 0x11;
  1358. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[2] = 0xB3;
  1359. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[1] = 0x5A;
  1360. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[0] = 0x2C;
  1361. // DTMF Tone 2                     (0C): 32,32,52,B3 ;  1209 Hz  
  1362. //                                       EC,1D,52,22 ;  1336 Hz  
  1363. //                                       AA,AC,51,D2 ;  1477 Hz  
  1364. //                                       9B,3B,51,25 ;  1633 Hz  
  1365. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[3] = 0x32;
  1366. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[2] = 0x32;
  1367. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[1] = 0x52;
  1368. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[0] = 0xB3;
  1369. }
  1370. static void DAA_Coeff_UK(int board)
  1371. {
  1372. IXJ *j = &ixj[board];
  1373. int i;
  1374. //-----------------------------------------------
  1375. // CAO
  1376. for (i = 0; i < ALISDAA_CALLERID_SIZE; i++) {
  1377. j->m_DAAShadowRegs.CAO_REGS.CAO.CallerID[i] = 0;
  1378. }
  1379. //  Bytes for IM-filter part 1 (04): 00,C2,BB,A8,CB,81,A0,00
  1380. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[7] = 0x00;
  1381. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[6] = 0xC2;
  1382. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[5] = 0xBB;
  1383. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[4] = 0xA8;
  1384. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[3] = 0xCB;
  1385. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[2] = 0x81;
  1386. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[1] = 0xA0;
  1387. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[0] = 0x00;
  1388. // Bytes for IM-filter part 2 (05): 40,00,00,0A,A4,33,E0,08
  1389. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[7] = 0x40;
  1390. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[6] = 0x00;
  1391. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[5] = 0x00;
  1392. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[4] = 0x0A;
  1393. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[3] = 0xA4;
  1394. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[2] = 0x33;
  1395. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[1] = 0xE0;
  1396. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[0] = 0x08;
  1397. // Bytes for FRX-filter       (08): 07,9B,ED,24,B2,A2,A0,08
  1398. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[7] = 0x07;
  1399. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[6] = 0x9B;
  1400. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[5] = 0xED;
  1401. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[4] = 0x24;
  1402. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[3] = 0xB2;
  1403. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[2] = 0xA2;
  1404. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[1] = 0xA0;
  1405. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[0] = 0x08;
  1406. // Bytes for FRR-filter       (07): 0F,92,F2,B2,87,D2,30,08
  1407. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[7] = 0x0F;
  1408. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[6] = 0x92;
  1409. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[5] = 0xF2;
  1410. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[4] = 0xB2;
  1411. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[3] = 0x87;
  1412. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[2] = 0xD2;
  1413. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[1] = 0x30;
  1414. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[0] = 0x08;
  1415. // Bytes for AX-filter        (0A): 1B,A5,DD,CA
  1416. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[3] = 0x1B;
  1417. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[2] = 0xA5;
  1418. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[1] = 0xDD;
  1419. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[0] = 0xCA;
  1420. // Bytes for AR-filter        (09): E2,27,10,D6
  1421. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[3] = 0xE2;
  1422. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[2] = 0x27;
  1423. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[1] = 0x10;
  1424. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[0] = 0xD6;
  1425. // Bytes for TH-filter part 1 (00): 80,2D,38,8B,D0,00,00,98
  1426. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[7] = 0x80;
  1427. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[6] = 0x2D;
  1428. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[5] = 0x38;
  1429. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[4] = 0x8B;
  1430. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[3] = 0xD0;
  1431. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[2] = 0x00;
  1432. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[1] = 0x00;
  1433. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[0] = 0x98;
  1434. // Bytes for TH-filter part 2 (01): 02,5A,53,F0,0B,5F,84,D4
  1435. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[7] = 0x02;
  1436. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[6] = 0x5A;
  1437. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[5] = 0x53;
  1438. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[4] = 0xF0;
  1439. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[3] = 0x0B;
  1440. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[2] = 0x5F;
  1441. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[1] = 0x84;
  1442. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[0] = 0xD4;
  1443. // Bytes for TH-filter part 3 (02): 00,88,6A,A4,8F,52,F5,32
  1444. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[7] = 0x00;
  1445. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[6] = 0x88;
  1446. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[5] = 0x6A;
  1447. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[4] = 0xA4;
  1448. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[3] = 0x8F;
  1449. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[2] = 0x52;
  1450. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[1] = 0xF5;
  1451. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[0] = 0x32;
  1452. // ; idle
  1453. // Bytes for Ringing part 1 (03):1B,3C,93,3A,22,12,A3,23
  1454. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[7] = 0x1B;
  1455. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[6] = 0x3C;
  1456. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[5] = 0x93;
  1457. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[4] = 0x3A;
  1458. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[3] = 0x22;
  1459. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[2] = 0x12;
  1460. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[1] = 0xA3;
  1461. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[0] = 0x23;
  1462. // Bytes for Ringing part 2 (06):12,A2,A6,BA,22,7A,0A,D5
  1463. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[7] = 0x12;
  1464. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[6] = 0xA2;
  1465. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[5] = 0xA6;
  1466. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[4] = 0xBA;
  1467. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[3] = 0x22;
  1468. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[2] = 0x7A;
  1469. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[1] = 0x0A;
  1470. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[0] = 0xD5;
  1471. // Levelmetering Ringing           (0D):AA,35,0F,8E     ; 25Hz 30V less possible?
  1472. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[3] = 0xAA;
  1473. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[2] = 0x35;
  1474. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[1] = 0x0F;
  1475. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[0] = 0x8E;
  1476. // Caller ID 1st Tone              (0E):CA,0E,CA,09,99,99,99,99
  1477. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[7] = 0xCA;
  1478. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[6] = 0x0E;
  1479. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[5] = 0xCA;
  1480. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[4] = 0x09;
  1481. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[3] = 0x99;
  1482. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[2] = 0x99;
  1483. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[1] = 0x99;
  1484. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[0] = 0x99;
  1485. // Caller ID 2nd Tone              (0F):FD,B5,BA,07,DA,00,00,00
  1486. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[7] = 0xFD;
  1487. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[6] = 0xB5;
  1488. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[5] = 0xBA;
  1489. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[4] = 0x07;
  1490. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[3] = 0xDA;
  1491. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[2] = 0x00;
  1492. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[1] = 0x00;
  1493. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[0] = 0x00;
  1494. // ;CR Registers
  1495. // Config. Reg. 0 (filters)        (cr0):FF
  1496. j->m_DAAShadowRegs.SOP_REGS.SOP.cr0.reg = 0xFE;
  1497. // Config. Reg. 1 (dialing)        (cr1):05
  1498. j->m_DAAShadowRegs.SOP_REGS.SOP.cr1.reg = 0x05;
  1499. // Config. Reg. 2 (caller ID)      (cr2):04
  1500. j->m_DAAShadowRegs.SOP_REGS.SOP.cr2.reg = 0x04;
  1501. // Config. Reg. 3 (testloops)      (cr3):00        ; 
  1502. j->m_DAAShadowRegs.SOP_REGS.SOP.cr3.reg = 0x00;
  1503. // Config. Reg. 4 (analog gain)    (cr4):01
  1504. j->m_DAAShadowRegs.SOP_REGS.SOP.cr4.reg = 0x02; //0x01;
  1505. // Config. Reg. 5 (Version)        (cr5):02
  1506. // Config. Reg. 6 (Reserved)       (cr6):00
  1507. // Config. Reg. 7 (Reserved)       (cr7):00
  1508. // ;xr Registers
  1509. // Ext. Reg. 0 (Interrupt Reg.)    (xr0):02
  1510. j->m_DAAShadowRegs.XOP_xr0_W.reg = 0x02; // SO_1 set to '1' because it is inverted.
  1511. // Ext. Reg. 1 (Interrupt enable)  (xr1):1C
  1512. j->m_DAAShadowRegs.XOP_REGS.XOP.xr1.reg = 0x1C; // RING, Caller ID, VDD_OK
  1513. // Ext. Reg. 2 (Cadence Time Out)  (xr2):7D
  1514. j->m_DAAShadowRegs.XOP_REGS.XOP.xr2.reg = 0x7D;
  1515. // Ext. Reg. 3 (DC Char)           (xr3):36        ; 
  1516. j->m_DAAShadowRegs.XOP_REGS.XOP.xr3.reg = 0x36;
  1517. // Ext. Reg. 4 (Cadence)           (xr4):00
  1518. j->m_DAAShadowRegs.XOP_REGS.XOP.xr4.reg = 0x00;
  1519. // Ext. Reg. 5 (Ring timer)        (xr5):22
  1520. j->m_DAAShadowRegs.XOP_REGS.XOP.xr5.reg = 0x22;
  1521. // Ext. Reg. 6 (Power State)       (xr6):00
  1522. j->m_DAAShadowRegs.XOP_xr6_W.reg = 0x00;
  1523. // Ext. Reg. 7 (Vdd)               (xr7):46
  1524. j->m_DAAShadowRegs.XOP_REGS.XOP.xr7.reg = 0x46; // 0x46 ??? Should it be 0x00?
  1525. // DTMF Tone 1                     (0B): 11,B3,5A,2C    ;   697 Hz  
  1526. //                                       12,33,5A,C3    ;  770 Hz  
  1527. //                                       13,3C,5B,32    ;  852 Hz  
  1528. //                                       1D,1B,5C,CC    ;  941 Hz  
  1529. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[3] = 0x11;
  1530. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[2] = 0xB3;
  1531. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[1] = 0x5A;
  1532. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[0] = 0x2C;
  1533. // DTMF Tone 2                     (0C): 32,32,52,B3    ;  1209 Hz  
  1534. //                                       EC,1D,52,22    ;  1336 Hz  
  1535. //                                       AA,AC,51,D2    ;  1477 Hz  
  1536. //                                       9B,3B,51,25    ;  1633 Hz  
  1537. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[3] = 0x32;
  1538. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[2] = 0x32;
  1539. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[1] = 0x52;
  1540. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[0] = 0xB3;
  1541. }
  1542. static void DAA_Coeff_France(int board)
  1543. {
  1544. IXJ *j = &ixj[board];
  1545. int i;
  1546. //-----------------------------------------------
  1547. // CAO
  1548. for (i = 0; i < ALISDAA_CALLERID_SIZE; i++) {
  1549. j->m_DAAShadowRegs.CAO_REGS.CAO.CallerID[i] = 0;
  1550. }
  1551. // Bytes for IM-filter part 1 (04): 02,A2,43,2C,22,AF,A0,00
  1552. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[7] = 0x02;
  1553. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[6] = 0xA2;
  1554. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[5] = 0x43;
  1555. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[4] = 0x2C;
  1556. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[3] = 0x22;
  1557. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[2] = 0xAF;
  1558. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[1] = 0xA0;
  1559. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[0] = 0x00;
  1560. // Bytes for IM-filter part 2 (05): 67,CE,00,0C,22,33,E0,08
  1561. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[7] = 0x67;
  1562. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[6] = 0xCE;
  1563. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[5] = 0x00;
  1564. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[4] = 0x2C;
  1565. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[3] = 0x22;
  1566. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[2] = 0x33;
  1567. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[1] = 0xE0;
  1568. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[0] = 0x08;
  1569. // Bytes for FRX-filter       (08): 07,9A,28,F6,23,4A,B0,08
  1570. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[7] = 0x07;
  1571. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[6] = 0x9A;
  1572. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[5] = 0x28;
  1573. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[4] = 0xF6;
  1574. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[3] = 0x23;
  1575. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[2] = 0x4A;
  1576. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[1] = 0xB0;
  1577. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[0] = 0x08;
  1578. // Bytes for FRR-filter       (07): 03,8F,F9,2F,9E,FA,20,08
  1579. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[7] = 0x03;
  1580. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[6] = 0x8F;
  1581. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[5] = 0xF9;
  1582. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[4] = 0x2F;
  1583. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[3] = 0x9E;
  1584. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[2] = 0xFA;
  1585. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[1] = 0x20;
  1586. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[0] = 0x08;
  1587. // Bytes for AX-filter        (0A): 16,B5,DD,CA
  1588. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[3] = 0x16;
  1589. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[2] = 0xB5;
  1590. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[1] = 0xDD;
  1591. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[0] = 0xCA;
  1592. // Bytes for AR-filter        (09): 52,C7,10,D6
  1593. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[3] = 0xE2;
  1594. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[2] = 0xC7;
  1595. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[1] = 0x10;
  1596. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[0] = 0xD6;
  1597. // Bytes for TH-filter part 1 (00): 00,42,48,81,A6,80,00,98
  1598. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[7] = 0x00;
  1599. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[6] = 0x42;
  1600. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[5] = 0x48;
  1601. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[4] = 0x81;
  1602. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[3] = 0xA6;
  1603. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[2] = 0x80;
  1604. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[1] = 0x00;
  1605. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[0] = 0x98;
  1606. // Bytes for TH-filter part 2 (01): 02,AC,2A,30,78,AC,8A,2C
  1607. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[7] = 0x02;
  1608. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[6] = 0xAC;
  1609. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[5] = 0x2A;
  1610. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[4] = 0x30;
  1611. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[3] = 0x78;
  1612. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[2] = 0xAC;
  1613. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[1] = 0x8A;
  1614. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[0] = 0x2C;
  1615. // Bytes for TH-filter part 3 (02): 00,88,DA,A5,22,BA,2C,45
  1616. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[7] = 0x00;
  1617. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[6] = 0x88;
  1618. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[5] = 0xDA;
  1619. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[4] = 0xA5;
  1620. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[3] = 0x22;
  1621. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[2] = 0xBA;
  1622. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[1] = 0x2C;
  1623. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[0] = 0x45;
  1624. // ; idle
  1625. // Bytes for Ringing part 1 (03):1B,3C,93,3A,22,12,A3,23
  1626. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[7] = 0x1B;
  1627. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[6] = 0x3C;
  1628. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[5] = 0x93;
  1629. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[4] = 0x3A;
  1630. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[3] = 0x22;
  1631. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[2] = 0x12;
  1632. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[1] = 0xA3;
  1633. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[0] = 0x23;
  1634. // Bytes for Ringing part 2 (06):12,A2,A6,BA,22,7A,0A,D5
  1635. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[7] = 0x12;
  1636. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[6] = 0xA2;
  1637. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[5] = 0xA6;
  1638. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[4] = 0xBA;
  1639. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[3] = 0x22;
  1640. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[2] = 0x7A;
  1641. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[1] = 0x0A;
  1642. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[0] = 0xD5;
  1643. // Levelmetering Ringing           (0D):32,45,B5,84     ; 50Hz 20V
  1644. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[3] = 0x32;
  1645. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[2] = 0x45;
  1646. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[1] = 0xB5;
  1647. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[0] = 0x84;
  1648. // Caller ID 1st Tone              (0E):CA,0E,CA,09,99,99,99,99
  1649. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[7] = 0xCA;
  1650. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[6] = 0x0E;
  1651. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[5] = 0xCA;
  1652. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[4] = 0x09;
  1653. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[3] = 0x99;
  1654. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[2] = 0x99;
  1655. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[1] = 0x99;
  1656. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[0] = 0x99;
  1657. // Caller ID 2nd Tone              (0F):FD,B5,BA,07,DA,00,00,00
  1658. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[7] = 0xFD;
  1659. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[6] = 0xB5;
  1660. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[5] = 0xBA;
  1661. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[4] = 0x07;
  1662. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[3] = 0xDA;
  1663. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[2] = 0x00;
  1664. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[1] = 0x00;
  1665. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[0] = 0x00;
  1666. // ;CR Registers
  1667. // Config. Reg. 0 (filters)        (cr0):FF
  1668. j->m_DAAShadowRegs.SOP_REGS.SOP.cr0.reg = 0xFE;
  1669. // Config. Reg. 1 (dialing)        (cr1):05
  1670. j->m_DAAShadowRegs.SOP_REGS.SOP.cr1.reg = 0x05;
  1671. // Config. Reg. 2 (caller ID)      (cr2):04
  1672. j->m_DAAShadowRegs.SOP_REGS.SOP.cr2.reg = 0x04;
  1673. // Config. Reg. 3 (testloops)      (cr3):00        ; 
  1674. j->m_DAAShadowRegs.SOP_REGS.SOP.cr3.reg = 0x00;
  1675. // Config. Reg. 4 (analog gain)    (cr4):01
  1676. j->m_DAAShadowRegs.SOP_REGS.SOP.cr4.reg = 0x02; //0x01;
  1677. // Config. Reg. 5 (Version)        (cr5):02
  1678. // Config. Reg. 6 (Reserved)       (cr6):00
  1679. // Config. Reg. 7 (Reserved)       (cr7):00
  1680. // ;xr Registers
  1681. // Ext. Reg. 0 (Interrupt Reg.)    (xr0):02
  1682. j->m_DAAShadowRegs.XOP_xr0_W.reg = 0x02; // SO_1 set to '1' because it is inverted.
  1683. // Ext. Reg. 1 (Interrupt enable)  (xr1):1C
  1684. j->m_DAAShadowRegs.XOP_REGS.XOP.xr1.reg = 0x1C; // RING, Caller ID, VDD_OK
  1685. // Ext. Reg. 2 (Cadence Time Out)  (xr2):7D
  1686. j->m_DAAShadowRegs.XOP_REGS.XOP.xr2.reg = 0x7D;
  1687. // Ext. Reg. 3 (DC Char)           (xr3):36        ; 
  1688. j->m_DAAShadowRegs.XOP_REGS.XOP.xr3.reg = 0x36;
  1689. // Ext. Reg. 4 (Cadence)           (xr4):00
  1690. j->m_DAAShadowRegs.XOP_REGS.XOP.xr4.reg = 0x00;
  1691. // Ext. Reg. 5 (Ring timer)        (xr5):22
  1692. j->m_DAAShadowRegs.XOP_REGS.XOP.xr5.reg = 0x22;
  1693. // Ext. Reg. 6 (Power State)       (xr6):00
  1694. j->m_DAAShadowRegs.XOP_xr6_W.reg = 0x00;
  1695. // Ext. Reg. 7 (Vdd)               (xr7):46
  1696. j->m_DAAShadowRegs.XOP_REGS.XOP.xr7.reg = 0x46; // 0x46 ??? Should it be 0x00?
  1697. // DTMF Tone 1                     (0B): 11,B3,5A,2C    ;   697 Hz  
  1698. //                                       12,33,5A,C3    ;  770 Hz  
  1699. //                                       13,3C,5B,32    ;  852 Hz  
  1700. //                                       1D,1B,5C,CC    ;  941 Hz  
  1701. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[3] = 0x11;
  1702. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[2] = 0xB3;
  1703. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[1] = 0x5A;
  1704. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[0] = 0x2C;
  1705. // DTMF Tone 2                     (0C): 32,32,52,B3    ;  1209 Hz  
  1706. //                                       EC,1D,52,22    ;  1336 Hz  
  1707. //                                       AA,AC,51,D2    ;  1477 Hz  
  1708. //                                       9B,3B,51,25    ;  1633 Hz  
  1709. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[3] = 0x32;
  1710. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[2] = 0x32;
  1711. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[1] = 0x52;
  1712. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[0] = 0xB3;
  1713. }
  1714. static void DAA_Coeff_Germany(int board)
  1715. {
  1716. IXJ *j = &ixj[board];
  1717. int i;
  1718. //-----------------------------------------------
  1719. // CAO
  1720. for (i = 0; i < ALISDAA_CALLERID_SIZE; i++) {
  1721. j->m_DAAShadowRegs.CAO_REGS.CAO.CallerID[i] = 0;
  1722. }
  1723. // Bytes for IM-filter part 1 (04): 00,CE,BB,B8,D2,81,B0,00
  1724. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[7] = 0x00;
  1725. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[6] = 0xCE;
  1726. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[5] = 0xBB;
  1727. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[4] = 0xB8;
  1728. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[3] = 0xD2;
  1729. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[2] = 0x81;
  1730. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[1] = 0xB0;
  1731. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[0] = 0x00;
  1732. // Bytes for IM-filter part 2 (05): 45,8F,00,0C,D2,3A,D0,08
  1733. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[7] = 0x45;
  1734. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[6] = 0x8F;
  1735. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[5] = 0x00;
  1736. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[4] = 0x0C;
  1737. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[3] = 0xD2;
  1738. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[2] = 0x3A;
  1739. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[1] = 0xD0;
  1740. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[0] = 0x08;
  1741. // Bytes for FRX-filter       (08): 07,AA,E2,34,24,89,20,08
  1742. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[7] = 0x07;
  1743. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[6] = 0xAA;
  1744. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[5] = 0xE2;
  1745. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[4] = 0x34;
  1746. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[3] = 0x24;
  1747. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[2] = 0x89;
  1748. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[1] = 0x20;
  1749. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[0] = 0x08;
  1750. // Bytes for FRR-filter       (07): 02,87,FA,37,9A,CA,B0,08
  1751. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[7] = 0x02;
  1752. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[6] = 0x87;
  1753. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[5] = 0xFA;
  1754. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[4] = 0x37;
  1755. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[3] = 0x9A;
  1756. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[2] = 0xCA;
  1757. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[1] = 0xB0;
  1758. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[0] = 0x08;
  1759. // Bytes for AX-filter        (0A): 72,D5,DD,CA
  1760. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[3] = 0x72;
  1761. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[2] = 0xD5;
  1762. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[1] = 0xDD;
  1763. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[0] = 0xCA;
  1764. // Bytes for AR-filter        (09): 72,42,13,4B
  1765. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[3] = 0x72;
  1766. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[2] = 0x42;
  1767. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[1] = 0x13;
  1768. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[0] = 0x4B;
  1769. // Bytes for TH-filter part 1 (00): 80,52,48,81,AD,80,00,98
  1770. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[7] = 0x80;
  1771. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[6] = 0x52;
  1772. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[5] = 0x48;
  1773. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[4] = 0x81;
  1774. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[3] = 0xAD;
  1775. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[2] = 0x80;
  1776. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[1] = 0x00;
  1777. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[0] = 0x98;
  1778. // Bytes for TH-filter part 2 (01): 02,42,5A,20,E8,1A,81,27
  1779. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[7] = 0x02;
  1780. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[6] = 0x42;
  1781. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[5] = 0x5A;
  1782. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[4] = 0x20;
  1783. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[3] = 0xE8;
  1784. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[2] = 0x1A;
  1785. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[1] = 0x81;
  1786. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[0] = 0x27;
  1787. // Bytes for TH-filter part 3 (02): 00,88,63,26,BD,4B,A3,C2
  1788. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[7] = 0x00;
  1789. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[6] = 0x88;
  1790. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[5] = 0x63;
  1791. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[4] = 0x26;
  1792. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[3] = 0xBD;
  1793. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[2] = 0x4B;
  1794. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[1] = 0xA3;
  1795. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[0] = 0xC2;
  1796. // ;  (10K, 0.68uF)
  1797. // Bytes for Ringing part 1 (03):1B,3B,9B,BA,D4,1C,B3,23
  1798. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[7] = 0x1B;
  1799. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[6] = 0x3B;
  1800. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[5] = 0x9B;
  1801. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[4] = 0xBA;
  1802. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[3] = 0xD4;
  1803. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[2] = 0x1C;
  1804. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[1] = 0xB3;
  1805. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[0] = 0x23;
  1806. // Bytes for Ringing part 2 (06):13,42,A6,BA,D4,73,CA,D5
  1807. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[7] = 0x13;
  1808. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[6] = 0x42;
  1809. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[5] = 0xA6;
  1810. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[4] = 0xBA;
  1811. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[3] = 0xD4;
  1812. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[2] = 0x73;
  1813. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[1] = 0xCA;
  1814. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[0] = 0xD5;
  1815. // Levelmetering Ringing        (0D):B2,45,0F,8E      
  1816. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[3] = 0xB2;
  1817. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[2] = 0x45;
  1818. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[1] = 0x0F;
  1819. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[0] = 0x8E;
  1820. // Caller ID 1st Tone           (0E):CA,0E,CA,09,99,99,99,99
  1821. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[7] = 0xCA;
  1822. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[6] = 0x0E;
  1823. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[5] = 0xCA;
  1824. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[4] = 0x09;
  1825. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[3] = 0x99;
  1826. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[2] = 0x99;
  1827. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[1] = 0x99;
  1828. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[0] = 0x99;
  1829. // Caller ID 2nd Tone           (0F):FD,B5,BA,07,DA,00,00,00
  1830. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[7] = 0xFD;
  1831. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[6] = 0xB5;
  1832. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[5] = 0xBA;
  1833. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[4] = 0x07;
  1834. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[3] = 0xDA;
  1835. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[2] = 0x00;
  1836. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[1] = 0x00;
  1837. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[0] = 0x00;
  1838. // ;CR Registers
  1839. // Config. Reg. 0 (filters)        (cr0):FF ; all Filters enabled, CLK from ext. source
  1840. j->m_DAAShadowRegs.SOP_REGS.SOP.cr0.reg = 0xFE;
  1841. // Config. Reg. 1 (dialing)        (cr1):05 ; Manual Ring, Ring metering enabled
  1842. j->m_DAAShadowRegs.SOP_REGS.SOP.cr1.reg = 0x05;
  1843. // Config. Reg. 2 (caller ID)      (cr2):04 ; Analog Gain 0dB, FSC internal
  1844. j->m_DAAShadowRegs.SOP_REGS.SOP.cr2.reg = 0x04;
  1845. // Config. Reg. 3 (testloops)      (cr3):00 ; SEL Bit==0, HP-enabled
  1846. j->m_DAAShadowRegs.SOP_REGS.SOP.cr3.reg = 0x00;
  1847. // Config. Reg. 4 (analog gain)    (cr4):01
  1848. j->m_DAAShadowRegs.SOP_REGS.SOP.cr4.reg = 0x02; //0x01;
  1849. // Config. Reg. 5 (Version)        (cr5):02
  1850. // Config. Reg. 6 (Reserved)       (cr6):00
  1851. // Config. Reg. 7 (Reserved)       (cr7):00
  1852. // ;xr Registers
  1853. // Ext. Reg. 0 (Interrupt Reg.)    (xr0):02
  1854. j->m_DAAShadowRegs.XOP_xr0_W.reg = 0x02; // SO_1 set to '1' because it is inverted.
  1855. // Ext. Reg. 1 (Interrupt enable)  (xr1):1C ; Ring, CID, VDDOK Interrupts enabled
  1856. j->m_DAAShadowRegs.XOP_REGS.XOP.xr1.reg = 0x1C; // RING, Caller ID, VDD_OK
  1857. // Ext. Reg. 2 (Cadence Time Out)  (xr2):7D
  1858. j->m_DAAShadowRegs.XOP_REGS.XOP.xr2.reg = 0x7D;
  1859. // Ext. Reg. 3 (DC Char)           (xr3):32 ; B-Filter Off==1, U0=3.5V, R=200Ohm
  1860. j->m_DAAShadowRegs.XOP_REGS.XOP.xr3.reg = 0x32;
  1861. // Ext. Reg. 4 (Cadence)           (xr4):00
  1862. j->m_DAAShadowRegs.XOP_REGS.XOP.xr4.reg = 0x00;
  1863. // Ext. Reg. 5 (Ring timer)        (xr5):22
  1864. j->m_DAAShadowRegs.XOP_REGS.XOP.xr5.reg = 0x22;
  1865. // Ext. Reg. 6 (Power State)       (xr6):00
  1866. j->m_DAAShadowRegs.XOP_xr6_W.reg = 0x00;
  1867. // Ext. Reg. 7 (Vdd)               (xr7):40 ; VDD=4.25 V
  1868. j->m_DAAShadowRegs.XOP_REGS.XOP.xr7.reg = 0x40; // 0x40 ??? Should it be 0x00?
  1869. // DTMF Tone 1                     (0B): 11,B3,5A,2C    ;   697 Hz  
  1870. //                                       12,33,5A,C3    ;  770 Hz  
  1871. //                                       13,3C,5B,32    ;  852 Hz  
  1872. //                                       1D,1B,5C,CC    ;  941 Hz  
  1873. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[3] = 0x11;
  1874. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[2] = 0xB3;
  1875. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[1] = 0x5A;
  1876. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[0] = 0x2C;
  1877. // DTMF Tone 2                     (0C): 32,32,52,B3    ;  1209 Hz  
  1878. //                                       EC,1D,52,22    ;  1336 Hz  
  1879. //                                       AA,AC,51,D2    ;  1477 Hz  
  1880. //                                       9B,3B,51,25    ;  1633 Hz  
  1881. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[3] = 0x32;
  1882. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[2] = 0x32;
  1883. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[1] = 0x52;
  1884. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[0] = 0xB3;
  1885. }
  1886. static void DAA_Coeff_Australia(int board)
  1887. {
  1888. IXJ *j = &ixj[board];
  1889. int i;
  1890. //-----------------------------------------------
  1891. // CAO
  1892. for (i = 0; i < ALISDAA_CALLERID_SIZE; i++) {
  1893. j->m_DAAShadowRegs.CAO_REGS.CAO.CallerID[i] = 0;
  1894. }
  1895. // Bytes for IM-filter part 1 (04): 00,A3,AA,28,B3,82,D0,00
  1896. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[7] = 0x00;
  1897. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[6] = 0xA3;
  1898. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[5] = 0xAA;
  1899. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[4] = 0x28;
  1900. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[3] = 0xB3;
  1901. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[2] = 0x82;
  1902. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[1] = 0xD0;
  1903. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[0] = 0x00;
  1904. // Bytes for IM-filter part 2 (05): 70,96,00,09,32,6B,C0,08
  1905. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[7] = 0x70;
  1906. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[6] = 0x96;
  1907. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[5] = 0x00;
  1908. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[4] = 0x09;
  1909. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[3] = 0x32;
  1910. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[2] = 0x6B;
  1911. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[1] = 0xC0;
  1912. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[0] = 0x08;
  1913. // Bytes for FRX-filter       (08): 07,96,E2,34,32,9B,30,08
  1914. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[7] = 0x07;
  1915. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[6] = 0x96;
  1916. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[5] = 0xE2;
  1917. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[4] = 0x34;
  1918. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[3] = 0x32;
  1919. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[2] = 0x9B;
  1920. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[1] = 0x30;
  1921. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[0] = 0x08;
  1922. // Bytes for FRR-filter       (07): 0F,9A,E9,2F,22,CC,A0,08
  1923. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[7] = 0x0F;
  1924. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[6] = 0x9A;
  1925. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[5] = 0xE9;
  1926. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[4] = 0x2F;
  1927. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[3] = 0x22;
  1928. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[2] = 0xCC;
  1929. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[1] = 0xA0;
  1930. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[0] = 0x08;
  1931. // Bytes for AX-filter        (0A): CB,45,DD,CA
  1932. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[3] = 0xCB;
  1933. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[2] = 0x45;
  1934. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[1] = 0xDD;
  1935. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[0] = 0xCA;
  1936. // Bytes for AR-filter        (09): 1B,67,10,D6
  1937. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[3] = 0x1B;
  1938. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[2] = 0x67;
  1939. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[1] = 0x10;
  1940. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[0] = 0xD6;
  1941. // Bytes for TH-filter part 1 (00): 80,52,48,81,AF,80,00,98
  1942. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[7] = 0x80;
  1943. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[6] = 0x52;
  1944. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[5] = 0x48;
  1945. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[4] = 0x81;
  1946. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[3] = 0xAF;
  1947. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[2] = 0x80;
  1948. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[1] = 0x00;
  1949. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[0] = 0x98;
  1950. // Bytes for TH-filter part 2 (01): 02,DB,52,B0,38,01,82,AC
  1951. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[7] = 0x02;
  1952. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[6] = 0xDB;
  1953. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[5] = 0x52;
  1954. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[4] = 0xB0;
  1955. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[3] = 0x38;
  1956. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[2] = 0x01;
  1957. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[1] = 0x82;
  1958. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[0] = 0xAC;
  1959. // Bytes for TH-filter part 3 (02): 00,88,4A,3E,2C,3B,24,46
  1960. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[7] = 0x00;
  1961. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[6] = 0x88;
  1962. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[5] = 0x4A;
  1963. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[4] = 0x3E;
  1964. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[3] = 0x2C;
  1965. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[2] = 0x3B;
  1966. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[1] = 0x24;
  1967. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[0] = 0x46;
  1968. // ;  idle
  1969. // Bytes for Ringing part 1 (03):1B,3C,93,3A,22,12,A3,23
  1970. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[7] = 0x1B;
  1971. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[6] = 0x3C;
  1972. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[5] = 0x93;
  1973. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[4] = 0x3A;
  1974. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[3] = 0x22;
  1975. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[2] = 0x12;
  1976. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[1] = 0xA3;
  1977. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[0] = 0x23;
  1978. // Bytes for Ringing part 2 (06):12,A2,A6,BA,22,7A,0A,D5
  1979. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[7] = 0x12;
  1980. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[6] = 0xA2;
  1981. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[5] = 0xA6;
  1982. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[4] = 0xBA;
  1983. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[3] = 0x22;
  1984. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[2] = 0x7A;
  1985. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[1] = 0x0A;
  1986. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[0] = 0xD5;
  1987. // Levelmetering Ringing           (0D):32,45,B5,84   ; 50Hz 20V
  1988. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[3] = 0x32;
  1989. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[2] = 0x45;
  1990. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[1] = 0xB5;
  1991. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[0] = 0x84;
  1992. // Caller ID 1st Tone              (0E):CA,0E,CA,09,99,99,99,99
  1993. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[7] = 0xCA;
  1994. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[6] = 0x0E;
  1995. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[5] = 0xCA;
  1996. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[4] = 0x09;
  1997. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[3] = 0x99;
  1998. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[2] = 0x99;
  1999. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[1] = 0x99;
  2000. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[0] = 0x99;
  2001. // Caller ID 2nd Tone              (0F):FD,B5,BA,07,DA,00,00,00
  2002. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[7] = 0xFD;
  2003. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[6] = 0xB5;
  2004. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[5] = 0xBA;
  2005. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[4] = 0x07;
  2006. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[3] = 0xDA;
  2007. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[2] = 0x00;
  2008. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[1] = 0x00;
  2009. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[0] = 0x00;
  2010. // ;CR Registers
  2011. // Config. Reg. 0 (filters)        (cr0):FF
  2012. j->m_DAAShadowRegs.SOP_REGS.SOP.cr0.reg = 0xFF;
  2013. // Config. Reg. 1 (dialing)        (cr1):05
  2014. j->m_DAAShadowRegs.SOP_REGS.SOP.cr1.reg = 0x05;
  2015. // Config. Reg. 2 (caller ID)      (cr2):04
  2016. j->m_DAAShadowRegs.SOP_REGS.SOP.cr2.reg = 0x04;
  2017. // Config. Reg. 3 (testloops)      (cr3):00        ; 
  2018. j->m_DAAShadowRegs.SOP_REGS.SOP.cr3.reg = 0x00;
  2019. // Config. Reg. 4 (analog gain)    (cr4):01
  2020. j->m_DAAShadowRegs.SOP_REGS.SOP.cr4.reg = 0x02; //0x01;
  2021. // Config. Reg. 5 (Version)        (cr5):02
  2022. // Config. Reg. 6 (Reserved)       (cr6):00
  2023. // Config. Reg. 7 (Reserved)       (cr7):00
  2024. // ;xr Registers
  2025. // Ext. Reg. 0 (Interrupt Reg.)    (xr0):02
  2026. j->m_DAAShadowRegs.XOP_xr0_W.reg = 0x02; // SO_1 set to '1' because it is inverted.
  2027. // Ext. Reg. 1 (Interrupt enable)  (xr1):1C
  2028. j->m_DAAShadowRegs.XOP_REGS.XOP.xr1.reg = 0x1C; // RING, Caller ID, VDD_OK
  2029. // Ext. Reg. 2 (Cadence Time Out)  (xr2):7D
  2030. j->m_DAAShadowRegs.XOP_REGS.XOP.xr2.reg = 0x7D;
  2031. // Ext. Reg. 3 (DC Char)           (xr3):2B      ; 
  2032. j->m_DAAShadowRegs.XOP_REGS.XOP.xr3.reg = 0x2B;
  2033. // Ext. Reg. 4 (Cadence)           (xr4):00
  2034. j->m_DAAShadowRegs.XOP_REGS.XOP.xr4.reg = 0x00;
  2035. // Ext. Reg. 5 (Ring timer)        (xr5):22
  2036. j->m_DAAShadowRegs.XOP_REGS.XOP.xr5.reg = 0x22;
  2037. // Ext. Reg. 6 (Power State)       (xr6):00
  2038. j->m_DAAShadowRegs.XOP_xr6_W.reg = 0x00;
  2039. // Ext. Reg. 7 (Vdd)               (xr7):40
  2040. j->m_DAAShadowRegs.XOP_REGS.XOP.xr7.reg = 0x40; // 0x40 ??? Should it be 0x00?
  2041. // DTMF Tone 1                     (0B): 11,B3,5A,2C    ;   697 Hz  
  2042. //                                       12,33,5A,C3    ;  770 Hz  
  2043. //                                       13,3C,5B,32    ;  852 Hz  
  2044. //                                       1D,1B,5C,CC    ;  941 Hz  
  2045. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[3] = 0x11;
  2046. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[2] = 0xB3;
  2047. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[1] = 0x5A;
  2048. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[0] = 0x2C;
  2049. // DTMF Tone 2                     (0C): 32,32,52,B3    ;  1209 Hz  
  2050. //                                       EC,1D,52,22    ;  1336 Hz  
  2051. //                                       AA,AC,51,D2    ;  1477 Hz  
  2052. //                                       9B,3B,51,25    ;  1633 Hz  
  2053. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[3] = 0x32;
  2054. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[2] = 0x32;
  2055. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[1] = 0x52;
  2056. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[0] = 0xB3;
  2057. }
  2058. static void DAA_Coeff_Japan(int board)
  2059. {
  2060. IXJ *j = &ixj[board];
  2061. int i;
  2062. //-----------------------------------------------
  2063. // CAO
  2064. for (i = 0; i < ALISDAA_CALLERID_SIZE; i++) {
  2065. j->m_DAAShadowRegs.CAO_REGS.CAO.CallerID[i] = 0;
  2066. }
  2067. // Bytes for IM-filter part 1 (04): 06,BD,E2,2D,BA,F9,A0,00
  2068. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[7] = 0x06;
  2069. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[6] = 0xBD;
  2070. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[5] = 0xE2;
  2071. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[4] = 0x2D;
  2072. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[3] = 0xBA;
  2073. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[2] = 0xF9;
  2074. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[1] = 0xA0;
  2075. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_1[0] = 0x00;
  2076. // Bytes for IM-filter part 2 (05): 6F,F7,00,0E,34,33,E0,08
  2077. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[7] = 0x6F;
  2078. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[6] = 0xF7;
  2079. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[5] = 0x00;
  2080. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[4] = 0x0E;
  2081. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[3] = 0x34;
  2082. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[2] = 0x33;
  2083. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[1] = 0xE0;
  2084. j->m_DAAShadowRegs.COP_REGS.COP.IMFilterCoeff_2[0] = 0x08;
  2085. // Bytes for FRX-filter       (08): 02,8F,68,77,9C,58,F0,08
  2086. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[7] = 0x02;
  2087. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[6] = 0x8F;
  2088. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[5] = 0x68;
  2089. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[4] = 0x77;
  2090. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[3] = 0x9C;
  2091. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[2] = 0x58;
  2092. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[1] = 0xF0;
  2093. j->m_DAAShadowRegs.COP_REGS.COP.FRXFilterCoeff[0] = 0x08;
  2094. // Bytes for FRR-filter       (07): 03,8F,38,73,87,EA,20,08
  2095. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[7] = 0x03;
  2096. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[6] = 0x8F;
  2097. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[5] = 0x38;
  2098. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[4] = 0x73;
  2099. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[3] = 0x87;
  2100. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[2] = 0xEA;
  2101. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[1] = 0x20;
  2102. j->m_DAAShadowRegs.COP_REGS.COP.FRRFilterCoeff[0] = 0x08;
  2103. // Bytes for AX-filter        (0A): 51,C5,DD,CA
  2104. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[3] = 0x51;
  2105. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[2] = 0xC5;
  2106. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[1] = 0xDD;
  2107. j->m_DAAShadowRegs.COP_REGS.COP.AXFilterCoeff[0] = 0xCA;
  2108. // Bytes for AR-filter        (09): 25,A7,10,D6
  2109. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[3] = 0x25;
  2110. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[2] = 0xA7;
  2111. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[1] = 0x10;
  2112. j->m_DAAShadowRegs.COP_REGS.COP.ARFilterCoeff[0] = 0xD6;
  2113. // Bytes for TH-filter part 1 (00): 00,42,48,81,AE,80,00,98
  2114. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[7] = 0x00;
  2115. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[6] = 0x42;
  2116. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[5] = 0x48;
  2117. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[4] = 0x81;
  2118. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[3] = 0xAE;
  2119. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[2] = 0x80;
  2120. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[1] = 0x00;
  2121. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_1[0] = 0x98;
  2122. // Bytes for TH-filter part 2 (01): 02,AB,2A,20,99,5B,89,28
  2123. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[7] = 0x02;
  2124. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[6] = 0xAB;
  2125. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[5] = 0x2A;
  2126. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[4] = 0x20;
  2127. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[3] = 0x99;
  2128. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[2] = 0x5B;
  2129. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[1] = 0x89;
  2130. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_2[0] = 0x28;
  2131. // Bytes for TH-filter part 3 (02): 00,88,DA,25,34,C5,4C,BA
  2132. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[7] = 0x00;
  2133. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[6] = 0x88;
  2134. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[5] = 0xDA;
  2135. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[4] = 0x25;
  2136. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[3] = 0x34;
  2137. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[2] = 0xC5;
  2138. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[1] = 0x4C;
  2139. j->m_DAAShadowRegs.COP_REGS.COP.THFilterCoeff_3[0] = 0xBA;
  2140. // ;  idle
  2141. // Bytes for Ringing part 1 (03):1B,3C,93,3A,22,12,A3,23
  2142. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[7] = 0x1B;
  2143. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[6] = 0x3C;
  2144. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[5] = 0x93;
  2145. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[4] = 0x3A;
  2146. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[3] = 0x22;
  2147. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[2] = 0x12;
  2148. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[1] = 0xA3;
  2149. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_1[0] = 0x23;
  2150. // Bytes for Ringing part 2 (06):12,A2,A6,BA,22,7A,0A,D5
  2151. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[7] = 0x12;
  2152. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[6] = 0xA2;
  2153. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[5] = 0xA6;
  2154. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[4] = 0xBA;
  2155. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[3] = 0x22;
  2156. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[2] = 0x7A;
  2157. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[1] = 0x0A;
  2158. j->m_DAAShadowRegs.COP_REGS.COP.RingerImpendance_2[0] = 0xD5;
  2159. // Levelmetering Ringing           (0D):AA,35,0F,8E    ; 25Hz 30V ?????????
  2160. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[3] = 0xAA;
  2161. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[2] = 0x35;
  2162. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[1] = 0x0F;
  2163. j->m_DAAShadowRegs.COP_REGS.COP.LevelmeteringRinging[0] = 0x8E;
  2164. // Caller ID 1st Tone              (0E):CA,0E,CA,09,99,99,99,99
  2165. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[7] = 0xCA;
  2166. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[6] = 0x0E;
  2167. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[5] = 0xCA;
  2168. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[4] = 0x09;
  2169. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[3] = 0x99;
  2170. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[2] = 0x99;
  2171. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[1] = 0x99;
  2172. j->m_DAAShadowRegs.COP_REGS.COP.CallerID1stTone[0] = 0x99;
  2173. // Caller ID 2nd Tone              (0F):FD,B5,BA,07,DA,00,00,00
  2174. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[7] = 0xFD;
  2175. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[6] = 0xB5;
  2176. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[5] = 0xBA;
  2177. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[4] = 0x07;
  2178. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[3] = 0xDA;
  2179. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[2] = 0x00;
  2180. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[1] = 0x00;
  2181. j->m_DAAShadowRegs.COP_REGS.COP.CallerID2ndTone[0] = 0x00;
  2182. // ;CR Registers
  2183. // Config. Reg. 0 (filters)        (cr0):FF
  2184. j->m_DAAShadowRegs.SOP_REGS.SOP.cr0.reg = 0xFE;
  2185. // Config. Reg. 1 (dialing)        (cr1):05
  2186. j->m_DAAShadowRegs.SOP_REGS.SOP.cr1.reg = 0x05;
  2187. // Config. Reg. 2 (caller ID)      (cr2):04
  2188. j->m_DAAShadowRegs.SOP_REGS.SOP.cr2.reg = 0x04;
  2189. // Config. Reg. 3 (testloops)      (cr3):00        ; 
  2190. j->m_DAAShadowRegs.SOP_REGS.SOP.cr3.reg = 0x00;
  2191. // Config. Reg. 4 (analog gain)    (cr4):01
  2192. j->m_DAAShadowRegs.SOP_REGS.SOP.cr4.reg = 0x02; //0x01;
  2193. // Config. Reg. 5 (Version)        (cr5):02
  2194. // Config. Reg. 6 (Reserved)       (cr6):00
  2195. // Config. Reg. 7 (Reserved)       (cr7):00
  2196. // ;xr Registers
  2197. // Ext. Reg. 0 (Interrupt Reg.)    (xr0):02
  2198. j->m_DAAShadowRegs.XOP_xr0_W.reg = 0x02; // SO_1 set to '1' because it is inverted.
  2199. // Ext. Reg. 1 (Interrupt enable)  (xr1):1C
  2200. j->m_DAAShadowRegs.XOP_REGS.XOP.xr1.reg = 0x1C; // RING, Caller ID, VDD_OK
  2201. // Ext. Reg. 2 (Cadence Time Out)  (xr2):7D
  2202. j->m_DAAShadowRegs.XOP_REGS.XOP.xr2.reg = 0x7D;
  2203. // Ext. Reg. 3 (DC Char)           (xr3):22        ; 
  2204. j->m_DAAShadowRegs.XOP_REGS.XOP.xr3.reg = 0x22;
  2205. // Ext. Reg. 4 (Cadence)           (xr4):00
  2206. j->m_DAAShadowRegs.XOP_REGS.XOP.xr4.reg = 0x00;
  2207. // Ext. Reg. 5 (Ring timer)        (xr5):22
  2208. j->m_DAAShadowRegs.XOP_REGS.XOP.xr5.reg = 0x22;
  2209. // Ext. Reg. 6 (Power State)       (xr6):00
  2210. j->m_DAAShadowRegs.XOP_xr6_W.reg = 0x00;
  2211. // Ext. Reg. 7 (Vdd)               (xr7):40
  2212. j->m_DAAShadowRegs.XOP_REGS.XOP.xr7.reg = 0x40; // 0x40 ??? Should it be 0x00?
  2213. // DTMF Tone 1                     (0B): 11,B3,5A,2C    ;   697 Hz  
  2214. //                                       12,33,5A,C3    ;  770 Hz  
  2215. //                                       13,3C,5B,32    ;  852 Hz  
  2216. //                                       1D,1B,5C,CC    ;  941 Hz  
  2217. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[3] = 0x11;
  2218. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[2] = 0xB3;
  2219. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[1] = 0x5A;
  2220. j->m_DAAShadowRegs.COP_REGS.COP.Tone1Coeff[0] = 0x2C;
  2221. // DTMF Tone 2                     (0C): 32,32,52,B3    ;  1209 Hz  
  2222. //                                       EC,1D,52,22    ;  1336 Hz  
  2223. //                                       AA,AC,51,D2    ;  1477 Hz  
  2224. //                                       9B,3B,51,25    ;  1633 Hz  
  2225. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[3] = 0x32;
  2226. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[2] = 0x32;
  2227. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[1] = 0x52;
  2228. j->m_DAAShadowRegs.COP_REGS.COP.Tone2Coeff[0] = 0xB3;
  2229. }
  2230. static s16 tone_table[][19] =
  2231. {
  2232. { // f20_50[] 11
  2233. 32538, // A1 = 1.985962
  2234.  -32325, // A2 = -0.986511
  2235.  -343, // B2 = -0.010493
  2236.  0, // B1 = 0
  2237.  343, // B0 = 0.010493
  2238.  32619, // A1 = 1.990906
  2239.  -32520, // A2 = -0.992462
  2240.  19179, // B2 = 0.585327
  2241.  -19178, // B1 = -1.170593
  2242.  19179, // B0 = 0.585327
  2243.  32723, // A1 = 1.997314
  2244.  -32686, // A2 = -0.997528
  2245.  9973, // B2 = 0.304352
  2246.  -9955, // B1 = -0.607605
  2247.  9973, // B0 = 0.304352
  2248.  7, // Internal filter scaling
  2249.  159, // Minimum in-band energy threshold
  2250.  21, // 21/32 in-band to broad-band ratio
  2251.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2252. },
  2253. { // f133_200[] 12
  2254. 32072, // A1 = 1.95752
  2255.  -31896, // A2 = -0.973419
  2256.  -435, // B2 = -0.013294
  2257.  0, // B1 = 0
  2258.  435, // B0 = 0.013294
  2259.  32188, // A1 = 1.9646
  2260.  -32400, // A2 = -0.98877
  2261.  15139, // B2 = 0.462036
  2262.  -14882, // B1 = -0.908356
  2263.  15139, // B0 = 0.462036
  2264.  32473, // A1 = 1.981995
  2265.  -32524, // A2 = -0.992584
  2266.  23200, // B2 = 0.708008
  2267.  -23113, // B1 = -1.410706
  2268.  23200, // B0 = 0.708008
  2269.  7, // Internal filter scaling
  2270.  159, // Minimum in-band energy threshold
  2271.  21, // 21/32 in-band to broad-band ratio
  2272.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2273. },
  2274. { // 300.txt 13
  2275. 31769, // A1 = -1.939026
  2276.  -32584, // A2 = 0.994385
  2277.  -475, // B2 = -0.014522
  2278.  0, // B1 = 0.000000
  2279.  475, // B0 = 0.014522
  2280.  31789, // A1 = -1.940247
  2281.  -32679, // A2 = 0.997284
  2282.  17280, // B2 = 0.527344
  2283.  -16865, // B1 = -1.029358
  2284.  17280, // B0 = 0.527344
  2285.  31841, // A1 = -1.943481
  2286.  -32681, // A2 = 0.997345
  2287.  543, // B2 = 0.016579
  2288.  -525, // B1 = -0.032097
  2289.  543, // B0 = 0.016579
  2290.  5, // Internal filter scaling
  2291.  159, // Minimum in-band energy threshold
  2292.  21, // 21/32 in-band to broad-band ratio
  2293.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2294. },
  2295. { // f300_420[] 14
  2296. 30750, // A1 = 1.876892
  2297.  -31212, // A2 = -0.952515
  2298.  -804, // B2 = -0.024541
  2299.  0, // B1 = 0
  2300.  804, // B0 = 0.024541
  2301.  30686, // A1 = 1.872925
  2302.  -32145, // A2 = -0.980988
  2303.  14747, // B2 = 0.450043
  2304.  -13703, // B1 = -0.836395
  2305.  14747, // B0 = 0.450043
  2306.  31651, // A1 = 1.931824
  2307.  -32321, // A2 = -0.986389
  2308.  24425, // B2 = 0.745422
  2309.  -23914, // B1 = -1.459595
  2310.  24427, // B0 = 0.745483
  2311.  7, // Internal filter scaling
  2312.  159, // Minimum in-band energy threshold
  2313.  21, // 21/32 in-band to broad-band ratio
  2314.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2315. },
  2316. { // 330.txt 15
  2317. 31613, // A1 = -1.929565
  2318.  -32646, // A2 = 0.996277
  2319.  -185, // B2 = -0.005657
  2320.  0, // B1 = 0.000000
  2321.  185, // B0 = 0.005657
  2322.  31620, // A1 = -1.929932
  2323.  -32713, // A2 = 0.998352
  2324.  19253, // B2 = 0.587585
  2325.  -18566, // B1 = -1.133179
  2326.  19253, // B0 = 0.587585
  2327.  31674, // A1 = -1.933228
  2328.  -32715, // A2 = 0.998413
  2329.  2575, // B2 = 0.078590
  2330.  -2495, // B1 = -0.152283
  2331.  2575, // B0 = 0.078590
  2332.  5, // Internal filter scaling
  2333.  159, // Minimum in-band energy threshold
  2334.  21, // 21/32 in-band to broad-band ratio
  2335.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2336. },
  2337. { // f300_425[] 16
  2338. 30741, // A1 = 1.876282
  2339.  -31475, // A2 = -0.960541
  2340.  -703, // B2 = -0.021484
  2341.  0, // B1 = 0
  2342.  703, // B0 = 0.021484
  2343.  30688, // A1 = 1.873047
  2344.  -32248, // A2 = -0.984161
  2345.  14542, // B2 = 0.443787
  2346.  -13523, // B1 = -0.825439
  2347.  14542, // B0 = 0.443817
  2348.  31494, // A1 = 1.922302
  2349.  -32366, // A2 = -0.987762
  2350.  21577, // B2 = 0.658508
  2351.  -21013, // B1 = -1.282532
  2352.  21577, // B0 = 0.658508
  2353.  7, // Internal filter scaling
  2354.  159, // Minimum in-band energy threshold
  2355.  21, // 21/32 in-band to broad-band ratio
  2356.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2357. },
  2358. { // f330_440[] 17
  2359. 30627, // A1 = 1.869324
  2360.  -31338, // A2 = -0.95636
  2361.  -843, // B2 = -0.025749
  2362.  0, // B1 = 0
  2363.  843, // B0 = 0.025749
  2364.  30550, // A1 = 1.864685
  2365.  -32221, // A2 = -0.983337
  2366.  13594, // B2 = 0.414886
  2367.  -12589, // B1 = -0.768402
  2368.  13594, // B0 = 0.414886
  2369.  31488, // A1 = 1.921936
  2370.  -32358, // A2 = -0.987518
  2371.  24684, // B2 = 0.753296
  2372.  -24029, // B1 = -1.466614
  2373.  24684, // B0 = 0.753296
  2374.  7, // Internal filter scaling
  2375.  159, // Minimum in-band energy threshold
  2376.  21, // 21/32 in-band to broad-band ratio
  2377.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2378. },
  2379. { // 340.txt 18
  2380. 31546, // A1 = -1.925476
  2381.  -32646, // A2 = 0.996277
  2382.  -445, // B2 = -0.013588
  2383.  0, // B1 = 0.000000
  2384.  445, // B0 = 0.013588
  2385.  31551, // A1 = -1.925781
  2386.  -32713, // A2 = 0.998352
  2387.  23884, // B2 = 0.728882
  2388.  -22979, // B1 = -1.402527
  2389.  23884, // B0 = 0.728882
  2390.  31606, // A1 = -1.929138
  2391.  -32715, // A2 = 0.998413
  2392.  863, // B2 = 0.026367
  2393.  -835, // B1 = -0.050985
  2394.  863, // B0 = 0.026367
  2395.  5, // Internal filter scaling
  2396.  159, // Minimum in-band energy threshold
  2397.  21, // 21/32 in-band to broad-band ratio
  2398.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2399. },
  2400. { // f350_400[] 19
  2401. 31006, // A1 = 1.892517
  2402.  -32029, // A2 = -0.977448
  2403.  -461, // B2 = -0.014096
  2404.  0, // B1 = 0
  2405.  461, // B0 = 0.014096
  2406.  30999, // A1 = 1.892029
  2407.  -32487, // A2 = -0.991455
  2408.  11325, // B2 = 0.345612
  2409.  -10682, // B1 = -0.651978
  2410.  11325, // B0 = 0.345612
  2411.  31441, // A1 = 1.919067
  2412.  -32526, // A2 = -0.992615
  2413.  24324, // B2 = 0.74231
  2414.  -23535, // B1 = -1.436523
  2415.  24324, // B0 = 0.74231
  2416.  7, // Internal filter scaling
  2417.  159, // Minimum in-band energy threshold
  2418.  21, // 21/32 in-band to broad-band ratio
  2419.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2420. },
  2421. { // f350_440[]
  2422. 30634, // A1 = 1.869751
  2423.  -31533, // A2 = -0.962341
  2424.  -680, // B2 = -0.020782
  2425.  0, // B1 = 0
  2426.  680, // B0 = 0.020782
  2427.  30571, // A1 = 1.865906
  2428.  -32277, // A2 = -0.985016
  2429.  12894, // B2 = 0.393524
  2430.  -11945, // B1 = -0.729065
  2431.  12894, // B0 = 0.393524
  2432.  31367, // A1 = 1.91449
  2433.  -32379, // A2 = -0.988129
  2434.  23820, // B2 = 0.726929
  2435.  -23104, // B1 = -1.410217
  2436.  23820, // B0 = 0.726929
  2437.  7, // Internal filter scaling
  2438.  159, // Minimum in-band energy threshold
  2439.  21, // 21/32 in-band to broad-band ratio
  2440.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2441. },
  2442. { // f350_450[]
  2443. 30552, // A1 = 1.864807
  2444.  -31434, // A2 = -0.95929
  2445.  -690, // B2 = -0.021066
  2446.  0, // B1 = 0
  2447.  690, // B0 = 0.021066
  2448.  30472, // A1 = 1.859924
  2449.  -32248, // A2 = -0.984161
  2450.  13385, // B2 = 0.408478
  2451.  -12357, // B1 = -0.754242
  2452.  13385, // B0 = 0.408478
  2453.  31358, // A1 = 1.914001
  2454.  -32366, // A2 = -0.987732
  2455.  26488, // B2 = 0.80835
  2456.  -25692, // B1 = -1.568176
  2457.  26490, // B0 = 0.808411
  2458.  7, // Internal filter scaling
  2459.  159, // Minimum in-band energy threshold
  2460.  21, // 21/32 in-band to broad-band ratio
  2461.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2462. },
  2463. { // 360.txt
  2464. 31397, // A1 = -1.916321
  2465.  -32623, // A2 = 0.995605
  2466.  -117, // B2 = -0.003598
  2467.  0, // B1 = 0.000000
  2468.  117, // B0 = 0.003598
  2469.  31403, // A1 = -1.916687
  2470.  -32700, // A2 = 0.997925
  2471.  3388, // B2 = 0.103401
  2472.  -3240, // B1 = -0.197784
  2473.  3388, // B0 = 0.103401
  2474.  31463, // A1 = -1.920410
  2475.  -32702, // A2 = 0.997986
  2476.  13346, // B2 = 0.407288
  2477.  -12863, // B1 = -0.785126
  2478.  13346, // B0 = 0.407288
  2479.  5, // Internal filter scaling
  2480.  159, // Minimum in-band energy threshold
  2481.  21, // 21/32 in-band to broad-band ratio
  2482.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2483. },
  2484. { // f380_420[]
  2485. 30831, // A1 = 1.881775
  2486.  -32064, // A2 = -0.978546
  2487.  -367, // B2 = -0.01122
  2488.  0, // B1 = 0
  2489.  367, // B0 = 0.01122
  2490.  30813, // A1 = 1.880737
  2491.  -32456, // A2 = -0.990509
  2492.  11068, // B2 = 0.337769
  2493.  -10338, // B1 = -0.631042
  2494.  11068, // B0 = 0.337769
  2495.  31214, // A1 = 1.905212
  2496.  -32491, // A2 = -0.991577
  2497.  16374, // B2 = 0.499695
  2498.  -15781, // B1 = -0.963196
  2499.  16374, // B0 = 0.499695
  2500.  7, // Internal filter scaling
  2501.  159, // Minimum in-band energy threshold
  2502.  21, // 21/32 in-band to broad-band ratio
  2503.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2504. },
  2505. { // 392.txt
  2506. 31152, // A1 = -1.901428
  2507.  -32613, // A2 = 0.995300
  2508.  -314, // B2 = -0.009605
  2509.  0, // B1 = 0.000000
  2510.  314, // B0 = 0.009605
  2511.  31156, // A1 = -1.901672
  2512.  -32694, // A2 = 0.997742
  2513.  28847, // B2 = 0.880371
  2514.  -2734, // B1 = -0.166901
  2515.  28847, // B0 = 0.880371
  2516.  31225, // A1 = -1.905823
  2517.  -32696, // A2 = 0.997803
  2518.  462, // B2 = 0.014108
  2519.  -442, // B1 = -0.027019
  2520.  462, // B0 = 0.014108
  2521.  5, // Internal filter scaling
  2522.  159, // Minimum in-band energy threshold
  2523.  21, // 21/32 in-band to broad-band ratio
  2524.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2525. },
  2526. { // f400_425[]
  2527. 30836, // A1 = 1.882141
  2528.  -32296, // A2 = -0.985596
  2529.  -324, // B2 = -0.009903
  2530.  0, // B1 = 0
  2531.  324, // B0 = 0.009903
  2532.  30825, // A1 = 1.881409
  2533.  -32570, // A2 = -0.993958
  2534.  16847, // B2 = 0.51416
  2535.  -15792, // B1 = -0.963898
  2536.  16847, // B0 = 0.51416
  2537.  31106, // A1 = 1.89856
  2538.  -32584, // A2 = -0.994415
  2539.  9579, // B2 = 0.292328
  2540.  -9164, // B1 = -0.559357
  2541.  9579, // B0 = 0.292328
  2542.  7, // Internal filter scaling
  2543.  159, // Minimum in-band energy threshold
  2544.  21, // 21/32 in-band to broad-band ratio
  2545.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2546. },
  2547. { // f400_440[]
  2548. 30702, // A1 = 1.873962
  2549.  -32134, // A2 = -0.980682
  2550.  -517, // B2 = -0.015793
  2551.  0, // B1 = 0
  2552.  517, // B0 = 0.015793
  2553.  30676, // A1 = 1.872375
  2554.  -32520, // A2 = -0.992462
  2555.  8144, // B2 = 0.24855
  2556.  -7596, // B1 = -0.463684
  2557.  8144, // B0 = 0.24855
  2558.  31084, // A1 = 1.897217
  2559.  -32547, // A2 = -0.993256
  2560.  22713, // B2 = 0.693176
  2561.  -21734, // B1 = -1.326599
  2562.  22713, // B0 = 0.693176
  2563.  7, // Internal filter scaling
  2564.  159, // Minimum in-band energy threshold
  2565.  21, // 21/32 in-band to broad-band ratio
  2566.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2567. },
  2568. { // f400_450[]
  2569. 30613, // A1 = 1.86853
  2570.  -32031, // A2 = -0.977509
  2571.  -618, // B2 = -0.018866
  2572.  0, // B1 = 0
  2573.  618, // B0 = 0.018866
  2574.  30577, // A1 = 1.866272
  2575.  -32491, // A2 = -0.991577
  2576.  9612, // B2 = 0.293335
  2577.  -8935, // B1 = -0.54541
  2578.  9612, // B0 = 0.293335
  2579.  31071, // A1 = 1.896484
  2580.  -32524, // A2 = -0.992584
  2581.  21596, // B2 = 0.659058
  2582.  -20667, // B1 = -1.261414
  2583.  21596, // B0 = 0.659058
  2584.  7, // Internal filter scaling
  2585.  159, // Minimum in-band energy threshold
  2586.  21, // 21/32 in-band to broad-band ratio
  2587.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2588. },
  2589. { // 420.txt
  2590. 30914, // A1 = -1.886841
  2591.  -32584, // A2 = 0.994385
  2592.  -426, // B2 = -0.013020
  2593.  0, // B1 = 0.000000
  2594.  426, // B0 = 0.013020
  2595.  30914, // A1 = -1.886841
  2596.  -32679, // A2 = 0.997314
  2597.  17520, // B2 = 0.534668
  2598.  -16471, // B1 = -1.005310
  2599.  17520, // B0 = 0.534668
  2600.  31004, // A1 = -1.892334
  2601.  -32683, // A2 = 0.997406
  2602.  819, // B2 = 0.025023
  2603.  -780, // B1 = -0.047619
  2604.  819, // B0 = 0.025023
  2605.  5, // Internal filter scaling
  2606.  159, // Minimum in-band energy threshold
  2607.  21, // 21/32 in-band to broad-band ratio
  2608.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2609. },
  2610. { // 425.txt
  2611. 30881, // A1 = -1.884827
  2612.  -32603, // A2 = 0.994965
  2613.  -496, // B2 = -0.015144
  2614.  0, // B1 = 0.000000
  2615.  496, // B0 = 0.015144
  2616.  30880, // A1 = -1.884766
  2617.  -32692, // A2 = 0.997711
  2618.  24767, // B2 = 0.755859
  2619.  -23290, // B1 = -1.421509
  2620.  24767, // B0 = 0.755859
  2621.  30967, // A1 = -1.890076
  2622.  -32694, // A2 = 0.997772
  2623.  728, // B2 = 0.022232
  2624.  -691, // B1 = -0.042194
  2625.  728, // B0 = 0.022232
  2626.  5, // Internal filter scaling
  2627.  159, // Minimum in-band energy threshold
  2628.  21, // 21/32 in-band to broad-band ratio
  2629.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2630. },
  2631. { // f425_450[]
  2632. 30646, // A1 = 1.870544
  2633.  -32327, // A2 = -0.986572
  2634.  -287, // B2 = -0.008769
  2635.  0, // B1 = 0
  2636.  287, // B0 = 0.008769
  2637.  30627, // A1 = 1.869324
  2638.  -32607, // A2 = -0.995087
  2639.  13269, // B2 = 0.404968
  2640.  -12376, // B1 = -0.755432
  2641.  13269, // B0 = 0.404968
  2642.  30924, // A1 = 1.887512
  2643.  -32619, // A2 = -0.995453
  2644.  19950, // B2 = 0.608826
  2645.  -18940, // B1 = -1.156006
  2646.  19950, // B0 = 0.608826
  2647.  7, // Internal filter scaling
  2648.  159, // Minimum in-band energy threshold
  2649.  21, // 21/32 in-band to broad-band ratio
  2650.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2651. },
  2652. { // f425_475[]
  2653. 30396, // A1 = 1.855225
  2654.  -32014, // A2 = -0.97699
  2655.  -395, // B2 = -0.012055
  2656.  0, // B1 = 0
  2657.  395, // B0 = 0.012055
  2658.  30343, // A1 = 1.85199
  2659.  -32482, // A2 = -0.991302
  2660.  17823, // B2 = 0.543945
  2661.  -16431, // B1 = -1.002869
  2662.  17823, // B0 = 0.543945
  2663.  30872, // A1 = 1.884338
  2664.  -32516, // A2 = -0.99231
  2665.  18124, // B2 = 0.553101
  2666.  -17246, // B1 = -1.052673
  2667.  18124, // B0 = 0.553101
  2668.  7, // Internal filter scaling
  2669.  159, // Minimum in-band energy threshold
  2670.  21, // 21/32 in-band to broad-band ratio
  2671.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2672. },
  2673. { // 435.txt
  2674. 30796, // A1 = -1.879639
  2675.  -32603, // A2 = 0.994965
  2676.  -254, // B2 = -0.007762
  2677.  0, // B1 = 0.000000
  2678.  254, // B0 = 0.007762
  2679.  30793, // A1 = -1.879456
  2680.  -32692, // A2 = 0.997711
  2681.  18934, // B2 = 0.577820
  2682.  -17751, // B1 = -1.083496
  2683.  18934, // B0 = 0.577820
  2684.  30882, // A1 = -1.884888
  2685.  -32694, // A2 = 0.997772
  2686.  1858, // B2 = 0.056713
  2687.  -1758, // B1 = -0.107357
  2688.  1858, // B0 = 0.056713
  2689.  5, // Internal filter scaling
  2690.  159, // Minimum in-band energy threshold
  2691.  21, // 21/32 in-band to broad-band ratio
  2692.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2693. },
  2694. { // f440_450[]
  2695. 30641, // A1 = 1.870239
  2696.  -32458, // A2 = -0.99057
  2697.  -155, // B2 = -0.004735
  2698.  0, // B1 = 0
  2699.  155, // B0 = 0.004735
  2700.  30631, // A1 = 1.869568
  2701.  -32630, // A2 = -0.995789
  2702.  11453, // B2 = 0.349548
  2703.  -10666, // B1 = -0.651001
  2704.  11453, // B0 = 0.349548
  2705.  30810, // A1 = 1.880554
  2706.  -32634, // A2 = -0.995941
  2707.  12237, // B2 = 0.373474
  2708.  -11588, // B1 = -0.707336
  2709.  12237, // B0 = 0.373474
  2710.  7, // Internal filter scaling
  2711.  159, // Minimum in-band energy threshold
  2712.  21, // 21/32 in-band to broad-band ratio
  2713.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2714. },
  2715. { // f440_480[]
  2716. 30367, // A1 = 1.853455
  2717.  -32147, // A2 = -0.981079
  2718.  -495, // B2 = -0.015113
  2719.  0, // B1 = 0
  2720.  495, // B0 = 0.015113
  2721.  30322, // A1 = 1.850769
  2722.  -32543, // A2 = -0.993134
  2723.  10031, // B2 = 0.306152
  2724.  -9252, // B1 = -0.564728
  2725.  10031, // B0 = 0.306152
  2726.  30770, // A1 = 1.878052
  2727.  -32563, // A2 = -0.993774
  2728.  22674, // B2 = 0.691956
  2729.  -21465, // B1 = -1.31012
  2730.  22674, // B0 = 0.691956
  2731.  7, // Internal filter scaling
  2732.  159, // Minimum in-band energy threshold
  2733.  21, // 21/32 in-band to broad-band ratio
  2734.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2735. },
  2736. { // 445.txt
  2737. 30709, // A1 = -1.874329
  2738.  -32603, // A2 = 0.994965
  2739.  -83, // B2 = -0.002545
  2740.  0, // B1 = 0.000000
  2741.  83, // B0 = 0.002545
  2742.  30704, // A1 = -1.874084
  2743.  -32692, // A2 = 0.997711
  2744.  10641, // B2 = 0.324738
  2745.  -9947, // B1 = -0.607147
  2746.  10641, // B0 = 0.324738
  2747.  30796, // A1 = -1.879639
  2748.  -32694, // A2 = 0.997772
  2749.  10079, // B2 = 0.307587
  2750.  9513, // B1 = 0.580688
  2751.  10079, // B0 = 0.307587
  2752.  5, // Internal filter scaling
  2753.  159, // Minimum in-band energy threshold
  2754.  21, // 21/32 in-band to broad-band ratio
  2755.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2756. },
  2757. { // 450.txt
  2758. 30664, // A1 = -1.871643
  2759.  -32603, // A2 = 0.994965
  2760.  -164, // B2 = -0.005029
  2761.  0, // B1 = 0.000000
  2762.  164, // B0 = 0.005029
  2763.  30661, // A1 = -1.871399
  2764.  -32692, // A2 = 0.997711
  2765.  15294, // B2 = 0.466736
  2766.  -14275, // B1 = -0.871307
  2767.  15294, // B0 = 0.466736
  2768.  30751, // A1 = -1.876953
  2769.  -32694, // A2 = 0.997772
  2770.  3548, // B2 = 0.108284
  2771.  -3344, // B1 = -0.204155
  2772.  3548, // B0 = 0.108284
  2773.  5, // Internal filter scaling
  2774.  159, // Minimum in-band energy threshold
  2775.  21, // 21/32 in-band to broad-band ratio
  2776.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2777. },
  2778. { // 452.txt
  2779. 30653, // A1 = -1.870911
  2780.  -32615, // A2 = 0.995361
  2781.  -209, // B2 = -0.006382
  2782.  0, // B1 = 0.000000
  2783.  209, // B0 = 0.006382
  2784.  30647, // A1 = -1.870605
  2785.  -32702, // A2 = 0.997986
  2786.  18971, // B2 = 0.578979
  2787.  -17716, // B1 = -1.081299
  2788.  18971, // B0 = 0.578979
  2789.  30738, // A1 = -1.876099
  2790.  -32702, // A2 = 0.998016
  2791.  2967, // B2 = 0.090561
  2792.  -2793, // B1 = -0.170502
  2793.  2967, // B0 = 0.090561
  2794.  5, // Internal filter scaling
  2795.  159, // Minimum in-band energy threshold
  2796.  21, // 21/32 in-band to broad-band ratio
  2797.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2798. },
  2799. { // 475.txt
  2800. 30437, // A1 = -1.857727
  2801.  -32603, // A2 = 0.994965
  2802.  -264, // B2 = -0.008062
  2803.  0, // B1 = 0.000000
  2804.  264, // B0 = 0.008062
  2805.  30430, // A1 = -1.857300
  2806.  -32692, // A2 = 0.997711
  2807.  21681, // B2 = 0.661682
  2808.  -20082, // B1 = -1.225708
  2809.  21681, // B0 = 0.661682
  2810.  30526, // A1 = -1.863220
  2811.  -32694, // A2 = 0.997742
  2812.  1559, // B2 = 0.047600
  2813.  -1459, // B1 = -0.089096
  2814.  1559, // B0 = 0.047600
  2815.  5, // Internal filter scaling
  2816.  159, // Minimum in-band energy threshold
  2817.  21, // 21/32 in-band to broad-band ratio
  2818.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2819. },
  2820. { // f480_620[]
  2821. 28975, // A1 = 1.768494
  2822.  -30955, // A2 = -0.944672
  2823.  -1026, // B2 = -0.03133
  2824.  0, // B1 = 0
  2825.  1026, // B0 = 0.03133
  2826.  28613, // A1 = 1.746399
  2827.  -32089, // A2 = -0.979309
  2828.  14214, // B2 = 0.433807
  2829.  -12202, // B1 = -0.744812
  2830.  14214, // B0 = 0.433807
  2831.  30243, // A1 = 1.845947
  2832.  -32238, // A2 = -0.983856
  2833.  24825, // B2 = 0.757629
  2834.  -23402, // B1 = -1.428345
  2835.  24825, // B0 = 0.757629
  2836.  7, // Internal filter scaling
  2837.  159, // Minimum in-band energy threshold
  2838.  21, // 21/32 in-band to broad-band ratio
  2839.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2840. },
  2841. { // 494.txt
  2842. 30257, // A1 = -1.846741
  2843.  -32605, // A2 = 0.995056
  2844.  -249, // B2 = -0.007625
  2845.  0, // B1 = 0.000000
  2846.  249, // B0 = 0.007625
  2847.  30247, // A1 = -1.846191
  2848.  -32694, // A2 = 0.997772
  2849.  18088, // B2 = 0.552002
  2850.  -16652, // B1 = -1.016418
  2851.  18088, // B0 = 0.552002
  2852.  30348, // A1 = -1.852295
  2853.  -32696, // A2 = 0.997803
  2854.  2099, // B2 = 0.064064
  2855.  -1953, // B1 = -0.119202
  2856.  2099, // B0 = 0.064064
  2857.  5, // Internal filter scaling
  2858.  159, // Minimum in-band energy threshold
  2859.  21, // 21/32 in-band to broad-band ratio
  2860.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2861. },
  2862. { // 500.txt
  2863. 30202, // A1 = -1.843431
  2864.  -32624, // A2 = 0.995622
  2865.  -413, // B2 = -0.012622
  2866.  0, // B1 = 0.000000
  2867.  413, // B0 = 0.012622
  2868.  30191, // A1 = -1.842721
  2869.  -32714, // A2 = 0.998364
  2870.  25954, // B2 = 0.792057
  2871.  -23890, // B1 = -1.458131
  2872.  25954, // B0 = 0.792057
  2873.  30296, // A1 = -1.849172
  2874.  -32715, // A2 = 0.998397
  2875.  2007, // B2 = 0.061264
  2876.  -1860, // B1 = -0.113568
  2877.  2007, // B0 = 0.061264
  2878.  5, // Internal filter scaling
  2879.  159, // Minimum in-band energy threshold
  2880.  21, // 21/32 in-band to broad-band ratio
  2881.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2882. },
  2883. { // 520.txt
  2884. 30001, // A1 = -1.831116
  2885.  -32613, // A2 = 0.995270
  2886.  -155, // B2 = -0.004750
  2887.  0, // B1 = 0.000000
  2888.  155, // B0 = 0.004750
  2889.  29985, // A1 = -1.830200
  2890.  -32710, // A2 = 0.998260
  2891.  6584, // B2 = 0.200928
  2892.  -6018, // B1 = -0.367355
  2893.  6584, // B0 = 0.200928
  2894.  30105, // A1 = -1.837524
  2895.  -32712, // A2 = 0.998291
  2896.  23812, // B2 = 0.726685
  2897.  -21936, // B1 = -1.338928
  2898.  23812, // B0 = 0.726685
  2899.  5, // Internal filter scaling
  2900.  159, // Minimum in-band energy threshold
  2901.  21, // 21/32 in-band to broad-band ratio
  2902.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2903. },
  2904. { // 523.txt
  2905. 29964, // A1 = -1.828918
  2906.  -32601, // A2 = 0.994904
  2907.  -101, // B2 = -0.003110
  2908.  0, // B1 = 0.000000
  2909.  101, // B0 = 0.003110
  2910.  29949, // A1 = -1.827942
  2911.  -32700, // A2 = 0.997925
  2912.  11041, // B2 = 0.336975
  2913.  -10075, // B1 = -0.614960
  2914.  11041, // B0 = 0.336975
  2915.  30070, // A1 = -1.835388
  2916.  -32702, // A2 = 0.997986
  2917.  16762, // B2 = 0.511536
  2918.  -15437, // B1 = -0.942230
  2919.  16762, // B0 = 0.511536
  2920.  5, // Internal filter scaling
  2921.  159, // Minimum in-band energy threshold
  2922.  21, // 21/32 in-band to broad-band ratio
  2923.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2924. },
  2925. { // 525.txt
  2926. 29936, // A1 = -1.827209
  2927.  -32584, // A2 = 0.994415
  2928.  -91, // B2 = -0.002806
  2929.  0, // B1 = 0.000000
  2930.  91, // B0 = 0.002806
  2931.  29921, // A1 = -1.826233
  2932.  -32688, // A2 = 0.997559
  2933.  11449, // B2 = 0.349396
  2934.  -10426, // B1 = -0.636383
  2935.  11449, // B0 = 0.349396
  2936.  30045, // A1 = -1.833862
  2937.  -32688, // A2 = 0.997589
  2938.  13055, // B2 = 0.398407
  2939.  -12028, // B1 = -0.734161
  2940.  13055, // B0 = 0.398407
  2941.  5, // Internal filter scaling
  2942.  159, // Minimum in-band energy threshold
  2943.  21, // 21/32 in-band to broad-band ratio
  2944.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2945. },
  2946. { // f540_660[]
  2947. 28499, // A1 = 1.739441
  2948.  -31129, // A2 = -0.949982
  2949.  -849, // B2 = -0.025922
  2950.  0, // B1 = 0
  2951.  849, // B0 = 0.025922
  2952.  28128, // A1 = 1.716797
  2953.  -32130, // A2 = -0.98056
  2954.  14556, // B2 = 0.444214
  2955.  -12251, // B1 = -0.747772
  2956.  14556, // B0 = 0.444244
  2957.  29667, // A1 = 1.81073
  2958.  -32244, // A2 = -0.984039
  2959.  23038, // B2 = 0.703064
  2960.  -21358, // B1 = -1.303589
  2961.  23040, // B0 = 0.703125
  2962.  7, // Internal filter scaling
  2963.  159, // Minimum in-band energy threshold
  2964.  21, // 21/32 in-band to broad-band ratio
  2965.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2966. },
  2967. { // 587.txt
  2968. 29271, // A1 = -1.786560
  2969.  -32599, // A2 = 0.994873
  2970.  -490, // B2 = -0.014957
  2971.  0, // B1 = 0.000000
  2972.  490, // B0 = 0.014957
  2973.  29246, // A1 = -1.785095
  2974.  -32700, // A2 = 0.997925
  2975.  28961, // B2 = 0.883850
  2976.  -25796, // B1 = -1.574463
  2977.  28961, // B0 = 0.883850
  2978.  29383, // A1 = -1.793396
  2979.  -32700, // A2 = 0.997955
  2980.  1299, // B2 = 0.039650
  2981.  -1169, // B1 = -0.071396
  2982.  1299, // B0 = 0.039650
  2983.  5, // Internal filter scaling
  2984.  159, // Minimum in-band energy threshold
  2985.  21, // 21/32 in-band to broad-band ratio
  2986.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  2987. },
  2988. { // 590.txt
  2989. 29230, // A1 = -1.784058
  2990.  -32584, // A2 = 0.994415
  2991.  -418, // B2 = -0.012757
  2992.  0, // B1 = 0.000000
  2993.  418, // B0 = 0.012757
  2994.  29206, // A1 = -1.782593
  2995.  -32688, // A2 = 0.997559
  2996.  36556, // B2 = 1.115601
  2997.  -32478, // B1 = -1.982300
  2998.  36556, // B0 = 1.115601
  2999.  29345, // A1 = -1.791077
  3000.  -32688, // A2 = 0.997589
  3001.  897, // B2 = 0.027397
  3002.  -808, // B1 = -0.049334
  3003.  897, // B0 = 0.027397
  3004.  5, // Internal filter scaling
  3005.  159, // Minimum in-band energy threshold
  3006.  21, // 21/32 in-band to broad-band ratio
  3007.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3008. },
  3009. { // 600.txt
  3010. 29116, // A1 = -1.777100
  3011.  -32603, // A2 = 0.994965
  3012.  -165, // B2 = -0.005039
  3013.  0, // B1 = 0.000000
  3014.  165, // B0 = 0.005039
  3015.  29089, // A1 = -1.775452
  3016.  -32708, // A2 = 0.998199
  3017.  6963, // B2 = 0.212494
  3018.  -6172, // B1 = -0.376770
  3019.  6963, // B0 = 0.212494
  3020.  29237, // A1 = -1.784485
  3021.  -32710, // A2 = 0.998230
  3022.  24197, // B2 = 0.738464
  3023.  -21657, // B1 = -1.321899
  3024.  24197, // B0 = 0.738464
  3025.  5, // Internal filter scaling
  3026.  159, // Minimum in-band energy threshold
  3027.  21, // 21/32 in-band to broad-band ratio
  3028.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3029. },
  3030. { // 660.txt
  3031. 28376, // A1 = -1.731934
  3032.  -32567, // A2 = 0.993896
  3033.  -363, // B2 = -0.011102
  3034.  0, // B1 = 0.000000
  3035.  363, // B0 = 0.011102
  3036.  28337, // A1 = -1.729614
  3037.  -32683, // A2 = 0.997434
  3038.  21766, // B2 = 0.664246
  3039.  -18761, // B1 = -1.145081
  3040.  21766, // B0 = 0.664246
  3041.  28513, // A1 = -1.740356
  3042.  -32686, // A2 = 0.997498
  3043.  2509, // B2 = 0.076584
  3044.  -2196, // B1 = -0.134041
  3045.  2509, // B0 = 0.076584
  3046.  5, // Internal filter scaling
  3047.  159, // Minimum in-band energy threshold
  3048.  21, // 21/32 in-band to broad-band ratio
  3049.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3050. },
  3051. { // 700.txt
  3052. 27844, // A1 = -1.699463
  3053.  -32563, // A2 = 0.993744
  3054.  -366, // B2 = -0.011187
  3055.  0, // B1 = 0.000000
  3056.  366, // B0 = 0.011187
  3057.  27797, // A1 = -1.696655
  3058.  -32686, // A2 = 0.997498
  3059.  22748, // B2 = 0.694214
  3060.  -19235, // B1 = -1.174072
  3061.  22748, // B0 = 0.694214
  3062.  27995, // A1 = -1.708740
  3063.  -32688, // A2 = 0.997559
  3064.  2964, // B2 = 0.090477
  3065.  -2546, // B1 = -0.155449
  3066.  2964, // B0 = 0.090477
  3067.  5, // Internal filter scaling
  3068.  159, // Minimum in-band energy threshold
  3069.  21, // 21/32 in-band to broad-band ratio
  3070.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3071. },
  3072. { // 740.txt
  3073. 27297, // A1 = -1.666077
  3074.  -32551, // A2 = 0.993408
  3075.  -345, // B2 = -0.010540
  3076.  0, // B1 = 0.000000
  3077.  345, // B0 = 0.010540
  3078.  27240, // A1 = -1.662598
  3079.  -32683, // A2 = 0.997406
  3080.  22560, // B2 = 0.688477
  3081.  -18688, // B1 = -1.140625
  3082.  22560, // B0 = 0.688477
  3083.  27461, // A1 = -1.676147
  3084.  -32684, // A2 = 0.997467
  3085.  3541, // B2 = 0.108086
  3086.  -2985, // B1 = -0.182220
  3087.  3541, // B0 = 0.108086
  3088.  5, // Internal filter scaling
  3089.  159, // Minimum in-band energy threshold
  3090.  21, // 21/32 in-band to broad-band ratio
  3091.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3092. },
  3093. { // 750.txt
  3094. 27155, // A1 = -1.657410
  3095.  -32551, // A2 = 0.993408
  3096.  -462, // B2 = -0.014117
  3097.  0, // B1 = 0.000000
  3098.  462, // B0 = 0.014117
  3099.  27097, // A1 = -1.653870
  3100.  -32683, // A2 = 0.997406
  3101.  32495, // B2 = 0.991699
  3102.  -26776, // B1 = -1.634338
  3103.  32495, // B0 = 0.991699
  3104.  27321, // A1 = -1.667542
  3105.  -32684, // A2 = 0.997467
  3106.  1835, // B2 = 0.056007
  3107.  -1539, // B1 = -0.093948
  3108.  1835, // B0 = 0.056007
  3109.  5, // Internal filter scaling
  3110.  159, // Minimum in-band energy threshold
  3111.  21, // 21/32 in-band to broad-band ratio
  3112.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3113. },
  3114. { // f750_1450[]
  3115. 19298, // A1 = 1.177917
  3116.  -24471, // A2 = -0.746796
  3117.  -4152, // B2 = -0.126709
  3118.  0, // B1 = 0
  3119.  4152, // B0 = 0.126709
  3120.  12902, // A1 = 0.787476
  3121.  -29091, // A2 = -0.887817
  3122.  12491, // B2 = 0.38121
  3123.  -1794, // B1 = -0.109528
  3124.  12494, // B0 = 0.381317
  3125.  26291, // A1 = 1.604736
  3126.  -30470, // A2 = -0.929901
  3127.  28859, // B2 = 0.880737
  3128.  -26084, // B1 = -1.592102
  3129.  28861, // B0 = 0.880798
  3130.  7, // Internal filter scaling
  3131.  159, // Minimum in-band energy threshold
  3132.  21, // 21/32 in-band to broad-band ratio
  3133.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3134. },
  3135. { // 770.txt
  3136. 26867, // A1 = -1.639832
  3137.  -32551, // A2 = 0.993408
  3138.  -123, // B2 = -0.003755
  3139.  0, // B1 = 0.000000
  3140.  123, // B0 = 0.003755
  3141.  26805, // A1 = -1.636108
  3142.  -32683, // A2 = 0.997406
  3143.  17297, // B2 = 0.527863
  3144.  -14096, // B1 = -0.860382
  3145.  17297, // B0 = 0.527863
  3146.  27034, // A1 = -1.650085
  3147.  -32684, // A2 = 0.997467
  3148.  12958, // B2 = 0.395477
  3149.  -10756, // B1 = -0.656525
  3150.  12958, // B0 = 0.395477
  3151.  5, // Internal filter scaling
  3152.  159, // Minimum in-band energy threshold
  3153.  21, // 21/32 in-band to broad-band ratio
  3154.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3155. },
  3156. { // 800.txt
  3157. 26413, // A1 = -1.612122
  3158.  -32547, // A2 = 0.993286
  3159.  -223, // B2 = -0.006825
  3160.  0, // B1 = 0.000000
  3161.  223, // B0 = 0.006825
  3162.  26342, // A1 = -1.607849
  3163.  -32686, // A2 = 0.997498
  3164.  6391, // B2 = 0.195053
  3165.  -5120, // B1 = -0.312531
  3166.  6391, // B0 = 0.195053
  3167.  26593, // A1 = -1.623108
  3168.  -32688, // A2 = 0.997559
  3169.  23681, // B2 = 0.722717
  3170.  -19328, // B1 = -1.179688
  3171.  23681, // B0 = 0.722717
  3172.  5, // Internal filter scaling
  3173.  159, // Minimum in-band energy threshold
  3174.  21, // 21/32 in-band to broad-band ratio
  3175.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3176. },
  3177. { // 816.txt
  3178. 26168, // A1 = -1.597209
  3179.  -32528, // A2 = 0.992706
  3180.  -235, // B2 = -0.007182
  3181.  0, // B1 = 0.000000
  3182.  235, // B0 = 0.007182
  3183.  26092, // A1 = -1.592590
  3184.  -32675, // A2 = 0.997192
  3185.  20823, // B2 = 0.635498
  3186.  -16510, // B1 = -1.007751
  3187.  20823, // B0 = 0.635498
  3188.  26363, // A1 = -1.609070
  3189.  -32677, // A2 = 0.997253
  3190.  6739, // B2 = 0.205688
  3191.  -5459, // B1 = -0.333206
  3192.  6739, // B0 = 0.205688
  3193.  5, // Internal filter scaling
  3194.  159, // Minimum in-band energy threshold
  3195.  21, // 21/32 in-band to broad-band ratio
  3196.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3197. },
  3198. { // 850.txt
  3199. 25641, // A1 = -1.565063
  3200.  -32536, // A2 = 0.992950
  3201.  -121, // B2 = -0.003707
  3202.  0, // B1 = 0.000000
  3203.  121, // B0 = 0.003707
  3204.  25560, // A1 = -1.560059
  3205.  -32684, // A2 = 0.997437
  3206.  18341, // B2 = 0.559753
  3207.  -14252, // B1 = -0.869904
  3208.  18341, // B0 = 0.559753
  3209.  25837, // A1 = -1.577026
  3210.  -32684, // A2 = 0.997467
  3211.  16679, // B2 = 0.509003
  3212.  -13232, // B1 = -0.807648
  3213.  16679, // B0 = 0.509003
  3214.  5, // Internal filter scaling
  3215.  159, // Minimum in-band energy threshold
  3216.  21, // 21/32 in-band to broad-band ratio
  3217.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3218. },
  3219. { // f857_1645[]
  3220. 16415, // A1 = 1.001953
  3221.  -23669, // A2 = -0.722321
  3222.  -4549, // B2 = -0.138847
  3223.  0, // B1 = 0
  3224.  4549, // B0 = 0.138847
  3225.  8456, // A1 = 0.516174
  3226.  -28996, // A2 = -0.884918
  3227.  13753, // B2 = 0.419724
  3228.  -12, // B1 = -0.000763
  3229.  13757, // B0 = 0.419846
  3230.  24632, // A1 = 1.503418
  3231.  -30271, // A2 = -0.923828
  3232.  29070, // B2 = 0.887146
  3233.  -25265, // B1 = -1.542114
  3234.  29073, // B0 = 0.887268
  3235.  7, // Internal filter scaling
  3236.  159, // Minimum in-band energy threshold
  3237.  21, // 21/32 in-band to broad-band ratio
  3238.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3239. },
  3240. { // 900.txt
  3241. 24806, // A1 = -1.514099
  3242.  -32501, // A2 = 0.991852
  3243.  -326, // B2 = -0.009969
  3244.  0, // B1 = 0.000000
  3245.  326, // B0 = 0.009969
  3246.  24709, // A1 = -1.508118
  3247.  -32659, // A2 = 0.996674
  3248.  20277, // B2 = 0.618835
  3249.  -15182, // B1 = -0.926636
  3250.  20277, // B0 = 0.618835
  3251.  25022, // A1 = -1.527222
  3252.  -32661, // A2 = 0.996735
  3253.  4320, // B2 = 0.131836
  3254.  -3331, // B1 = -0.203339
  3255.  4320, // B0 = 0.131836
  3256.  5, // Internal filter scaling
  3257.  159, // Minimum in-band energy threshold
  3258.  21, // 21/32 in-band to broad-band ratio
  3259.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3260. },
  3261. { // f900_1300[]
  3262. 19776, // A1 = 1.207092
  3263.  -27437, // A2 = -0.837341
  3264.  -2666, // B2 = -0.081371
  3265.  0, // B1 = 0
  3266.  2666, // B0 = 0.081371
  3267.  16302, // A1 = 0.995026
  3268.  -30354, // A2 = -0.926361
  3269.  10389, // B2 = 0.317062
  3270.  -3327, // B1 = -0.203064
  3271.  10389, // B0 = 0.317062
  3272.  24299, // A1 = 1.483154
  3273.  -30930, // A2 = -0.943909
  3274.  25016, // B2 = 0.763428
  3275.  -21171, // B1 = -1.292236
  3276.  25016, // B0 = 0.763428
  3277.  7, // Internal filter scaling
  3278.  159, // Minimum in-band energy threshold
  3279.  21, // 21/32 in-band to broad-band ratio
  3280.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3281. },
  3282. { // f935_1215[]
  3283. 20554, // A1 = 1.254517
  3284.  -28764, // A2 = -0.877838
  3285.  -2048, // B2 = -0.062515
  3286.  0, // B1 = 0
  3287.  2048, // B0 = 0.062515
  3288.  18209, // A1 = 1.11145
  3289.  -30951, // A2 = -0.94458
  3290.  9390, // B2 = 0.286575
  3291.  -3955, // B1 = -0.241455
  3292.  9390, // B0 = 0.286575
  3293.  23902, // A1 = 1.458923
  3294.  -31286, // A2 = -0.954803
  3295.  23252, // B2 = 0.709595
  3296.  -19132, // B1 = -1.167725
  3297.  23252, // B0 = 0.709595
  3298.  7, // Internal filter scaling
  3299.  159, // Minimum in-band energy threshold
  3300.  21, // 21/32 in-band to broad-band ratio
  3301.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3302. },
  3303. { // f941_1477[]
  3304. 17543, // A1 = 1.07074
  3305.  -26220, // A2 = -0.800201
  3306.  -3298, // B2 = -0.100647
  3307.  0, // B1 = 0
  3308.  3298, // B0 = 0.100647
  3309.  12423, // A1 = 0.75827
  3310.  -30036, // A2 = -0.916626
  3311.  12651, // B2 = 0.386078
  3312.  -2444, // B1 = -0.14917
  3313.  12653, // B0 = 0.386154
  3314.  23518, // A1 = 1.435425
  3315.  -30745, // A2 = -0.938293
  3316.  27282, // B2 = 0.832581
  3317.  -22529, // B1 = -1.375122
  3318.  27286, // B0 = 0.832703
  3319.  7, // Internal filter scaling
  3320.  159, // Minimum in-band energy threshold
  3321.  21, // 21/32 in-band to broad-band ratio
  3322.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3323. },
  3324. { // 942.txt
  3325. 24104, // A1 = -1.471252
  3326.  -32507, // A2 = 0.992065
  3327.  -351, // B2 = -0.010722
  3328.  0, // B1 = 0.000000
  3329.  351, // B0 = 0.010722
  3330.  23996, // A1 = -1.464600
  3331.  -32671, // A2 = 0.997040
  3332.  22848, // B2 = 0.697266
  3333.  -16639, // B1 = -1.015564
  3334.  22848, // B0 = 0.697266
  3335.  24332, // A1 = -1.485168
  3336.  -32673, // A2 = 0.997101
  3337.  4906, // B2 = 0.149727
  3338.  -3672, // B1 = -0.224174
  3339.  4906, // B0 = 0.149727
  3340.  5, // Internal filter scaling
  3341.  159, // Minimum in-band energy threshold
  3342.  21, // 21/32 in-band to broad-band ratio
  3343.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3344. },
  3345. { // 950.txt
  3346. 23967, // A1 = -1.462830
  3347.  -32507, // A2 = 0.992065
  3348.  -518, // B2 = -0.015821
  3349.  0, // B1 = 0.000000
  3350.  518, // B0 = 0.015821
  3351.  23856, // A1 = -1.456055
  3352.  -32671, // A2 = 0.997040
  3353.  26287, // B2 = 0.802246
  3354.  -19031, // B1 = -1.161560
  3355.  26287, // B0 = 0.802246
  3356.  24195, // A1 = -1.476746
  3357.  -32673, // A2 = 0.997101
  3358.  2890, // B2 = 0.088196
  3359.  -2151, // B1 = -0.131317
  3360.  2890, // B0 = 0.088196
  3361.  5, // Internal filter scaling
  3362.  159, // Minimum in-band energy threshold
  3363.  21, // 21/32 in-band to broad-band ratio
  3364.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3365. },
  3366. { // f950_1400[]
  3367. 18294, // A1 = 1.116638
  3368.  -26962, // A2 = -0.822845
  3369.  -2914, // B2 = -0.088936
  3370.  0, // B1 = 0
  3371.  2914, // B0 = 0.088936
  3372.  14119, // A1 = 0.861786
  3373.  -30227, // A2 = -0.922455
  3374.  11466, // B2 = 0.349945
  3375.  -2833, // B1 = -0.172943
  3376.  11466, // B0 = 0.349945
  3377.  23431, // A1 = 1.430115
  3378.  -30828, // A2 = -0.940796
  3379.  25331, // B2 = 0.773071
  3380.  -20911, // B1 = -1.276367
  3381.  25331, // B0 = 0.773071
  3382.  7, // Internal filter scaling
  3383.  159, // Minimum in-band energy threshold
  3384.  21, // 21/32 in-band to broad-band ratio
  3385.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3386. },
  3387. { // 975.txt
  3388. 23521, // A1 = -1.435608
  3389.  -32489, // A2 = 0.991516
  3390.  -193, // B2 = -0.005915
  3391.  0, // B1 = 0.000000
  3392.  193, // B0 = 0.005915
  3393.  23404, // A1 = -1.428467
  3394.  -32655, // A2 = 0.996582
  3395.  17740, // B2 = 0.541412
  3396.  -12567, // B1 = -0.767029
  3397.  17740, // B0 = 0.541412
  3398.  23753, // A1 = -1.449829
  3399.  -32657, // A2 = 0.996613
  3400.  9090, // B2 = 0.277405
  3401.  -6662, // B1 = -0.406647
  3402.  9090, // B0 = 0.277405
  3403.  5, // Internal filter scaling
  3404.  159, // Minimum in-band energy threshold
  3405.  21, // 21/32 in-band to broad-band ratio
  3406.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3407. },
  3408. { // 1000.txt
  3409. 23071, // A1 = -1.408203
  3410.  -32489, // A2 = 0.991516
  3411.  -293, // B2 = -0.008965
  3412.  0, // B1 = 0.000000
  3413.  293, // B0 = 0.008965
  3414.  22951, // A1 = -1.400818
  3415.  -32655, // A2 = 0.996582
  3416.  5689, // B2 = 0.173645
  3417.  -3951, // B1 = -0.241150
  3418.  5689, // B0 = 0.173645
  3419.  23307, // A1 = -1.422607
  3420.  -32657, // A2 = 0.996613
  3421.  18692, // B2 = 0.570435
  3422.  -13447, // B1 = -0.820770
  3423.  18692, // B0 = 0.570435
  3424.  5, // Internal filter scaling
  3425.  159, // Minimum in-band energy threshold
  3426.  21, // 21/32 in-band to broad-band ratio
  3427.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3428. },
  3429. { // 1020.txt
  3430. 22701, // A1 = -1.385620
  3431.  -32474, // A2 = 0.991058
  3432.  -292, // B2 = -0.008933
  3433.  0, //163840      , // B1 = 10.000000
  3434.  292, // B0 = 0.008933
  3435.  22564, // A1 = -1.377258
  3436.  -32655, // A2 = 0.996552
  3437.  20756, // B2 = 0.633423
  3438.  -14176, // B1 = -0.865295
  3439.  20756, // B0 = 0.633423
  3440.  22960, // A1 = -1.401428
  3441.  -32657, // A2 = 0.996613
  3442.  6520, // B2 = 0.198990
  3443.  -4619, // B1 = -0.281937
  3444.  6520, // B0 = 0.198990
  3445.  5, // Internal filter scaling
  3446.  159, // Minimum in-band energy threshold
  3447.  21, // 21/32 in-band to broad-band ratio
  3448.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3449. },
  3450. { // 1050.txt
  3451. 22142, // A1 = -1.351501
  3452.  -32474, // A2 = 0.991058
  3453.  -147, // B2 = -0.004493
  3454.  0, // B1 = 0.000000
  3455.  147, // B0 = 0.004493
  3456.  22000, // A1 = -1.342834
  3457.  -32655, // A2 = 0.996552
  3458.  15379, // B2 = 0.469360
  3459.  -10237, // B1 = -0.624847
  3460.  15379, // B0 = 0.469360
  3461.  22406, // A1 = -1.367554
  3462.  -32657, // A2 = 0.996613
  3463.  17491, // B2 = 0.533783
  3464.  -12096, // B1 = -0.738312
  3465.  17491, // B0 = 0.533783
  3466.  5, // Internal filter scaling
  3467.  159, // Minimum in-band energy threshold
  3468.  21, // 21/32 in-band to broad-band ratio
  3469.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3470. },
  3471. { // f1100_1750[]
  3472. 12973, // A1 = 0.79184
  3473.  -24916, // A2 = -0.760376
  3474.  6655, // B2 = 0.203102
  3475.  367, // B1 = 0.0224
  3476.  6657, // B0 = 0.203171
  3477.  5915, // A1 = 0.361053
  3478.  -29560, // A2 = -0.90213
  3479.  -7777, // B2 = -0.23735
  3480.  0, // B1 = 0
  3481.  7777, // B0 = 0.23735
  3482.  20510, // A1 = 1.251892
  3483.  -30260, // A2 = -0.923462
  3484.  26662, // B2 = 0.81366
  3485.  -20573, // B1 = -1.255737
  3486.  26668, // B0 = 0.813843
  3487.  7, // Internal filter scaling
  3488.  159, // Minimum in-band energy threshold
  3489.  21, // 21/32 in-band to broad-band ratio
  3490.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3491. },
  3492. { // 1140.txt
  3493. 20392, // A1 = -1.244629
  3494.  -32460, // A2 = 0.990601
  3495.  -270, // B2 = -0.008240
  3496.  0, // B1 = 0.000000
  3497.  270, // B0 = 0.008240
  3498.  20218, // A1 = -1.234009
  3499.  -32655, // A2 = 0.996582
  3500.  21337, // B2 = 0.651154
  3501.  -13044, // B1 = -0.796143
  3502.  21337, // B0 = 0.651154
  3503.  20684, // A1 = -1.262512
  3504.  -32657, // A2 = 0.996643
  3505.  8572, // B2 = 0.261612
  3506.  -5476, // B1 = -0.334244
  3507.  8572, // B0 = 0.261612
  3508.  5, // Internal filter scaling
  3509.  159, // Minimum in-band energy threshold
  3510.  21, // 21/32 in-band to broad-band ratio
  3511.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3512. },
  3513. { // 1200.txt
  3514. 19159, // A1 = -1.169373
  3515.  -32456, // A2 = 0.990509
  3516.  -335, // B2 = -0.010252
  3517.  0, // B1 = 0.000000
  3518.  335, // B0 = 0.010252
  3519.  18966, // A1 = -1.157593
  3520.  -32661, // A2 = 0.996735
  3521.  6802, // B2 = 0.207588
  3522.  -3900, // B1 = -0.238098
  3523.  6802, // B0 = 0.207588
  3524.  19467, // A1 = -1.188232
  3525.  -32661, // A2 = 0.996765
  3526.  25035, // B2 = 0.764008
  3527.  -15049, // B1 = -0.918579
  3528.  25035, // B0 = 0.764008
  3529.  5, // Internal filter scaling
  3530.  159, // Minimum in-band energy threshold
  3531.  21, // 21/32 in-band to broad-band ratio
  3532.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3533. },
  3534. { // 1209.txt
  3535. 18976, // A1 = -1.158264
  3536.  -32439, // A2 = 0.989990
  3537.  -183, // B2 = -0.005588
  3538.  0, // B1 = 0.000000
  3539.  183, // B0 = 0.005588
  3540.  18774, // A1 = -1.145874
  3541.  -32650, // A2 = 0.996429
  3542.  15468, // B2 = 0.472076
  3543.  -8768, // B1 = -0.535217
  3544.  15468, // B0 = 0.472076
  3545.  19300, // A1 = -1.177979
  3546.  -32652, // A2 = 0.996490
  3547.  19840, // B2 = 0.605499
  3548.  -11842, // B1 = -0.722809
  3549.  19840, // B0 = 0.605499
  3550.  5, // Internal filter scaling
  3551.  159, // Minimum in-band energy threshold
  3552.  21, // 21/32 in-band to broad-band ratio
  3553.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3554. },
  3555. { // 1330.txt
  3556. 16357, // A1 = -0.998413
  3557.  -32368, // A2 = 0.987793
  3558.  -217, // B2 = -0.006652
  3559.  0, // B1 = 0.000000
  3560.  217, // B0 = 0.006652
  3561.  16107, // A1 = -0.983126
  3562.  -32601, // A2 = 0.994904
  3563.  11602, // B2 = 0.354065
  3564.  -5555, // B1 = -0.339111
  3565.  11602, // B0 = 0.354065
  3566.  16722, // A1 = -1.020630
  3567.  -32603, // A2 = 0.994965
  3568.  15574, // B2 = 0.475311
  3569.  -8176, // B1 = -0.499069
  3570.  15574, // B0 = 0.475311
  3571.  5, // Internal filter scaling
  3572.  159, // Minimum in-band energy threshold
  3573.  21, // 21/32 in-band to broad-band ratio
  3574.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3575. },
  3576. { // 1336.txt
  3577. 16234, // A1 = -0.990875
  3578.  32404, // A2 = -0.988922
  3579.  -193, // B2 = -0.005908
  3580.  0, // B1 = 0.000000
  3581.  193, // B0 = 0.005908
  3582.  15986, // A1 = -0.975769
  3583.  -32632, // A2 = 0.995880
  3584.  18051, // B2 = 0.550903
  3585.  -8658, // B1 = -0.528473
  3586.  18051, // B0 = 0.550903
  3587.  16591, // A1 = -1.012695
  3588.  -32634, // A2 = 0.995941
  3589.  15736, // B2 = 0.480240
  3590.  -8125, // B1 = -0.495926
  3591.  15736, // B0 = 0.480240
  3592.  5, // Internal filter scaling
  3593.  159, // Minimum in-band energy threshold
  3594.  21, // 21/32 in-band to broad-band ratio
  3595.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3596. },
  3597. { // 1366.txt
  3598. 15564, // A1 = -0.949982
  3599.  -32404, // A2 = 0.988922
  3600.  -269, // B2 = -0.008216
  3601.  0, // B1 = 0.000000
  3602.  269, // B0 = 0.008216
  3603.  15310, // A1 = -0.934479
  3604.  -32632, // A2 = 0.995880
  3605.  10815, // B2 = 0.330063
  3606.  -4962, // B1 = -0.302887
  3607.  10815, // B0 = 0.330063
  3608.  15924, // A1 = -0.971924
  3609.  -32634, // A2 = 0.995941
  3610.  18880, // B2 = 0.576172
  3611.  -9364, // B1 = -0.571594
  3612.  18880, // B0 = 0.576172
  3613.  5, // Internal filter scaling
  3614.  159, // Minimum in-band energy threshold
  3615.  21, // 21/32 in-band to broad-band ratio
  3616.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3617. },
  3618. { // 1380.txt
  3619. 15247, // A1 = -0.930603
  3620.  -32397, // A2 = 0.988708
  3621.  -244, // B2 = -0.007451
  3622.  0, // B1 = 0.000000
  3623.  244, // B0 = 0.007451
  3624.  14989, // A1 = -0.914886
  3625.  -32627, // A2 = 0.995697
  3626.  18961, // B2 = 0.578644
  3627.  -8498, // B1 = -0.518707
  3628.  18961, // B0 = 0.578644
  3629.  15608, // A1 = -0.952667
  3630.  -32628, // A2 = 0.995758
  3631.  11145, // B2 = 0.340134
  3632.  -5430, // B1 = -0.331467
  3633.  11145, // B0 = 0.340134
  3634.  5, // Internal filter scaling
  3635.  159, // Minimum in-band energy threshold
  3636.  21, // 21/32 in-band to broad-band ratio
  3637.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3638. },
  3639. { // 1400.txt
  3640. 14780, // A1 = -0.902130
  3641.  -32393, // A2 = 0.988586
  3642.  -396, // B2 = -0.012086
  3643.  0, // B1 = 0.000000
  3644.  396, // B0 = 0.012086
  3645.  14510, // A1 = -0.885651
  3646.  -32630, // A2 = 0.995819
  3647.  6326, // B2 = 0.193069
  3648.  -2747, // B1 = -0.167671
  3649.  6326, // B0 = 0.193069
  3650.  15154, // A1 = -0.924957
  3651.  -32632, // A2 = 0.995850
  3652.  23235, // B2 = 0.709076
  3653.  -10983, // B1 = -0.670380
  3654.  23235, // B0 = 0.709076
  3655.  5, // Internal filter scaling
  3656.  159, // Minimum in-band energy threshold
  3657.  21, // 21/32 in-band to broad-band ratio
  3658.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3659. },
  3660. { // 1477.txt
  3661. 13005, // A1 = -0.793793
  3662.  -32368, // A2 = 0.987823
  3663.  -500, // B2 = -0.015265
  3664.  0, // B1 = 0.000000
  3665.  500, // B0 = 0.015265
  3666.  12708, // A1 = -0.775665
  3667.  -32615, // A2 = 0.995331
  3668.  11420, // B2 = 0.348526
  3669.  -4306, // B1 = -0.262833
  3670.  11420, // B0 = 0.348526
  3671.  13397, // A1 = -0.817688
  3672.  -32615, // A2 = 0.995361
  3673.  9454, // B2 = 0.288528
  3674.  -3981, // B1 = -0.243027
  3675.  9454, // B0 = 0.288528
  3676.  5, // Internal filter scaling
  3677.  159, // Minimum in-band energy threshold
  3678.  21, // 21/32 in-band to broad-band ratio
  3679.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3680. },
  3681. { // 1600.txt
  3682. 10046, // A1 = -0.613190
  3683.  -32331, // A2 = 0.986694
  3684.  -455, // B2 = -0.013915
  3685.  0, // B1 = 0.000000
  3686.  455, // B0 = 0.013915
  3687.  9694, // A1 = -0.591705
  3688.  -32601, // A2 = 0.994934
  3689.  6023, // B2 = 0.183815
  3690.  -1708, // B1 = -0.104279
  3691.  6023, // B0 = 0.183815
  3692.  10478, // A1 = -0.639587
  3693.  -32603, // A2 = 0.994965
  3694.  22031, // B2 = 0.672333
  3695.  -7342, // B1 = -0.448151
  3696.  22031, // B0 = 0.672333
  3697.  5, // Internal filter scaling
  3698.  159, // Minimum in-band energy threshold
  3699.  21, // 21/32 in-band to broad-band ratio
  3700.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3701. },
  3702. { // f1633_1638[]
  3703. 9181, // A1 = 0.560394
  3704.  -32256, // A2 = -0.984375
  3705.  -556, // B2 = -0.016975
  3706.  0, // B1 = 0
  3707.  556, // B0 = 0.016975
  3708.  8757, // A1 = 0.534515
  3709.  -32574, // A2 = -0.99408
  3710.  8443, // B2 = 0.25769
  3711.  -2135, // B1 = -0.130341
  3712.  8443, // B0 = 0.25769
  3713.  9691, // A1 = 0.591522
  3714.  -32574, // A2 = -0.99411
  3715.  15446, // B2 = 0.471375
  3716.  -4809, // B1 = -0.293579
  3717.  15446, // B0 = 0.471375
  3718.  7, // Internal filter scaling
  3719.  159, // Minimum in-band energy threshold
  3720.  21, // 21/32 in-band to broad-band ratio
  3721.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3722. },
  3723. { // 1800.txt
  3724. 5076, // A1 = -0.309875
  3725.  -32304, // A2 = 0.985840
  3726.  -508, // B2 = -0.015503
  3727.  0, // B1 = 0.000000
  3728.  508, // B0 = 0.015503
  3729.  4646, // A1 = -0.283600
  3730.  -32605, // A2 = 0.995026
  3731.  6742, // B2 = 0.205780
  3732.  -878, // B1 = -0.053635
  3733.  6742, // B0 = 0.205780
  3734.  5552, // A1 = -0.338928
  3735.  -32605, // A2 = 0.995056
  3736.  23667, // B2 = 0.722260
  3737.  -4297, // B1 = -0.262329
  3738.  23667, // B0 = 0.722260
  3739.  5, // Internal filter scaling
  3740.  159, // Minimum in-band energy threshold
  3741.  21, // 21/32 in-band to broad-band ratio
  3742.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3743. },
  3744. { // 1860.txt
  3745. 3569, // A1 = -0.217865
  3746.  -32292, // A2 = 0.985504
  3747.  -239, // B2 = -0.007322
  3748.  0, // B1 = 0.000000
  3749.  239, // B0 = 0.007322
  3750.  3117, // A1 = -0.190277
  3751.  -32603, // A2 = 0.994965
  3752.  18658, // B2 = 0.569427
  3753.  -1557, // B1 = -0.095032
  3754.  18658, // B0 = 0.569427
  3755.  4054, // A1 = -0.247437
  3756.  -32603, // A2 = 0.994965
  3757.  18886, // B2 = 0.576385
  3758.  -2566, // B1 = -0.156647
  3759.  18886, // B0 = 0.576385
  3760.  5, // Internal filter scaling
  3761.  159, // Minimum in-band energy threshold
  3762.  21, // 21/32 in-band to broad-band ratio
  3763.  0x0FF5 // shift-mask 0x0FF (look at 16 half-frames) bit count = 5
  3764. },};
  3765. static int ixj_init_filter(int board, IXJ_FILTER * jf)
  3766. {
  3767. unsigned short cmd;
  3768. int cnt, max;
  3769. IXJ *j = &ixj[board];
  3770. if (jf->filter > 3) {
  3771. return -1;
  3772. }
  3773. if (ixj_WriteDSPCommand(0x5154 + jf->filter, board)) // Select Filter
  3774. return -1;
  3775. if (!jf->enable) {
  3776. if (ixj_WriteDSPCommand(0x5152, board)) // Disable Filter
  3777. return -1;
  3778. else
  3779. return 0;
  3780. } else {
  3781. if (ixj_WriteDSPCommand(0x5153, board)) // Enable Filter
  3782. return -1;
  3783. // Select the filter (f0 - f3) to use.
  3784. if (ixj_WriteDSPCommand(0x5154 + jf->filter, board))
  3785. return -1;
  3786. }
  3787. if (jf->freq < 12 && jf->freq > 3) {
  3788. // Select the frequency for the selected filter.
  3789. if (ixj_WriteDSPCommand(0x5170 + jf->freq, board))
  3790. return -1;
  3791. } else if (jf->freq > 11) {
  3792. // We need to load a programmable filter set for undefined
  3793. // frequencies.  So we will point the filter to a programmable set.
  3794. // Since there are only 4 filters and 4 programmable sets, we will
  3795. // just point the filter to the same number set and program it for the
  3796. // frequency we want.
  3797. if (ixj_WriteDSPCommand(0x5170 + jf->filter, board))
  3798. return -1;
  3799. if (j->ver.low != 0x12) {
  3800. cmd = 0x515B;
  3801. max = 19;
  3802. } else {
  3803. cmd = 0x515E;
  3804. max = 15;
  3805. }
  3806. if (ixj_WriteDSPCommand(cmd, board))
  3807. return -1;
  3808. for (cnt = 0; cnt < max; cnt++) {
  3809. if (ixj_WriteDSPCommand(tone_table[jf->freq - 12][cnt], board))
  3810. return -1;
  3811. }
  3812. }
  3813. return 0;
  3814. }
  3815. static int ixj_init_tone(int board, IXJ_TONE * ti)
  3816. {
  3817. int freq0, freq1;
  3818. unsigned short data;
  3819. if (ti->freq0) {
  3820. freq0 = ti->freq0;
  3821. } else {
  3822. freq0 = 0x7FFF;
  3823. }
  3824. if (ti->freq1) {
  3825. freq1 = ti->freq1;
  3826. } else {
  3827. freq1 = 0x7FFF;
  3828. }
  3829. //  if(ti->tone_index > 12 && ti->tone_index < 28)
  3830. {
  3831. if (ixj_WriteDSPCommand(0x6800 + ti->tone_index, board))
  3832. return -1;
  3833. if (ixj_WriteDSPCommand(0x6000 + (ti->gain0 << 4) + ti->gain1, board))
  3834. return -1;
  3835. data = freq0;
  3836. if (ixj_WriteDSPCommand(data, board))
  3837. return -1;
  3838. data = freq1;
  3839. if (ixj_WriteDSPCommand(data, board))
  3840. return -1;
  3841. }
  3842. return freq0;
  3843. }