diff options
author | hm <hm@FreeBSD.org> | 1999-05-20 10:14:57 +0000 |
---|---|---|
committer | hm <hm@FreeBSD.org> | 1999-05-20 10:14:57 +0000 |
commit | 2077acfca034178f39e3fa4e86cb8d371f44737c (patch) | |
tree | 730187a2063473cb0d2e7cac998a9a4307285426 /usr.sbin/i4b/isdnd/controller.c | |
parent | 5ea75aea8a2633cc0acf9dd870c1e1db1abd6a21 (diff) | |
download | FreeBSD-src-2077acfca034178f39e3fa4e86cb8d371f44737c.zip FreeBSD-src-2077acfca034178f39e3fa4e86cb8d371f44737c.tar.gz |
upgrade isdn4bsd from version 0.71 to the just released version 0.81
Diffstat (limited to 'usr.sbin/i4b/isdnd/controller.c')
-rw-r--r-- | usr.sbin/i4b/isdnd/controller.c | 51 |
1 files changed, 46 insertions, 5 deletions
diff --git a/usr.sbin/i4b/isdnd/controller.c b/usr.sbin/i4b/isdnd/controller.c index d34c067..ef9889a 100644 --- a/usr.sbin/i4b/isdnd/controller.c +++ b/usr.sbin/i4b/isdnd/controller.c @@ -27,9 +27,9 @@ * i4b daemon - controller state support routines * ---------------------------------------------- * - * $Id: controller.c,v 1.12 1999/02/15 16:48:04 hm Exp $ + * $Id: controller.c,v 1.16 1999/05/10 19:36:16 hm Exp $ * - * last edit-date: [Mon Feb 15 16:37:55 1999] + * last edit-date: [Mon May 10 21:35:55 1999] * *---------------------------------------------------------------------------*/ @@ -87,10 +87,23 @@ init_controller_state(int controller, int ctrl_type, int card_type, int tei) name_of_controller(isdn_ctrl_tab[controller].ctrl_type, isdn_ctrl_tab[controller].card_type)); } + else if(ctrl_type == CTRL_TINADD) + { + isdn_ctrl_tab[controller].ctrl_type = ctrl_type; + isdn_ctrl_tab[controller].card_type = 0; + isdn_ctrl_tab[controller].state = CTRL_DOWN; + isdn_ctrl_tab[controller].stateb1 = CHAN_IDLE; + isdn_ctrl_tab[controller].stateb2 = CHAN_IDLE; + isdn_ctrl_tab[controller].freechans = MAX_CHANCTRL; + isdn_ctrl_tab[controller].tei = -1; + log(LL_DMN, "init_controller_state: controller %d is %s", + controller, + name_of_controller(isdn_ctrl_tab[controller].ctrl_type, + isdn_ctrl_tab[controller].card_type)); + + } else { - /* XXX active controller init here !!! */ - log(LL_ERR, "init_controller_state: unknown controller type %d", ctrl_type); return(ERROR); } @@ -98,6 +111,34 @@ init_controller_state(int controller, int ctrl_type, int card_type, int tei) } /*--------------------------------------------------------------------------* + * init active controller + *--------------------------------------------------------------------------*/ +void +init_active_controller(void) +{ + int ret; + int unit = 0; + int controller; + char cmdbuf[MAXPATHLEN+128]; + + for(controller = 0; controller < ncontroller; controller++) + { + if(isdn_ctrl_tab[controller].ctrl_type == CTRL_TINADD) + { + DBGL(DL_RCCF, (log(LL_DBG, "init_active_controller, tina-dd %d: executing [%s %d]", unit, tinainitprog, unit))); + + sprintf(cmdbuf, "%s %d", tinainitprog, unit); + + if((ret = system(cmdbuf)) != 0) + { + log(LL_ERR, "init_active_controller, tina-dd %d: %s returned %d!", unit, tinainitprog, ret); + do_exit(1); + } + } + } +} + +/*--------------------------------------------------------------------------* * set controller state to UP/DOWN *--------------------------------------------------------------------------*/ int @@ -289,7 +330,7 @@ set_channel_idle(int controller, int channel) break; default: - log(LL_ERR, "set_channel_idle: controller [%d], invalid channel [%d]!", controller, channel); + DBGL(DL_CNST, (log(LL_DBG, "set_channel_idle: controller [%d], invalid channel [%d]!", controller, channel))); return(ERROR); break; } |