[DAHDI] integrate DAHDI driver into E1 Input layer

This commit is contained in:
Harald Welte 2011-02-05 13:58:46 +01:00
parent ba0db5b7f3
commit 1dd68c3d0f
4 changed files with 17 additions and 11 deletions

View File

@ -21,8 +21,8 @@ libbsc_a_SOURCES = abis_rsl.c abis_nm.c gsm_data.c gsm_04_08_utils.c \
gsm_subscriber_base.c subchan_demux.c bsc_rll.c transaction.c \
trau_frame.c trau_mux.c paging.c \
e1_config.c e1_input.c e1_input_vty.c \
input/misdn.c input/ipaccess.c handover_logic.c \
talloc_ctx.c system_information.c rest_octets.c \
input/misdn.c input/ipaccess.c input/dahdi.c input/lapd.c \
handover_logic.c talloc_ctx.c system_information.c rest_octets.c \
bts_siemens_bs11.c bts_ipaccess_nanobts.c mncc_upqueue.c \
bts_unknown.c bsc_version.c bsc_api.c bsc_vty.c meas_rep.c gsm_04_80.c

View File

@ -613,6 +613,7 @@ static int e1i_sig_cb(unsigned int subsys, unsigned int signal,
}
void e1inp_misdn_init(void);
void e1inp_dahdi_init(void);
void e1inp_init(void)
{
@ -621,4 +622,5 @@ void e1inp_init(void)
register_signal_handler(SS_GLOBAL, e1i_sig_cb, NULL);
e1inp_misdn_init();
e1inp_dahdi_init();
}

View File

@ -38,8 +38,9 @@
#include "../bscconfig.h"
#define E1_DRIVER_NAMES "(misdn|misdn)"
#define E1_DRIVER_HELP "mISDN supported E1 Card\n"
#define E1_DRIVER_NAMES "(misdn|dahdi)"
#define E1_DRIVER_HELP "mISDN supported E1 Card\n" \
"DAHDI supported E1/T1/J1 Card\n"
DEFUN(cfg_e1line_driver, cfg_e1_line_driver_cmd,
"e1_line <0-255> driver " E1_DRIVER_NAMES,

View File

@ -35,15 +35,15 @@
#include <arpa/inet.h>
#include <dahdi/user.h>
#include <openbsc/select.h>
#include <openbsc/msgb.h>
#include <osmocore/select.h>
#include <osmocore/msgb.h>
#include <openbsc/debug.h>
#include <openbsc/gsm_data.h>
#include <openbsc/abis_nm.h>
#include <openbsc/abis_rsl.h>
#include <openbsc/subchan_demux.h>
#include <openbsc/e1_input.h>
#include <openbsc/talloc.h>
#include <osmocore/talloc.h>
#include "lapd.h"
@ -96,7 +96,7 @@ static int handle_ts1_read(struct bsc_fd *bfd)
break;
case LAPD_DL_DATA_IND:
case LAPD_DL_UNITDATA_IND:
if (prim == DL_DATA_IND)
if (prim == LAPD_DL_DATA_IND)
msg->l2h = msg->data + 2;
else
msg->l2h = msg->data + 1;
@ -232,7 +232,7 @@ static int handle_tsX_write(struct bsc_fd *bfd)
ret = write(bfd->fd, tx_buf, ret);
if (ret < D_BCHAN_TX_GRAN)
fprintf(stderr, "send returns %d instead of %lu\n", ret,
fprintf(stderr, "send returns %d instead of %d\n", ret,
D_BCHAN_TX_GRAN);
return ret;
@ -308,9 +308,12 @@ static int dahdi_fd_cb(struct bsc_fd *bfd, unsigned int what)
return rc;
}
static int dahdi_e1_line_update(struct e1inp_line *line);
struct e1inp_driver dahdi_driver = {
.name = "DAHDI",
.want_write = ts_want_write,
.line_update = &dahdi_e1_line_update,
};
void dahdi_set_bufinfo(int fd, int as_sigchan)
@ -408,7 +411,7 @@ static int mi_e1_setup(struct e1inp_line *line, int release_l2)
return 0;
}
int mi_e1_line_update(struct e1inp_line *line)
static int dahdi_e1_line_update(struct e1inp_line *line)
{
int ret;
@ -436,7 +439,7 @@ int mi_e1_line_update(struct e1inp_line *line)
return 0;
}
static __attribute__((constructor)) void on_dso_load_sms(void)
int e1inp_dahdi_init(void)
{
/* register the driver with the core */
e1inp_driver_register(&dahdi_driver);