82
82
static int milliwatt = 0;
83
83
static int pedanticpci = 0;
84
84
static int teignorered = 0;
85
static int alarmdebounce = 0;
85
static int alarmdebounce = 500;
86
86
static int vpmsupport = 1;
87
87
static int timer_1_ms = 2000;
88
88
static int timer_3_ms = 30000;
91
#define mmiowb() barrier()
90
94
#define MAX_B4_CARDS 64
91
95
static struct b4xxp *cards[MAX_B4_CARDS];
115
119
static struct devtype wcb4xxp = { "Wildcard B410P", 0 };
121
static int echocan_create(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp,
122
struct dahdi_echocanparam *p, struct dahdi_echocan_state **ec);
123
static void echocan_free(struct dahdi_chan *chan, struct dahdi_echocan_state *ec);
125
static const struct dahdi_echocan_features my_ec_features = {
131
static const struct dahdi_echocan_ops my_ec_ops = {
133
.echocan_free = echocan_free,
119
static const char *wcb4xxp_rcsdata = "$RCSfile: base.c,v $ $Revision: 5576 $";
137
static const char *wcb4xxp_rcsdata = "$RCSfile: base.c,v $ $Revision: 6552 $";
120
138
static const char *build_stamp = "" __DATE__ " " __TIME__ "";
1209
1227
if (s->newalarm != s->span.alarms && time_after_eq(b4->ticks, s->alarmtimer)) {
1210
1228
if (!s->te_mode || !teignorered) {
1211
1229
s->span.alarms = s->newalarm;
1230
dahdi_alarm_notify(&s->span);
1213
1232
dev_info(b4->dev, "span %d: alarm %d debounced\n", i + 1, s->newalarm);
1214
1233
if (!s->te_mode)
1886
static int b4xxp_echocan(struct dahdi_chan *chan, int eclen)
1905
static int echocan_create(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp,
1906
struct dahdi_echocanparam *p, struct dahdi_echocan_state **ec)
1888
struct b4xxp *b4 = chan->pvt;
1908
struct b4xxp_span *bspan = chan->span->pvt;
1892
if (chan->chanpos != 3)
1893
unit = chan->chanpos - 1;
1911
if (chan->chanpos == 3) {
1912
printk(KERN_WARNING "Cannot enable echo canceller on D channel of span %d; failing request\n", chan->span->offset);
1916
if (ecp->param_count > 0) {
1917
printk(KERN_WARNING "wcb4xxp echo canceller does not support parameters; failing request\n");
1921
*ec = &bspan->ec[chan->chanpos];
1922
(*ec)->ops = &my_ec_ops;
1923
(*ec)->features = my_ec_features;
1926
printk("Enabling echo cancellation on chan %d span %d\n", chan->chanpos, chan->span->offset);
1897
1928
channel = (chan->span->offset * 8) + ((chan->chanpos - 1) * 4) + 1;
1899
if (eclen) { /* Enable */
1901
printk("Enabling echo cancellation on chan %d span %d\n", chan->chanpos, chan->span->offset);
1902
ec_write(b4, unit, channel, 0x7e);
1903
} else { /* Disable */
1905
printk("Disabling echo cancellation on chan %d span %d\n", chan->chanpos, chan->span->offset);
1906
ec_write(b4, unit, channel, 0x01);
1930
ec_write(bspan->parent, chan->chanpos - 1, channel, 0x7e);
1935
static void echocan_free(struct dahdi_chan *chan, struct dahdi_echocan_state *ec)
1937
struct b4xxp_span *bspan = chan->span->pvt;
1940
memset(ec, 0, sizeof(*ec));
1943
printk("Disabling echo cancellation on chan %d span %d\n", chan->chanpos, chan->span->offset);
1945
channel = (chan->span->offset * 8) + ((chan->chanpos - 1) * 4) + 1;
1947
ec_write(bspan->parent, chan->chanpos - 1, channel, 0x01);
1915
1951
* Filesystem and DAHDI interfaces
2701
2737
module_param(milliwatt, int, S_IRUGO | S_IWUSR);
2702
2738
module_param(pedanticpci, int, S_IRUGO);
2739
module_param(teignorered, int, S_IRUGO | S_IWUSR);
2703
2740
module_param(alarmdebounce, int, S_IRUGO | S_IWUSR);
2704
2741
module_param(vpmsupport, int, S_IRUGO);
2705
2742
module_param(timer_1_ms, int, S_IRUGO | S_IWUSR);