summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-05-19 12:17:33 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-05-19 12:17:33 +0000
commit20dc11b1fdd76aa3eb1a62ca7300d82c1a348509 (patch)
treeb2caac929690f0a15adee0a97b19657db3744b17
parentcaf46c248aa54b81e328184855d1733cb114c8f0 (diff)
* Zaptel-1.2.x does not have zt_alarm_channel(). Move up the backward
compatibility kludge so it actually affect code (failed compilation on zaptel-1.2 from Digium without (Closes issue #12654 ). * Cleanup a compile warning in xpp/card_global.c . * Fix regression in PRI init script (case of less than 4 modules). * Update changelog and bump version. git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@4304 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--xpp/.version2
-rw-r--r--xpp/Changelog_xpp18
-rw-r--r--xpp/card_fxo.c10
-rw-r--r--xpp/card_global.c2
-rwxr-xr-xxpp/init_card_4_3014
5 files changed, 28 insertions, 18 deletions
diff --git a/xpp/.version b/xpp/.version
index 27a9d19..e39d44b 100644
--- a/xpp/.version
+++ b/xpp/.version
@@ -1 +1 @@
-trunk-r5723
+trunk-r5744
diff --git a/xpp/Changelog_xpp b/xpp/Changelog_xpp
index 52db601..348bc1c 100644
--- a/xpp/Changelog_xpp
+++ b/xpp/Changelog_xpp
@@ -1,6 +1,5 @@
-Tue, 13 May 2008 Oron Peled <oron@actcom.co.il> - xpp.r5723
- * [A temporary changelog. More to come]
- * New firmware protocol version: 3.0 .
+Tue, 13 May 2008 Oron Peled <oron@actcom.co.il> - xpp.r5744
+ * New firmware protocol version: 30
* New numbers for the device types: (e.g. in card_init* scripts)
- FXS: 1 (was: 3)
- FXO: 2 (was: 4)
@@ -9,15 +8,22 @@ Tue, 13 May 2008 Oron Peled <oron@actcom.co.il> - xpp.r5723
* Init scripts of FXS and FXO modules are now written in Perl as well
(be sure to have File::Basename, e.g: perl-modules in Debian).
* calibrate_slics merged into init_card_1_30 .
- * Module parameter print_dbg replaced with debug . Same meaning.
+ * Each of the init_card_* scripts now runs no more than once per card even
+ if this card represents several XPD's (e.g: quad PRI, BRI). This means
+ maximum of 4 script runs per Astribank.
+ * Zaptel registration now briefly flash all LED's (not just the green ones as
+ before).
+ * Module parameter print_dbg was renamed to debug for consistency with
+ the rest of zaptel.
* init_fxo_modes removed: content moved into init_card_2_30, verified
at build time.
+ * FXO: removed polling for power-denial. New firmware notifies us.
* Code tested with sparse. Most warnings were fixed.
* Set ZT_SIG_DACS for the bchans in the PRI and BRI modules to not get
ignored by ztscan.
- * Handle null config_desc we get from some crazy USB controllers.
+ * fpga_load: Handle null config_desc we get from some crazy USB controllers.
* genzaptelconf: Fix reporting of empty slots in list mode.
- * xpp_blink can now blink a single analog port.
+ * xpp_blink can now blink the led of a single analog port.
* "slics" has been renamed "chipregs".
* Fixed a small typo in fpga_load(8).
* Fixed bashism in xpp_fxloader.
diff --git a/xpp/card_fxo.c b/xpp/card_fxo.c
index 0bb30ff..2e48dca 100644
--- a/xpp/card_fxo.c
+++ b/xpp/card_fxo.c
@@ -41,6 +41,12 @@ static DEF_PARM(uint, poll_metering_interval, 500, 0644, "Poll metering interval
static DEF_PARM(int, ring_debounce, 50, 0644, "Number of ticks to debounce a false RING indication");
static DEF_PARM(int, caller_id_style, 0, 0444, "Caller-Id detection style: 0 - [BELL], 1 - [BT], 2 - [PASS]");
+/* Backward compatibility plug */
+#ifndef ZT_GET_PARAMS_V1
+#define zt_alarm_channel(a,b) zt_qevent_lock(a,( (b)==ZT_ALARM_NONE )? \
+ ZT_EVENT_NOALARM : ZT_EVENT_ALARM)
+#endif
+
enum cid_style {
CID_STYLE_BELL = 0, /* E.g: US (Bellcore) */
CID_STYLE_ETSI_POLREV = 1, /* E.g: UK (British Telecom) */
@@ -826,10 +832,6 @@ HANDLER_DEF(FXO, SIG_CHANGED)
return 0;
}
-#ifndef ZT_GET_PARAMS_V1
-#define zt_alarm_channel(a,b) zt_qevent_lock(a,( (b)==ZT_ALARM_NONE )? \
- ZT_EVENT_NOALARM : ZT_EVENT_ALARM)
-#endif
static void update_battery_voltage(xpd_t *xpd, byte data_low, xportno_t portno)
{
struct FXO_priv_data *priv;
diff --git a/xpp/card_global.c b/xpp/card_global.c
index 091ceaf..7a3d101 100644
--- a/xpp/card_global.c
+++ b/xpp/card_global.c
@@ -96,7 +96,7 @@ static int execute_chip_command(xpd_t *xpd, const int argc, char *argv[])
bool writing;
int op; /* [W]rite, [R]ead */
int addr_mode; /* [D]irect, [I]ndirect, [Mm]ulti */
- bool do_indirect;
+ bool do_indirect = 0;
int regnum;
int subreg;
int data_low;
diff --git a/xpp/init_card_4_30 b/xpp/init_card_4_30
index 872c695..25e6ec7 100755
--- a/xpp/init_card_4_30
+++ b/xpp/init_card_4_30
@@ -227,7 +227,6 @@ sub port_setup($) {
my $LIM1_RL = 0 << 1; # RL (Remote Loopback)
my $lim1 = 0xB0 | $LIM1_RL;
- main::select_subunit($portno);
PRI::gen "$portno WD 26 F6"; # XPM0: Pulse Shape Programming for R1=18Ohms
PRI::gen "$portno WD 27 02"; # XPM1: ...3V Pulse Level at the line (Vp-p=6v)
PRI::gen "$portno WD 28 00"; # XPM2: ~XLT (transmit line is not in the high impedance state)
@@ -356,23 +355,26 @@ sub main() {
my @ports;
my $subunit;
- logit "main(): Initializing chip";
+ logit "main(): Initializing chip ($ENV{UNIT_SUBUNITS} ports)";
PRI::init_quad;
- for($subunit = 0; $subunit < $ENV{UNIT_SUBUNITS}; $subunit++) {
+ # Must initialize all 4 ports, regardless how much there are
+ for($subunit = 0; $subunit < 4; $subunit++) {
my $is_nt = 0;
- main::select_subunit($subunit);
#logit "main(): Initializing subunit $subunit is_nt=$is_nt";
my $p = PRI::Port->new(
'PORT_NUM' => $subunit,
- 'PRI_NT' => $is_nt
+ 'PRI_NT' => $is_nt,
+ 'EXIST' => ($subunit < $ENV{UNIT_SUBUNITS})
);
$p->port_setup;
push(@ports, $p);
}
PRI::finish_quad;
foreach my $p (@ports) {
- $p->write_pri_info;
+ if($p->{EXIST}) {
+ $p->write_pri_info;
+ }
}
}