summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp/xpp_dahdi.c
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-04-20 10:26:35 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-04-20 10:26:35 +0000
commit5af88c77e19a108eb1fe9144d157d72e03551309 (patch)
treea5a8674452a1d33e0b8e2be6770322bd4c4f62b1 /drivers/dahdi/xpp/xpp_dahdi.c
parent104115d00a132f3cb751991af70a1d90fdd98fe8 (diff)
xpp: Do use information about number of ports the Astribank provides
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6408 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp/xpp_dahdi.c')
-rw-r--r--drivers/dahdi/xpp/xpp_dahdi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/dahdi/xpp/xpp_dahdi.c b/drivers/dahdi/xpp/xpp_dahdi.c
index e7b024a..e6543dd 100644
--- a/drivers/dahdi/xpp/xpp_dahdi.c
+++ b/drivers/dahdi/xpp/xpp_dahdi.c
@@ -255,6 +255,7 @@ int create_xpd(xbus_t *xbus, const xproto_table_t *proto_table,
byte type,
byte subtype,
int subunits,
+ int subunit_ports,
byte port_dir)
{
xpd_t *xpd = NULL;
@@ -269,7 +270,12 @@ int create_xpd(xbus_t *xbus, const xproto_table_t *proto_table,
unit, subunit);
return 0;
}
- xpd = proto_table->xops.card_new(xbus, unit, subunit, proto_table, subtype, subunits, to_phone);
+ if(subunit_ports <= 0 || subunit_ports > CHANNELS_PERXPD) {
+ XBUS_NOTICE(xbus, "Illegal number of ports %d for XPD %d%d\n",
+ subunit_ports, unit, subunit);
+ return 0;
+ }
+ xpd = proto_table->xops.card_new(xbus, unit, subunit, proto_table, subtype, subunits, subunit_ports, to_phone);
if(!xpd) {
XBUS_NOTICE(xbus, "card_new(%d,%d,%d,%d,%d) failed. Ignored.\n",
unit, subunit, proto_table->type, subtype, to_phone);