~ubuntu-branches/ubuntu/quantal/zaptel/quantal

« back to all changes in this revision

Viewing changes to oct612x/octdeviceapi/oct6100api/oct6100_interrupts_priv.h

  • Committer: Bazaar Package Importer
  • Author(s): Tzafrir Cohen
  • Date: 2008-08-28 22:58:23 UTC
  • mfrom: (11.1.11 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080828225823-r8bdunirm8hmc76m
Tags: 1:1.4.11~dfsg-2
* Patch xpp_fxs_power: Fixed an issue with hook detection of the Astribank
  FXS module.
* Don't fail init.d script if fxotune fails. This may happen if running it
  when Asterisk is already running.
* Bump standards version to 3.8.0.0 .
* Ignore false lintian warning ("m-a a-i" has "a a").
* Patch xpp_fxo_cid_always: do always pass PCM if that's what the user
  asked.
* Patch vzaphfc_proc_root_dir: fix vzaphfc on 2.6.26.
* Patch wcte12xp_flags: Proper time for irq save flags.
* Patch headers_2627: Fix location of semaphore.h for 2.6.27 .
* Patch xpp_fxs_dtmf_leak: Don't play DTMFs to the wrong channel.
* Patch wctdm_fix_alarm: Fix sending channel alarms.
* Patch device_class_2626: Fix building 2.6.26 (Closes: #493397).
* Using dh_lintian for lintian overrides, hence requiring debhelper 6.0.7.
* Lintian: we know we have direct changes. Too bad we're half-upstream :-(
* Fix doc-base section names. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
2
 
 
3
 
File:  oct6100_interrupts_priv.h
4
 
 
5
 
    Copyright (c) 2001-2006 Octasic Inc.
6
 
    
7
 
Description: 
8
 
 
9
 
        File containing all private defines, macros, structures and prototypes 
10
 
        pertaining to the file oct6100_interrupts.c.  All elements defined in this 
11
 
        file are for private usage of the API.  All public elements are defined 
12
 
        in the oct6100_interrupts_pub.h file.
13
 
 
14
 
This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API  is 
15
 
free software; you can redistribute it and/or modify it under the terms of 
16
 
the GNU General Public License as published by the Free Software Foundation; 
17
 
either version 2 of the License, or (at your option) any later version.
18
 
 
19
 
The OCT6100 GPL API is distributed in the hope that it will be useful, but 
20
 
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
21
 
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
22
 
for more details. 
23
 
 
24
 
You should have received a copy of the GNU General Public License 
25
 
along with the OCT6100 GPL API; if not, write to the Free Software 
26
 
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
27
 
 
28
 
$Octasic_Release: OCT612xAPI-01.00-PR43 $
29
 
 
30
 
$Octasic_Revision: 8 $
31
 
 
32
 
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
33
 
 
34
 
#ifndef __OCT6100_INTERRUPTS_PRIV_H__
35
 
#define __OCT6100_INTERRUPTS_PRIV_H__
36
 
 
37
 
/*****************************  INCLUDE FILES  *******************************/
38
 
 
39
 
 
40
 
/*****************************  DEFINES  *************************************/
41
 
 
42
 
#define mOCT6100_GET_INTRPT_ENABLE_TIME(        \
43
 
                                        ulRegMclkTimeHigh,              \
44
 
                                        ulRegMclkTimeLow,               \
45
 
                                        ulIntrptState,                  \
46
 
                                        ulIntrptEnableMclkHigh, \
47
 
                                        ulIntrptEnableMclkLow,  \
48
 
                                        ulIntrptTimeoutMclk,    \
49
 
                                        ulTimeDiff )                    \
50
 
        if ( ulIntrptState == cOCT6100_INTRPT_WILL_TIMEOUT )                                                                    \
51
 
        {                                                                                                                                                                               \
52
 
                ulIntrptEnableMclkLow = ulRegMclkTimeLow + ulIntrptTimeoutMclk;                                         \
53
 
                if ( ulIntrptEnableMclkLow < ulRegMclkTimeLow )                                                                         \
54
 
                        ulIntrptEnableMclkHigh = (ulRegMclkTimeHigh + 1) & 0xFF;                                                \
55
 
                else                                                                                                                                                            \
56
 
                        ulIntrptEnableMclkHigh = ulRegMclkTimeHigh;                                                                             \
57
 
                                                                                                                                                                                        \
58
 
                ulIntrptState = cOCT6100_INTRPT_IN_TIMEOUT;                                                                                     \
59
 
        }                                                                                                                                                                               \
60
 
                                                                                                                                                                                        \
61
 
        if ( ulIntrptEnableMclkLow < ulRegMclkTimeLow )                                                                                 \
62
 
        {                                                                                                                                                                               \
63
 
                ulTimeDiff = (cOCT6100_FFFFFFFF - ulRegMclkTimeLow - 1) + ulIntrptEnableMclkLow;        \
64
 
        }                                                                                                                                                                               \
65
 
        else                                                                                                                                                                    \
66
 
        {                                                                                                                                                                               \
67
 
                ulTimeDiff = ulIntrptEnableMclkLow - ulRegMclkTimeLow;                                                          \
68
 
        }
69
 
 
70
 
#define mOCT6100_CHECK_INTRPT_TIMEOUT(                          \
71
 
                                        ulRegMclkTimePlus5MsHigh,               \
72
 
                                        ulRegMclkTimePlus5MsLow,                \
73
 
                                        ulIntrptDisableMclkHigh,                \
74
 
                                        ulIntrptDisableMclkLow,                 \
75
 
                                        ulIntrptEnableMclkHigh,                 \
76
 
                                        ulIntrptEnableMclkLow,                  \
77
 
                                        ulIntrptState,                                  \
78
 
                                        fIntrptChange )                                 \
79
 
        /* Branch depending on whether the disable time is lesser or greater than the timeout time. */                                                  \
80
 
        if ( ulIntrptDisableMclkLow < ulIntrptEnableMclkLow )                                                                                                                                   \
81
 
        {                                                                                                                                                                                                                                               \
82
 
                /* Disable period is over if mclk is greater than timeout time or less than disabled time. */                                           \
83
 
                if ( ulRegMclkTimePlus5MsLow > ulIntrptEnableMclkLow ||                                                                                                                         \
84
 
                         ulRegMclkTimePlus5MsLow < ulIntrptDisableMclkLow ||                                                                                                                    \
85
 
                         ulRegMclkTimePlus5MsHigh != ulIntrptEnableMclkHigh )                                                                                                                   \
86
 
                {                                                                                                                                                                                                                                       \
87
 
                        fIntrptChange = TRUE;                                                                                                                                                                                   \
88
 
                        ulIntrptState = cOCT6100_INTRPT_ACTIVE;                                                                                                                                                 \
89
 
                }                                                                                                                                                                                                                                       \
90
 
        }                                                                                                                                                                                                                                               \
91
 
        else                                                                                                                                                                                                                                    \
92
 
        {                                                                                                                                                                                                                                               \
93
 
                /* Disable period is over if mclk is lesser than disable time and greater than timeout. */                                                      \
94
 
                if ( (ulRegMclkTimePlus5MsLow > ulIntrptEnableMclkLow && ulRegMclkTimePlus5MsLow < ulIntrptDisableMclkLow) ||           \
95
 
                         (ulRegMclkTimePlus5MsHigh != ulIntrptDisableMclkHigh && ulRegMclkTimePlus5MsHigh != ulIntrptEnableMclkHigh) )  \
96
 
                {                                                                                                                                                                                                                                       \
97
 
                        fIntrptChange = TRUE;                                                                                                                                                                                   \
98
 
                        ulIntrptState = cOCT6100_INTRPT_ACTIVE;                                                                                                                                                 \
99
 
                }                                                                                                                                                                                                                                       \
100
 
        }
101
 
 
102
 
/*****************************  TYPES  ***************************************/
103
 
 
104
 
 
105
 
/************************** FUNCTION PROTOTYPES  *****************************/
106
 
 
107
 
UINT32 Oct6100ApiIsrSwInit(
108
 
                        IN tPOCT6100_INSTANCE_API                               f_pApiInstance );
109
 
                        
110
 
UINT32 Oct6100ApiIsrHwInit(
111
 
                        IN      tPOCT6100_INSTANCE_API                          f_pApiInstance,
112
 
                        IN      tPOCT6100_INTERRUPT_CONFIGURE           f_pIntrptConfig );
113
 
 
114
 
UINT32 Oct6100InterruptConfigureSer(
115
 
                        IN      tPOCT6100_INSTANCE_API                          f_pApiInstance,
116
 
                        IN      tPOCT6100_INTERRUPT_CONFIGURE           f_pIntrptConfig,
117
 
                        IN      BOOL                                                            f_fCheckParams );
118
 
 
119
 
UINT32 Oct6100InterruptServiceRoutineSer(
120
 
                        IN tPOCT6100_INSTANCE_API                               f_pApiInstance,
121
 
                        OUT tPOCT6100_INTERRUPT_FLAGS                   f_pIntFlags );
122
 
 
123
 
UINT32 Oct6100ApiWriteIeRegs(
124
 
                                IN      tPOCT6100_INSTANCE_API                  f_pApiInstance );
125
 
 
126
 
UINT32 Oct6100ApiReadIntrptRegs(
127
 
                                IN      tPOCT6100_INSTANCE_API                  f_pApiInstance,
128
 
                                OUT     tPOCT6100_INTERRUPT_FLAGS               f_pIntFlags,
129
 
                                IN      UINT32                                                  f_ulRegister210h );
130
 
 
131
 
UINT32 Oct6100ApiUpdateIntrptStates(
132
 
                                IN      tPOCT6100_INSTANCE_API                  f_pApiInstance,
133
 
                                OUT     tPOCT6100_INTERRUPT_FLAGS               f_pIntFlags );
134
 
 
135
 
UINT32 Oct6100ApiWriteIntrptRegs(
136
 
                                IN      tPOCT6100_INSTANCE_API                  f_pApiInstance );
137
 
 
138
 
UINT32 Oct6100ApiReadChipMclkTime(
139
 
                                IN      tPOCT6100_INSTANCE_API                  f_pApiInstance );
140
 
 
141
 
UINT32 Oct6100ApiUpdateIntrptTimeouts(
142
 
                                IN      tPOCT6100_INSTANCE_API                  f_pApiInstance );
143
 
 
144
 
UINT32 Oct6100ApiScheduleNextMclkIntrpt(
145
 
                                IN      tPOCT6100_INSTANCE_API                  f_pApiInstance,
146
 
                                IN      UINT32                                                  f_ulIntrptToSet );
147
 
 
148
 
UINT32 Oct6100ApiScheduleNextMclkIntrptSer(
149
 
                                IN      tPOCT6100_INSTANCE_API                  f_pApiInstance );
150
 
 
151
 
UINT32  Oct6100ApiCheckProcessorState(
152
 
                                IN      tPOCT6100_INSTANCE_API                  f_pApiInstance,
153
 
                                IN      tPOCT6100_INTERRUPT_FLAGS               f_pIntFlags );
154
 
 
155
 
#endif /* __OCT6100_INTERRUPTS_PRIV_H__ */