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

流媒体/Mpeg4/MP4

开发平台:

C/C++

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