From: Derek J S. <der...@us...> - 2005-06-27 08:15:03
|
Update of /cvsroot/openh323/nixj/telephony In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23354/telephony Modified Files: ipj.c ixj-ver.h ixj.c ixj.h ixj_data.h ixj_proto.h ixjuser.h phonedev.c proslic.c Log Message: First release of 2.6 compatible code. Thanks to Dennis Gilmore Index: proslic.c =================================================================== RCS file: /cvsroot/openh323/nixj/telephony/proslic.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** proslic.c 8 Sep 2004 04:47:35 -0000 1.9 --- proslic.c 27 Jun 2005 08:14:53 -0000 1.10 *************** *** 14,25 **** #include "proslic.h" - - static WORD ixj_SLIC_ind_reg_def[] = { ! 0, 0x55C2, /* Row 0 (1,2,3,A) dtmf detection */ ! 1, 0x51E6, /* Row 1 (4,5,6,B) dtmf detection */ ! 2, 0x4B85, /* Row 2 (7.8.9,C) dtmf detection */ ! 3, 0x4937, /* Row 3 (*,0.#,D) dtmf detection */ ! 4, 0x3333, /* column peak magnitude threshold */ 5, 0x0202, 6, 0x0202, --- 14,23 ---- #include "proslic.h" static WORD ixj_SLIC_ind_reg_def[] = { ! 0, 0x55C2, ! 1, 0x51E6, ! 2, 0x4B85, ! 3, 0x4937, ! 4, 0x3333, 5, 0x0202, 6, 0x0202, *************** *** 28,33 **** 9, 0x0611, 10, 0x0202, ! 11, 0x00E5, /* dtmf power minimum threshold */ ! 12, 0x0A1C, /* Two step AGC, which is in the DTMF path*/ 13, 0x7B30, 14, 0x0063, --- 26,31 ---- 9, 0x0611, 10, 0x0202, ! 11, 0x00E5, ! 12, 0x0A1C, 13, 0x7B30, 14, 0x0063, *************** *** 409,416 **** /* Check interrupt register 3 */ byInt = ixj_SLIC_read_reg(j, PROSLIC_INT3_STATUS_REG); ! if (j->port == PORT_POTS) { ! if (byInt & PROSLIC_DTMF_INT) ! ixj_SLIC_update_dtmf(j); ! } /* Clear the interrupts */ --- 407,412 ---- /* Check interrupt register 3 */ byInt = ixj_SLIC_read_reg(j, PROSLIC_INT3_STATUS_REG); ! if (byInt & PROSLIC_DTMF_INT) ! ixj_SLIC_update_dtmf(j); /* Clear the interrupts */ *************** *** 455,459 **** byVal = ixj_SLIC_read_reg(j, PROSLIC_DTMF_REG); - if (byVal & PROSLIC_DTMF_VALID) { j->dtmf_incoming = 1; --- 451,454 ---- *************** *** 464,469 **** case 0x0a : j->dtmf_current = 0x0b; default: ; ! } ! } } --- 459,465 ---- case 0x0a : j->dtmf_current = 0x0b; default: ; ! } ! ! } } Index: ixj_proto.h =================================================================== RCS file: /cvsroot/openh323/nixj/telephony/ixj_proto.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ixj_proto.h 5 Jul 2004 22:43:46 -0000 1.36 --- ixj_proto.h 27 Jun 2005 08:14:53 -0000 1.37 *************** *** 34,38 **** #endif ! static int ixj_log_scale_volume(int volume, int max); static int ixj_inverse_log_scale_volume(int v, int max); --- 34,38 ---- #endif ! static int ixj_log_scale_volume(int volume, int max_value); static int ixj_inverse_log_scale_volume(int v, int max); *************** *** 55,61 **** extern __inline__ int ixj_get_play_level(IXJ *j); static int ixj_build_play_simple_tone(IXJ *j, unsigned short onTime, unsigned short offTime, char tone, int termination); - static int ixj_append_new_tone_definitions(IXJ *j, IXJ_CADENCE cadence, IXJ_CADENCE_ELEMENT *elements); static void ixj_free_old_cadence_pattern(IXJ *j); static int ixj_play_predefined_tone(IXJ *j, char tone); static int ixj_WaitHighSciBit(IXJ *j); static int ixj_WaitLowSciBit(IXJ *j); --- 55,61 ---- extern __inline__ int ixj_get_play_level(IXJ *j); static int ixj_build_play_simple_tone(IXJ *j, unsigned short onTime, unsigned short offTime, char tone, int termination); static void ixj_free_old_cadence_pattern(IXJ *j); static int ixj_play_predefined_tone(IXJ *j, char tone); + static int ixj_append_new_tone_definitions(IXJ *j, IXJ_CADENCE cadence, IXJ_CADENCE_ELEMENT *elements); static int ixj_WaitHighSciBit(IXJ *j); static int ixj_WaitLowSciBit(IXJ *j); *************** *** 83,87 **** static int ixj_capabilities_check(IXJ *j, struct phone_capability *pcreq); #ifdef __linux__ ! int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd, unsigned long arg); #endif #ifdef __FreeBSD__ --- 83,87 ---- static int ixj_capabilities_check(IXJ *j, struct phone_capability *pcreq); #ifdef __linux__ ! static int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd, unsigned long arg); #endif #ifdef __FreeBSD__ *************** *** 99,102 **** --- 99,103 ---- static int ixj_kernel_safe_sleep_for(IXJ *j, int nJiffies); + static char *ixj_jstr(IXJ *j, KERN_JIFFIES value); static char *ixj_mode_get_name(StringInfo *data, int mode); int ixj_get_status_proc(char *buf); *************** *** 195,199 **** void ixj_cs_release(u_long arg); static void ixj_PCIEE_WriteBit(WORD wEEPROMAddress, BYTE lastLCC, BYTE byData); ! void ixj_exit(void); static char *ixj_write_hex_numbers(char *string, int nData, BYTE *data); --- 196,200 ---- void ixj_cs_release(u_long arg); static void ixj_PCIEE_WriteBit(WORD wEEPROMAddress, BYTE lastLCC, BYTE byData); ! static char *ixj_write_hex_numbers(char *string, int nData, BYTE *data); *************** *** 237,252 **** static void ixj_get_write_buffer(IXJ *j, int size); ! static __inline__ void ixj_clear_bit(IXJ *j, int number); ! static __inline__ void ixj_set_bit(IXJ *j, int number); ! static __inline__ int ixj_test_bit(IXJ *j, int number); ! static __inline__ int ixj_test_and_set_bit(IXJ *j, int number); static void ixj_set_hook_stop_rw_mutex(IXJ *j); ! static __inline__ void ixj_set_current_state(int newState); ! static __inline__ int ixj_error_in_sleep(IXJ *j); ! static __inline__ void ixj_schedule_timeout(IXJ *j,int period); ! static __inline__ int ixj_copy_from_user(void *to, const void *from, int count); ! static __inline__ int ixj_copy_to_user(void *to, const void *from, int count); ! static __inline__ int ixj_cid_bit(unsigned char *a, int n); #endif /*of defining core functions.*/ --- 238,254 ---- static void ixj_get_write_buffer(IXJ *j, int size); ! void ixj_clear_bit(IXJ *j, int number); ! void ixj_set_bit(IXJ *j, int number); ! ! static int ixj_test_bit(IXJ *j, int number); ! static int ixj_test_and_set_bit(IXJ *j, int number); static void ixj_set_hook_stop_rw_mutex(IXJ *j); ! static void ixj_set_current_state(int newState); ! static int ixj_error_in_sleep(IXJ *j); ! static void ixj_schedule_timeout(IXJ *j,int period); ! static int ixj_copy_from_user(void *to, const void *from, int count); ! static int ixj_copy_to_user(void *to, const void *from, int count); ! static int ixj_cid_bit(unsigned char *a, int n); #endif /*of defining core functions.*/ *************** *** 303,304 **** --- 305,313 ---- BYTE ixj_SLIC_get_new_dtmf(IXJ *j); BOOL ixj_SLIC_get_off_hook(IXJ *j); + + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) + void ixj_exit(void); + #else + static void __exit ixj_exit(void); + #endif + Index: ipj.c =================================================================== RCS file: /cvsroot/openh323/nixj/telephony/ipj.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ipj.c 8 Sep 2004 04:47:34 -0000 1.5 --- ipj.c 27 Jun 2005 08:14:51 -0000 1.6 *************** *** 115,121 **** void ixj_TJ_update(IXJ *j) { - if (j->port != PORT_POTS) - return; - j->dtmf_incoming = 0; --- 115,118 ---- Index: ixj.c =================================================================== RCS file: /cvsroot/openh323/nixj/telephony/ixj.c,v retrieving revision 1.132 retrieving revision 1.133 diff -C2 -d -r1.132 -r1.133 *** ixj.c 19 Nov 2004 03:56:26 -0000 1.132 --- ixj.c 27 Jun 2005 08:14:52 -0000 1.133 *************** *** 57,114 **** /* * $Log$ ! * Revision 1.132 2004/11/19 03:56:26 dereksmithies ! * Code to explicitly set the allowable tolerance on a cadence pattern. ! * Thanks to Terry Tremayne of Tremayne Consulting Group and Neale Banks. ! * ! * Revision 1.131 2004/10/01 02:46:54 dereksmithies ! * Several Useful patches from Neale Banks - many thanks. ! * 1)remove duplicate references to a variable, and 2)reorganization to smooth the ! * transition to user defined values for cadence tolerances. [...2747 lines suppressed...] if (PRINT_STARTUP) --- 9979,9987 ---- ((struct resource *)result)->name); ! #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) ! (*pci)->driver_data = j; ! #else ! (*pci)->device = j; ! #endif if (PRINT_STARTUP) *************** *** 9977,9980 **** --- 10020,10025 ---- #endif + + /* The comment below is magic for those who use emacs to edit this file. */ /* With the comment below, the tab key does auto indent to 8 spaces. */ Index: ixj_data.h =================================================================== RCS file: /cvsroot/openh323/nixj/telephony/ixj_data.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ixj_data.h 28 Sep 2004 23:04:34 -0000 1.21 --- ixj_data.h 27 Jun 2005 08:14:53 -0000 1.22 *************** *** 41,45 **** #ifdef __linux__ #include <linux/version.h> /* LINUX_VERSION_CODE & KERNEL_VERSION */ ! #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) || defined(IXJ_STANDALONE) #include "ixjuser.h" /* We need this to get structure for IXJ_TONE defined. */ #else --- 41,45 ---- #ifdef __linux__ #include <linux/version.h> /* LINUX_VERSION_CODE & KERNEL_VERSION */ ! #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) || defined(IXJ_STANDALONE) || (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)) #include "ixjuser.h" /* We need this to get structure for IXJ_TONE defined. */ #else *************** *** 2078,2175 **** StringInfo ioctlNames[] = { ! {"IXJCTL_AEC_GET_LEVEL", IXJCTL_AEC_GET_LEVEL}, ! {"IXJCTL_AEC_START", IXJCTL_AEC_START}, ! {"IXJCTL_AEC_STOP", IXJCTL_AEC_STOP}, ! {"IXJCTL_CARDTYPE", IXJCTL_CARDTYPE}, ! {"IXJCTL_CID", IXJCTL_CID}, ! {"IXJCTL_CIDCW", IXJCTL_CIDCW}, ! {"IXJCTL_DAA_AGAIN", IXJCTL_DAA_AGAIN}, ! {"IXJCTL_DAA_COEFF_SET", IXJCTL_DAA_COEFF_SET}, ! {"IXJCTL_DAA_USER_SET", IXJCTL_DAA_USER_SET}, ! {"IXJCTL_DRYBUFFER_CLEAR", IXJCTL_DRYBUFFER_CLEAR}, ! {"IXJCTL_DRYBUFFER_READ", IXJCTL_DRYBUFFER_READ}, ! {"IXJCTL_DSP_IDLE", IXJCTL_DSP_IDLE}, ! {"IXJCTL_DSP_RESET", IXJCTL_DSP_RESET}, ! {"IXJCTL_DSP_TYPE", IXJCTL_DSP_TYPE}, ! {"IXJCTL_DSP_VERSION", IXJCTL_DSP_VERSION}, ! {"IXJCTL_DTMF_PRESCALE", IXJCTL_DTMF_PRESCALE}, ! {"IXJCTL_FILTER_CADENCE", IXJCTL_FILTER_CADENCE}, ! {"IXJCTL_FILTER_CADENCE_RAW", IXJCTL_FILTER_CADENCE_RAW}, ! {"IXJCTL_FRAMES_READ", IXJCTL_FRAMES_READ}, ! {"IXJCTL_FRAMES_WRITTEN", IXJCTL_FRAMES_WRITTEN}, ! {"IXJCTL_GET_FILTER_HIST", IXJCTL_GET_FILTER_HIST}, ! {"IXJCTL_IS_OFF_HOOK", IXJCTL_IS_OFF_HOOK}, ! {"IXJCTL_HZ", IXJCTL_HZ}, ! {"IXJCTL_INIT_TONE", IXJCTL_INIT_TONE}, ! {"IXJCTL_INTERCOM_START", IXJCTL_INTERCOM_START}, ! {"IXJCTL_INTERCOM_STOP", IXJCTL_INTERCOM_STOP}, ! {"IXJCTL_MIXER", IXJCTL_MIXER}, ! {"IXJCTL_PLAY_CID", IXJCTL_PLAY_CID}, ! {"IXJCTL_PORT", IXJCTL_PORT}, ! {"IXJCTL_POTS_PSTN", IXJCTL_POTS_PSTN}, ! {"IXJCTL_PSTN_LINETEST", IXJCTL_PSTN_LINETEST}, ! {"IXJCTL_RATE", IXJCTL_RATE}, ! {"IXJCTL_READ_WAIT", IXJCTL_READ_WAIT}, ! {"IXJCTL_SC_RXG", IXJCTL_SC_RXG}, ! {"IXJCTL_SC_TXG", IXJCTL_SC_TXG}, ! {"IXJCTL_SERIAL", IXJCTL_SERIAL}, ! {"IXJCTL_SET_FILTER", IXJCTL_SET_FILTER}, ! {"IXJCTL_SET_FILTER_RAW", IXJCTL_SET_FILTER_RAW}, ! {"IXJCTL_SET_INC_RINGING", IXJCTL_SET_INC_RINGING}, ! {"IXJCTL_SET_LED", IXJCTL_SET_LED}, ! {"IXJCTL_SIGCTL", IXJCTL_SIGCTL}, ! {"IXJCTL_TESTRAM", IXJCTL_TESTRAM}, ! {"IXJCTL_TONE_CADENCE", IXJCTL_TONE_CADENCE}, ! {"IXJCTL_VERSION", IXJCTL_VERSION}, ! {"IXJCTL_VMWI", IXJCTL_VMWI}, ! {"IXJCTL_WRITE_WAIT", IXJCTL_WRITE_WAIT}, ! {"OLD_PHONE_RING_START", OLD_PHONE_RING_START}, ! {"PHONE_BUSY", PHONE_BUSY}, ! {"PHONE_CAPABILITIES", PHONE_CAPABILITIES}, ! {"PHONE_CAPABILITIES_CHECK", PHONE_CAPABILITIES_CHECK}, ! {"PHONE_CAPABILITIES_LIST", PHONE_CAPABILITIES_LIST}, ! {"PHONE_CPT_STOP", PHONE_CPT_STOP}, ! {"PHONE_DIALTONE", PHONE_DIALTONE}, ! {"PHONE_DTMF_OOB", PHONE_DTMF_OOB}, ! {"PHONE_DTMF_READY", PHONE_DTMF_READY}, ! {"PHONE_EXCEPTION", PHONE_EXCEPTION}, ! {"PHONE_FRAME", PHONE_FRAME}, ! {"PHONE_GET_DTMF", PHONE_GET_DTMF}, ! {"PHONE_GET_DTMF_ASCII", PHONE_GET_DTMF_ASCII}, ! {"PHONE_GET_TONE_OFF_TIME", PHONE_GET_TONE_OFF_TIME}, ! {"PHONE_GET_TONE_ON_TIME", PHONE_GET_TONE_ON_TIME}, ! {"PHONE_GET_TONE_STATE", PHONE_GET_TONE_STATE}, ! {"PHONE_HOOKSTATE", PHONE_HOOKSTATE}, ! {"PHONE_MAXRINGS", PHONE_MAXRINGS}, ! {"PHONE_PLAY_CODEC", PHONE_PLAY_CODEC}, ! {"PHONE_PLAY_DEPTH", PHONE_PLAY_DEPTH}, ! {"PHONE_PLAY_LEVEL", PHONE_PLAY_LEVEL}, ! {"PHONE_PLAY_START", PHONE_PLAY_START}, ! {"PHONE_PLAY_STOP", PHONE_PLAY_STOP}, ! {"PHONE_PLAY_TONE", PHONE_PLAY_TONE}, ! {"PHONE_PLAY_VOLUME", PHONE_PLAY_VOLUME}, ! {"PHONE_PLAY_VOLUME_LINEAR", PHONE_PLAY_VOLUME_LINEAR}, ! {"PHONE_PSTN_GET_STATE", PHONE_PSTN_GET_STATE}, ! {"PHONE_PSTN_LINETEST", PHONE_PSTN_LINETEST}, ! {"PHONE_PSTN_SET_STATE", PHONE_PSTN_SET_STATE}, ! {"PHONE_QUERY_CODEC", PHONE_QUERY_CODEC}, ! {"PHONE_REC_CODEC", PHONE_REC_CODEC}, ! {"PHONE_REC_DEPTH", PHONE_REC_DEPTH}, ! {"PHONE_REC_LEVEL", PHONE_REC_LEVEL}, ! {"PHONE_REC_START", PHONE_REC_START}, ! {"PHONE_REC_STOP", PHONE_REC_STOP}, ! {"PHONE_REC_VOLUME", PHONE_REC_VOLUME}, ! {"PHONE_REC_VOLUME_LINEAR", PHONE_REC_VOLUME_LINEAR}, ! {"PHONE_RING", PHONE_RING}, ! {"PHONE_RINGBACK", PHONE_RINGBACK}, ! {"PHONE_RING_CADENCE", PHONE_RING_CADENCE}, ! {"PHONE_RING_START", PHONE_RING_START}, ! {"PHONE_RING_STOP", PHONE_RING_STOP}, ! {"PHONE_SET_TONE_OFF_TIME", PHONE_SET_TONE_OFF_TIME}, ! {"PHONE_SET_TONE_ON_TIME", PHONE_SET_TONE_ON_TIME}, ! {"PHONE_VAD", PHONE_VAD}, ! {"PHONE_WINK", PHONE_WINK}, ! {"PHONE_WINK_DURATION", PHONE_WINK_DURATION}, ! {"", 0} }; --- 2078,2173 ---- StringInfo ioctlNames[] = { ! {"IXJCTL_AEC_GET_LEVEL", IXJCTL_AEC_GET_LEVEL}, ! {"IXJCTL_AEC_START", IXJCTL_AEC_START}, ! {"IXJCTL_AEC_STOP", IXJCTL_AEC_STOP}, ! {"IXJCTL_CARDTYPE", IXJCTL_CARDTYPE}, ! {"IXJCTL_CID", IXJCTL_CID}, ! {"IXJCTL_CIDCW", IXJCTL_CIDCW}, ! {"IXJCTL_DAA_AGAIN", IXJCTL_DAA_AGAIN}, ! {"IXJCTL_DAA_COEFF_SET", IXJCTL_DAA_COEFF_SET}, ! {"IXJCTL_DAA_USER_SET", IXJCTL_DAA_USER_SET}, ! {"IXJCTL_DRYBUFFER_CLEAR", IXJCTL_DRYBUFFER_CLEAR}, ! {"IXJCTL_DRYBUFFER_READ", IXJCTL_DRYBUFFER_READ}, ! {"IXJCTL_DSP_IDLE", IXJCTL_DSP_IDLE}, ! {"IXJCTL_DSP_RESET", IXJCTL_DSP_RESET}, ! {"IXJCTL_DSP_TYPE", IXJCTL_DSP_TYPE}, ! {"IXJCTL_DSP_VERSION", IXJCTL_DSP_VERSION}, ! {"IXJCTL_DTMF_PRESCALE", IXJCTL_DTMF_PRESCALE}, ! {"IXJCTL_FILTER_CADENCE", IXJCTL_FILTER_CADENCE}, ! {"IXJCTL_FRAMES_READ", IXJCTL_FRAMES_READ}, ! {"IXJCTL_FRAMES_WRITTEN", IXJCTL_FRAMES_WRITTEN}, ! {"IXJCTL_GET_FILTER_HIST", IXJCTL_GET_FILTER_HIST}, ! {"IXJCTL_HZ", IXJCTL_HZ}, ! {"IXJCTL_INIT_TONE", IXJCTL_INIT_TONE}, ! {"IXJCTL_INTERCOM_START", IXJCTL_INTERCOM_START}, ! {"IXJCTL_INTERCOM_STOP", IXJCTL_INTERCOM_STOP}, ! {"IXJCTL_MIXER", IXJCTL_MIXER}, ! {"IXJCTL_PLAY_CID", IXJCTL_PLAY_CID}, ! {"IXJCTL_PORT", IXJCTL_PORT}, ! {"IXJCTL_POTS_PSTN", IXJCTL_POTS_PSTN}, ! {"IXJCTL_PSTN_LINETEST", IXJCTL_PSTN_LINETEST}, ! {"IXJCTL_RATE", IXJCTL_RATE}, ! {"IXJCTL_READ_WAIT", IXJCTL_READ_WAIT}, ! {"IXJCTL_SC_RXG", IXJCTL_SC_RXG}, ! {"IXJCTL_SC_TXG", IXJCTL_SC_TXG}, ! {"IXJCTL_SERIAL", IXJCTL_SERIAL}, ! {"IXJCTL_SET_FILTER", IXJCTL_SET_FILTER}, ! {"IXJCTL_SET_FILTER_RAW", IXJCTL_SET_FILTER_RAW}, ! {"IXJCTL_SET_INC_RINGING", IXJCTL_SET_INC_RINGING}, ! {"IXJCTL_SET_LED", IXJCTL_SET_LED}, ! {"IXJCTL_SIGCTL", IXJCTL_SIGCTL}, ! {"IXJCTL_TESTRAM", IXJCTL_TESTRAM}, ! {"IXJCTL_TONE_CADENCE", IXJCTL_TONE_CADENCE}, ! {"IXJCTL_VERSION", IXJCTL_VERSION}, ! {"IXJCTL_VMWI", IXJCTL_VMWI}, ! {"IXJCTL_WRITE_WAIT", IXJCTL_WRITE_WAIT}, ! {"OLD_PHONE_RING_START", OLD_PHONE_RING_START}, ! {"PHONE_BUSY", PHONE_BUSY}, ! {"PHONE_CAPABILITIES", PHONE_CAPABILITIES}, ! {"PHONE_CAPABILITIES_CHECK",PHONE_CAPABILITIES_CHECK}, ! {"PHONE_CAPABILITIES_LIST", PHONE_CAPABILITIES_LIST}, ! {"PHONE_CPT_STOP", PHONE_CPT_STOP}, ! {"PHONE_DIALTONE", PHONE_DIALTONE}, ! {"PHONE_DTMF_OOB", PHONE_DTMF_OOB}, ! {"PHONE_DTMF_READY", PHONE_DTMF_READY}, ! {"PHONE_EXCEPTION", PHONE_EXCEPTION}, ! {"PHONE_FRAME", PHONE_FRAME}, ! {"PHONE_GET_DTMF", PHONE_GET_DTMF}, ! {"PHONE_GET_DTMF_ASCII", PHONE_GET_DTMF_ASCII}, ! {"PHONE_GET_TONE_OFF_TIME", PHONE_GET_TONE_OFF_TIME}, ! {"PHONE_GET_TONE_ON_TIME", PHONE_GET_TONE_ON_TIME}, ! {"PHONE_GET_TONE_STATE", PHONE_GET_TONE_STATE}, ! {"PHONE_HOOKSTATE", PHONE_HOOKSTATE}, ! {"PHONE_MAXRINGS", PHONE_MAXRINGS}, ! {"PHONE_PLAY_CODEC", PHONE_PLAY_CODEC}, ! {"PHONE_PLAY_DEPTH", PHONE_PLAY_DEPTH}, ! {"PHONE_PLAY_LEVEL", PHONE_PLAY_LEVEL}, ! {"PHONE_PLAY_START", PHONE_PLAY_START}, ! {"PHONE_PLAY_STOP", PHONE_PLAY_STOP}, ! {"PHONE_PLAY_TONE", PHONE_PLAY_TONE}, ! {"PHONE_PLAY_VOLUME", PHONE_PLAY_VOLUME}, ! {"PHONE_PLAY_VOLUME_LINEAR",PHONE_PLAY_VOLUME_LINEAR}, ! {"PHONE_PSTN_GET_STATE", PHONE_PSTN_GET_STATE}, ! {"PHONE_PSTN_LINETEST", PHONE_PSTN_LINETEST}, ! {"PHONE_PSTN_SET_STATE", PHONE_PSTN_SET_STATE}, ! {"PHONE_QUERY_CODEC", PHONE_QUERY_CODEC}, ! {"PHONE_REC_CODEC", PHONE_REC_CODEC}, ! {"PHONE_REC_DEPTH", PHONE_REC_DEPTH}, ! {"PHONE_REC_LEVEL", PHONE_REC_LEVEL}, ! {"PHONE_REC_START", PHONE_REC_START}, ! {"PHONE_REC_STOP", PHONE_REC_STOP}, ! {"PHONE_REC_VOLUME", PHONE_REC_VOLUME}, ! {"PHONE_REC_VOLUME_LINEAR", PHONE_REC_VOLUME_LINEAR}, ! {"PHONE_RING", PHONE_RING}, ! {"PHONE_RINGBACK", PHONE_RINGBACK}, ! {"PHONE_RING_CADENCE", PHONE_RING_CADENCE}, ! {"PHONE_RING_START", PHONE_RING_START}, ! {"PHONE_RING_STOP", PHONE_RING_STOP}, ! {"PHONE_SET_TONE_OFF_TIME", PHONE_SET_TONE_OFF_TIME}, ! {"PHONE_SET_TONE_ON_TIME", PHONE_SET_TONE_ON_TIME}, ! {"PHONE_VAD", PHONE_VAD}, ! {"PHONE_WINK", PHONE_WINK}, ! {"PHONE_WINK_DURATION", PHONE_WINK_DURATION}, ! {"", 0} }; *************** *** 2223,2249 **** }; ! ! /*================================================================*/ ! /* These volume coeficients are the output of an exponential function. ! You can plot this exponential function with gnuplot. ! gnuplot ! plot [t=0:100] exp((t/20) -1) / exp(4) */ ! ! #ifndef IXJ_LOG_VOLUME_MAX ! #define IXJ_LOG_VOLUME_MAX 10000 ! #endif ! ! int ixj_vol_coefs[] = { ! 0, 71, 74, 78, 82, 87, 91, 96, 101, 106, 111, ! 117, 123, 129, 136, 143, 150, 158, 166, 174, 183, 193, ! 202, 213, 224, 235, 247, 260, 273, 287, 302, 317, 334, ! 351, 369, 388, 408, 429, 450, 474, 498, 523, 550, 578, ! 608, 639, 672, 707, 743, 781, 821, 863, 907, 954, 1003, ! 1054, 1108, 1165, 1225, 1287, 1353, 1423, 1496, 1572, 1653, 1738, ! 1827, 1920, 2019, 2122, 2231, 2346, 2466, 2592, 2725, 2865, 3012, ! 3166, 3329, 3499, 3679, 3867, 4066, 4274, 4493, 4724, 4966, 5220, ! 5488, 5769, 6065, 6376, 6703, 7047, 7408, 7788, 8187, 8607, 9048, ! 9512, IXJ_LOG_VOLUME_MAX ! }; /* Comment below is magic for those who use emacs to edit this file. */ --- 2221,2246 ---- }; ! /*================================================================*/ ! /* These volume coeficients are the output of an exponential function. ! You can plot this exponential function with gnuplot. ! gnuplot ! plot [t=0:100] exp((t/20) -1) / exp(4) */ ! ! #ifndef IXJ_LOG_VOLUME_MAX ! #define IXJ_LOG_VOLUME_MAX 10000 ! #endif ! ! int ixj_vol_coefs[] = { ! 0, 71, 74, 78, 82, 87, 91, 96, 101, 106, 111, ! 117, 123, 129, 136, 143, 150, 158, 166, 174, 183, 193, ! 202, 213, 224, 235, 247, 260, 273, 287, 302, 317, 334, ! 351, 369, 388, 408, 429, 450, 474, 498, 523, 550, 578, ! 608, 639, 672, 707, 743, 781, 821, 863, 907, 954, 1003, ! 1054, 1108, 1165, 1225, 1287, 1353, 1423, 1496, 1572, 1653, 1738, ! 1827, 1920, 2019, 2122, 2231, 2346, 2466, 2592, 2725, 2865, 3012, ! 3166, 3329, 3499, 3679, 3867, 4066, 4274, 4493, 4724, 4966, 5220, ! 5488, 5769, 6065, 6376, 6703, 7047, 7408, 7788, 8187, 8607, 9048, ! 9512, IXJ_LOG_VOLUME_MAX ! }; /* Comment below is magic for those who use emacs to edit this file. */ Index: ixj.h =================================================================== RCS file: /cvsroot/openh323/nixj/telephony/ixj.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ixj.h 28 Sep 2004 23:06:12 -0000 1.27 --- ixj.h 27 Jun 2005 08:14:53 -0000 1.28 *************** *** 71,75 **** #ifdef __linux__ #include <linux/version.h> /* LINUX_VERSION_CODE & KERNEL_VERSION */ ! #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) || defined(IXJ_STANDALONE) #include "ixjuser.h" #include "phonedev.h" --- 71,75 ---- #ifdef __linux__ #include <linux/version.h> /* LINUX_VERSION_CODE & KERNEL_VERSION */ ! #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) || defined(IXJ_STANDALONE) || (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)) #include "ixjuser.h" #include "phonedev.h" *************** *** 398,405 **** IXJ_CADENCE_TERM termination; IXJ_CADENCE_ELEMENT *ce; ! unsigned int state; unsigned char playing; } TONE_CADENCE; ! typedef struct { --- 398,411 ---- IXJ_CADENCE_TERM termination; IXJ_CADENCE_ELEMENT *ce; ! unsigned int state; unsigned char playing; } TONE_CADENCE; ! ! #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)) ! typedef unsigned long KERN_JIFFIES; ! #else ! typedef int KERN_JIFFIES; ! #endif ! typedef struct { *************** *** 902,905 **** --- 908,919 ---- #define RECORD_MODE_8LINEAR_WSS 7 /* Selects: 64 Kbit/sec WSS 8-bit unsigned linear */ + + typedef struct { + unsigned int min; + unsigned int max; + } Cadence_Time; + + #define N_CADENCES 16 + typedef struct { char enable; *************** *** 907,913 **** unsigned int n_elems; Cadence_Time times[N_CADENCES]; ! unsigned int measured[N_CADENCES]; /*Duration of the read pulse*/ unsigned int event_index; /*Index read pulse is written to*/ ! long int event_last; /*Time at which last pulse happened.*/ unsigned char event_is_pulse; /*measured[0] is a pulse.*/ } IXJ_FILTER_CADENCE_EXT; --- 921,927 ---- unsigned int n_elems; Cadence_Time times[N_CADENCES]; ! KERN_JIFFIES measured[N_CADENCES]; /*Duration of the read pulse*/ unsigned int event_index; /*Index read pulse is written to*/ ! KERN_JIFFIES event_last; /*Time at which last pulse happened.*/ unsigned char event_is_pulse; /*measured[0] is a pulse.*/ } IXJ_FILTER_CADENCE_EXT; *************** *** 991,1006 **** * Locking of the different processes that attempt to read (or write) to/from * the IXJ * structure. * ****************************************/ ! #define BOARD 0 /* Global Access to IXJ * structure. */ ! #define INREAD 1 /* A user space read process is happening */ #define INWRITE 2 /* A user space write process is happening */ ! #define USER_WRITTEN 3 /* User has left data, for sending to device */ ! #define HAS_R_FRAME 4 /* Have read from device, Now, the user to read */ ! #define DTMF_ACTIVE 5 /* There is incoming dtmf data */ ! #define HOOK_STOP_RW 6 /* Hook state will stop a read/write process */ #define BOARD_OPEN 7 /* Flag to indicate module is open */ ! #define HOOK_STATUS 8 /* 1 Indicates the handset is off hook */ ! #define DTMF_READY 9 /* Indicates if dtmf is available for the user */ /****************************************************************************** * --- 1005,1020 ---- * Locking of the different processes that attempt to read (or write) to/from * the IXJ * structure. + * There are sizeof(unsigned int) bits available, which is 32. * ****************************************/ ! #define BOARD 0 /* Global Access to IXJ * structure. */ ! #define INREAD 1 /* A user space read process is happening */ #define INWRITE 2 /* A user space write process is happening */ ! #define USER_WRITTEN 3 /* User has left data for kernel to send to device*/ ! #define HAS_R_FRAME 4 /* Kernel has read data from device, ready for user to read */ ! #define DTMF_ACTIVE 5 /* There is incoming dtmf data */ ! #define HOOK_STOP_RW 6 /* Flag to indicate hook state will stop a read/write process */ #define BOARD_OPEN 7 /* Flag to indicate module is open */ ! #define PCMCIA_OK 8 /* Flag to indicate pcmcia is inserted properly */ /****************************************************************************** * *************** *** 1052,1062 **** BOOL off_hook; BYTE version; ! ! int slic_state; int power_alarm_count; - - unsigned long power_alarm_time; - unsigned long power_alarm_last_time; - BOOL reg_timeout; --- 1066,1073 ---- BOOL off_hook; BYTE version; ! int slic_state; ! KERN_JIFFIES power_alarm_time; ! KERN_JIFFIES power_alarm_last_time; int power_alarm_count; BOOL reg_timeout; *************** *** 1121,1125 **** --- 1132,1140 ---- struct wait_queue *write_q; #else + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) struct pci_dev *dev; + #else + struct pnp_dev *dev; /*2.6 kernel defs */ + #endif wait_queue_head_t poll_q; *************** *** 1147,1151 **** unsigned int rec_frame_size; unsigned int play_frame_size; ! unsigned long cidcw_wait; int aec_level; int readers, writers; --- 1162,1166 ---- unsigned int rec_frame_size; unsigned int play_frame_size; ! KERN_JIFFIES cidcw_wait; int aec_level; int readers, writers; *************** *** 1160,1171 **** int winkbuffer[WINK_BUF_SIZE]; ! unsigned long wink_index; ! ! char dtmf_current; ! char dtmfbuffer[DTMF_BUF_SIZE]; ! int dtmf_index_w, dtmf_index_r; ! unsigned long dtmf_tj_end_time; ! #ifdef __linux__ --- 1175,1184 ---- int winkbuffer[WINK_BUF_SIZE]; ! KERN_JIFFIES wink_index; + char dtmfbuffer[DTMF_BUF_SIZE]; + int dtmf_index_w, dtmf_index_r; + char dtmf_current; + KERN_JIFFIES dtmf_tj_start_time; #ifdef __linux__ *************** *** 1218,1225 **** int mix[32]; ! unsigned long debounce_time; int last_hook; /* The previous value of the hook, as read from hardware..*/ int last_hookstate;/* the previous value of hookstate. */ ! int hook_transition; /*The time at which last_hook changed. Debounce time + last_hook is the time when hookstate will change*/ char pstn_envelope; --- 1231,1239 ---- int mix[32]; ! KERN_JIFFIES debounce_time; int last_hook; /* The previous value of the hook, as read from hardware..*/ int last_hookstate;/* the previous value of hookstate. */ ! KERN_JIFFIES hook_transition; /*The time at which last_hook changed. */ ! /*Debounce time + last_hook is the time when hookstate will change*/ char pstn_envelope; *************** *** 1230,1241 **** unsigned int cidsize; unsigned int cidcnt; ! unsigned pstn_cid_received; PHONE_CID cid; PHONE_CID cid_send; ! unsigned long pstn_winkstart; ! unsigned long pots_winkstart; unsigned int winktime; ! unsigned long flash_end; char port; char hookstate; --- 1244,1255 ---- unsigned int cidsize; unsigned int cidcnt; ! KERN_JIFFIES pstn_cid_received; PHONE_CID cid; PHONE_CID cid_send; ! KERN_JIFFIES pstn_winkstart; ! KERN_JIFFIES pots_winkstart; unsigned int winktime; ! KERN_JIFFIES flash_end; char port; char hookstate; *************** *** 1254,1258 **** unsigned long framesread; unsigned long frameswritten; ! unsigned long pstnstatecheck; short fskdata[8000]; int fsksize; --- 1268,1272 ---- unsigned long framesread; unsigned long frameswritten; ! KERN_JIFFIES pstnstatecheck; short fskdata[8000]; int fsksize; *************** *** 1264,1267 **** --- 1278,1282 ---- int sleep_error; + char jiffie_string[20]; TJ_DATA *tj; } IXJ; Index: ixjuser.h =================================================================== RCS file: /cvsroot/openh323/nixj/telephony/ixjuser.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ixjuser.h 28 Sep 2004 23:06:12 -0000 1.17 --- ixjuser.h 27 Jun 2005 08:14:53 -0000 1.18 *************** *** 141,147 **** } IXJ_FILTER; ! /* In the IXJ_FILTER_CADENCE and IXJ_FILTER_CADENCE_RAW structures, */ ! /* times are in centi seconds (10 centi seconds is 100 milli seconds). */ ! typedef struct { char enable; /* Determines if this filter is used */ --- 141,147 ---- } IXJ_FILTER; ! ! /* In the IXJ_FILTER_CADENCE structure, times are in centi seconds. */ ! /* (10 centi seconds is 100 milli seconds). */ typedef struct { char enable; /* Determines if this filter is used */ *************** *** 156,172 **** } IXJ_FILTER_CADENCE; - typedef struct { - unsigned int min; - unsigned int max; - } Cadence_Time; - - #define N_CADENCES 16 - - typedef struct { - char enable; /* Determines if this filter is used */ - unsigned int filter; /* number of the filter being specified */ - Cadence_Time times[N_CADENCES]; - } IXJ_FILTER_CADENCE_RAW; - typedef struct { char enabled; /*If enabled use this method to detect incoming. Else, cadence*/ --- 156,159 ---- *************** *** 181,185 **** #define IXJCTL_SET_FILTER_RAW _IOW ('q', 0xDD, IXJ_FILTER_RAW *) #define IXJCTL_FILTER_CADENCE _IOW ('q', 0xD6, IXJ_FILTER_CADENCE *) - #define IXJCTL_FILTER_CADENCE_RAW _IOW ('q', 0xD7, IXJ_FILTER_CADENCE_RAW *) #define IXJCTL_PLAY_CID _IO ('q', 0xD8) #define IXJCTL_SET_INC_RINGING _IOW ('q', 0xDE, IXJ_INC_RINGING *) --- 168,171 ---- *************** *** 188,192 **** #define IXJCTL_SET_FILTER_RAW _IOW ('q', 0xDD, IXJ_FILTER_RAW) #define IXJCTL_FILTER_CADENCE _IOW ('q', 0xD6, IXJ_FILTER_CADENCE) - #define IXJCTL_FILTER_CADENCE_RAW _IOW ('q', 0xD7, IXJ_FILTER_CADENCE_RAW) #define IXJCTL_PLAY_CID _IO ('q', 0xD8) #define IXJCTL_SET_INC_RINGING _IOW ('q', 0xDE, IXJ_INC_RINGING) --- 174,177 ---- *************** *** 903,914 **** #define IXJCTL_INTERCOM_STOP _IOW ('q', 0xFE, int) - /************************************************* - * Check on if dtmf is ready, or if there has been a hook state change. - * Using these ioctls does not stop the bottom half timer used to read frames - * etc. thus, you can call these, without interrupting the sound - *******************************************************************/ - #define IXJCTL_IS_OFF_HOOK _IO ('q', 0xF0) - - /****************************************************************************** * --- 888,891 ---- Index: phonedev.c =================================================================== RCS file: /cvsroot/openh323/nixj/telephony/phonedev.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** phonedev.c 10 Mar 2003 02:56:58 -0000 1.4 --- phonedev.c 27 Jun 2005 08:14:53 -0000 1.5 *************** *** 72,75 **** --- 72,78 ---- /* * $Log$ + * Revision 1.5 2005/06/27 08:14:53 dereksmithies + * First release of 2.6 compatible code. Thanks to Dennis Gilmore + * * Revision 1.4 2003/03/10 02:56:58 dereks * AEC updates *************** *** 192,196 **** --- 195,201 ---- phone_device[i] = p; p->minor = i; + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) MOD_INC_USE_COUNT; + #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) up(&phone_lock); *************** *** 220,224 **** --- 225,231 ---- up(&phone_lock); #endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) MOD_DEC_USE_COUNT; + #endif } Index: ixj-ver.h =================================================================== RCS file: /cvsroot/openh323/nixj/telephony/ixj-ver.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ixj-ver.h 23 Oct 2003 00:35:55 -0000 1.7 --- ixj-ver.h 27 Jun 2005 08:14:52 -0000 1.8 *************** *** 1,4 **** /* configuration management identifiers */ #define IXJ_VER_MAJOR 3 ! #define IXJ_VER_MINOR 1 #define IXJ_BLD_VER 0 --- 1,4 ---- /* configuration management identifiers */ #define IXJ_VER_MAJOR 3 ! #define IXJ_VER_MINOR 3 #define IXJ_BLD_VER 0 |