Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22345323b6 | ||
|
|
f0ba335d09 | ||
|
|
40942e2a43 | ||
|
|
78c92b52ed | ||
|
|
1bf7ebc42f | ||
|
|
7a275dc70b | ||
|
|
9fb13e2f6c | ||
|
|
fcbde772c4 | ||
|
|
2bc2ebd1de | ||
|
|
0f8559b045 | ||
|
|
d6075a4c78 |
@@ -4797,6 +4797,10 @@ static int dahdi_ioctl_startup(struct file *file, unsigned long data)
|
||||
*/
|
||||
s->chans[x]->rxhooksig = DAHDI_RXSIG_INITIAL;
|
||||
}
|
||||
|
||||
/* Now that this span is running, it might be selected as the
|
||||
* master span */
|
||||
__dahdi_find_master_span();
|
||||
}
|
||||
put_span(s);
|
||||
return 0;
|
||||
@@ -9227,12 +9231,12 @@ static void coretimer_init(void)
|
||||
init_timer(&core_timer.timer);
|
||||
core_timer.timer.function = coretimer_func;
|
||||
core_timer.start_interval = current_kernel_time();
|
||||
core_timer.timer.expires = jiffies + HZ;
|
||||
atomic_set(&core_timer.count, 0);
|
||||
atomic_set(&core_timer.shutdown, 0);
|
||||
core_timer.interval = max(msecs_to_jiffies(DAHDI_MSECS_PER_CHUNK), 1UL);
|
||||
if (core_timer.interval < (HZ/250))
|
||||
core_timer.interval = (HZ/250);
|
||||
core_timer.timer.expires = jiffies + core_timer.interval;
|
||||
add_timer(&core_timer.timer);
|
||||
}
|
||||
|
||||
|
||||
@@ -2205,7 +2205,7 @@ static const char *b4xxp_echocan_name(const struct dahdi_chan *chan)
|
||||
{
|
||||
struct b4xxp_span *bspan = container_of(chan->span, struct b4xxp_span,
|
||||
span);
|
||||
if (bspan->parent->card_type == B410P)
|
||||
if (vpmsupport && (B410P == bspan->parent->card_type))
|
||||
return "LASVEGAS2";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -766,11 +766,9 @@ static inline unsigned int __t4_raw_oct_in(struct t4 *wc, const unsigned int add
|
||||
__t4_pci_out(wc, WC_LADDR, (WC_LWRITE | WC_LALE));
|
||||
if (!pedanticpci)
|
||||
__t4_pci_in(wc, WC_VERSION);
|
||||
#ifdef PEDANTIC_OCTASIC_CHECKING
|
||||
__t4_pci_out(wc, WC_LADDR, (WC_LALE));
|
||||
if (!pedanticpci)
|
||||
__t4_pci_in(wc, WC_VERSION);
|
||||
#endif
|
||||
if (!octopt) {
|
||||
__t4_gpio_setdir(wc, 0xff, 0x00);
|
||||
__t4_gpio_set(wc, 0xff, 0x00);
|
||||
|
||||
@@ -73,20 +73,6 @@
|
||||
dev_info(&(wc)->pdev->dev, _fmt, ## _args); \
|
||||
} \
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
|
||||
#ifndef WARN_ON_ONCE
|
||||
#define WARN_ON_ONCE(__condition) do { \
|
||||
static int __once = 1; \
|
||||
if (unlikely(__condition)) { \
|
||||
if (__once) { \
|
||||
__once = 0; \
|
||||
WARN_ON(0); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14)
|
||||
/* also added in RHEL kernels with the OpenInfiniband backport: */
|
||||
#if LINUX_VERSION_CODE != KERNEL_VERSION(2, 6, 9) || !defined(DEFINE_SPINLOCK)
|
||||
@@ -2158,12 +2144,13 @@ wctc4xxp_write(struct file *file, const char __user *frame,
|
||||
}
|
||||
|
||||
if (DAHDI_FORMAT_G723_1 == dtc->srcfmt) {
|
||||
if ((G723_5K_BYTES != count) && (G723_6K_BYTES != count)) {
|
||||
if ((G723_5K_BYTES != count) && (G723_6K_BYTES != count) &&
|
||||
(G723_SID_BYTES != count)) {
|
||||
DTE_DEBUG(DTE_DEBUG_GENERAL,
|
||||
"Trying to transcode packet into G723 format " \
|
||||
"that is %Zu bytes instead of the expected " \
|
||||
"%d/%d bytes.\n", count, G723_5K_BYTES,
|
||||
G723_6K_BYTES);
|
||||
"%d/%d/%d bytes.\n", count, G723_5K_BYTES,
|
||||
G723_6K_BYTES, G723_SID_BYTES);
|
||||
return -EINVAL;
|
||||
}
|
||||
cpvt->timestamp += G723_SAMPLES;
|
||||
|
||||
@@ -4242,7 +4242,6 @@ wctdm_init_span(struct wctdm *wc, int spanno, int chanoffset, int chancount,
|
||||
(wc->desc->flags & FLAG_EXPRESS) ? " Express" : "",
|
||||
pdev->bus->number, PCI_SLOT(pdev->devfn) + 1);
|
||||
s->span.manufacturer = "Digium";
|
||||
strncpy(s->span.devicetype, wc->desc->name, sizeof(s->span.devicetype) - 1);
|
||||
|
||||
if (wc->companding == DAHDI_LAW_DEFAULT) {
|
||||
if (wc->digi_mods || digital_span)
|
||||
@@ -4348,13 +4347,6 @@ static void wctdm_fixup_analog_span(struct wctdm *wc, int spanno)
|
||||
s->chans[y++]->sigcap = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (x = 0; x < MAX_SPANS; x++) {
|
||||
if (!wc->spans[x])
|
||||
continue;
|
||||
if (wc->vpmadt032)
|
||||
strncat(wc->spans[x]->span.devicetype, " (VPMADT032)", sizeof(wc->spans[x]->span.devicetype) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
static int wctdm_initialize_vpmadt032(struct wctdm *wc)
|
||||
@@ -5268,6 +5260,27 @@ static void wctdm_allocate_irq_commands(struct wctdm *wc, unsigned int count)
|
||||
spin_unlock_irqrestore(&wc->reglock, flags);
|
||||
}
|
||||
|
||||
static void set_span_devicetype_string(struct wctdm *wc)
|
||||
{
|
||||
unsigned int x;
|
||||
|
||||
for (x = 0; x < ARRAY_SIZE(wc->spans); x++) {
|
||||
struct dahdi_span *const s = &wc->spans[x]->span;
|
||||
if (!s)
|
||||
continue;
|
||||
|
||||
strlcpy(s->devicetype, wc->desc->name, sizeof(s->devicetype));
|
||||
|
||||
if (wc->vpmadt032) {
|
||||
strlcat(s->devicetype, " (VPMADT032)",
|
||||
sizeof(s->devicetype));
|
||||
} else if (wc->vpmoct) {
|
||||
strlcat(s->devicetype, " (VPMOCT032)",
|
||||
sizeof(s->devicetype));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_ASYNC_INIT
|
||||
struct async_data {
|
||||
struct pci_dev *pdev;
|
||||
@@ -5523,6 +5536,8 @@ __wctdm_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
|
||||
wctdm_initialize_vpm(wc);
|
||||
|
||||
set_span_devicetype_string(wc);
|
||||
|
||||
#ifdef USE_ASYNC_INIT
|
||||
async_synchronize_cookie(cookie);
|
||||
#endif
|
||||
|
||||
@@ -1022,9 +1022,13 @@ static void set_span_devicetype(struct t1 *wc)
|
||||
sizeof(wc->span.devicetype) - 1);
|
||||
|
||||
#if defined(VPM_SUPPORT)
|
||||
if (wc->vpmadt032)
|
||||
if (wc->vpmadt032) {
|
||||
strncat(wc->span.devicetype, " (VPMADT032)",
|
||||
sizeof(wc->span.devicetype) - 1);
|
||||
} else if (wc->vpmoct) {
|
||||
strncat(wc->span.devicetype, " (VPMOCT032)",
|
||||
sizeof(wc->span.devicetype) - 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1660,6 +1664,8 @@ static void check_and_load_vpm(struct t1 *wc)
|
||||
|
||||
vpmoct_init(vpmoct, t1_vpm_load_complete);
|
||||
}
|
||||
|
||||
set_span_devicetype(wc);
|
||||
}
|
||||
#else
|
||||
static inline void check_and_load_vpm(const struct t1 *wc)
|
||||
|
||||
@@ -386,6 +386,8 @@ static xpd_t *FXS_card_new(xbus_t *xbus, int unit, int subunit, const xproto_tab
|
||||
int regular_channels;
|
||||
struct FXS_priv_data *priv;
|
||||
int i;
|
||||
int d_inputs = 0;
|
||||
int d_outputs = 0;
|
||||
|
||||
if(!to_phone) {
|
||||
XBUS_NOTICE(xbus,
|
||||
@@ -398,16 +400,30 @@ static xpd_t *FXS_card_new(xbus_t *xbus, int unit, int subunit, const xproto_tab
|
||||
else
|
||||
regular_channels = min(8, subunit_ports);
|
||||
channels = regular_channels;
|
||||
if(unit == 0 && subtype != 4)
|
||||
/* Calculate digital inputs/outputs */
|
||||
if(unit == 0 && subtype != 4) {
|
||||
channels += 6; /* 2 DIGITAL OUTPUTS, 4 DIGITAL INPUTS */
|
||||
d_inputs = LINES_DIGI_INP;
|
||||
d_outputs = LINES_DIGI_OUT;
|
||||
}
|
||||
xpd = xpd_alloc(xbus, unit, subunit, subtype, subunits, sizeof(struct FXS_priv_data), proto_table, channels);
|
||||
if(!xpd)
|
||||
return NULL;
|
||||
if(unit == 0) {
|
||||
XBUS_DBG(GENERAL, xbus, "First XPD detected. Initialize digital outputs/inputs\n");
|
||||
PHONEDEV(xpd).digital_outputs = BITMASK(LINES_DIGI_OUT) << regular_channels;
|
||||
PHONEDEV(xpd).digital_inputs = BITMASK(LINES_DIGI_INP) << (regular_channels + LINES_DIGI_OUT);
|
||||
}
|
||||
/* Initialize digital inputs/outputs */
|
||||
if (d_inputs) {
|
||||
XBUS_DBG(GENERAL, xbus, "Initialize %d digital inputs\n",
|
||||
d_inputs);
|
||||
PHONEDEV(xpd).digital_inputs =
|
||||
BITMASK(d_inputs) << (regular_channels + d_outputs);
|
||||
} else
|
||||
XBUS_DBG(GENERAL, xbus, "No digital inputs\n");
|
||||
if (d_outputs) {
|
||||
XBUS_DBG(GENERAL, xbus, "Initialize %d digital outputs\n",
|
||||
d_outputs);
|
||||
PHONEDEV(xpd).digital_outputs =
|
||||
BITMASK(d_outputs) << regular_channels;
|
||||
} else
|
||||
XBUS_DBG(GENERAL, xbus, "No digital outputs\n");
|
||||
PHONEDEV(xpd).direction = TO_PHONE;
|
||||
xpd->type_name = "FXS";
|
||||
if(fxs_proc_create(xbus, xpd) < 0)
|
||||
@@ -1142,7 +1158,7 @@ static int FXS_card_tick(xbus_t *xbus, xpd_t *xpd)
|
||||
priv = xpd->priv;
|
||||
BUG_ON(!priv);
|
||||
#ifdef POLL_DIGITAL_INPUTS
|
||||
if(poll_digital_inputs && xpd->xbus_idx == 0) {
|
||||
if (poll_digital_inputs && PHONEDEV(xpd).digital_inputs) {
|
||||
if((xpd->timer_count % poll_digital_inputs) == 0)
|
||||
poll_inputs(xpd);
|
||||
}
|
||||
@@ -1254,6 +1270,13 @@ static void process_digital_inputs(xpd_t *xpd, const reg_cmd_t *info)
|
||||
bool offhook = (REG_FIELD(info, data_low) & 0x1) == 0;
|
||||
xpp_line_t lines = BIT(info->portnum);
|
||||
|
||||
/* Sanity check */
|
||||
if (!PHONEDEV(xpd).digital_inputs) {
|
||||
XPD_NOTICE(xpd,
|
||||
"%s called without digital inputs. Ignored\n",
|
||||
__func__);
|
||||
return;
|
||||
}
|
||||
/* Map SLIC number into line number */
|
||||
for(i = 0; i < ARRAY_SIZE(input_channels); i++) {
|
||||
int channo = input_channels[i];
|
||||
@@ -1366,7 +1389,7 @@ static int FXS_card_register_reply(xbus_t *xbus, xpd_t *xpd, reg_cmd_t *info)
|
||||
/*
|
||||
* Process digital inputs polling results
|
||||
*/
|
||||
else if(xpd->xbus_idx == 0 && !indirect && regnum == REG_DIGITAL_IOCTRL) {
|
||||
else if (!indirect && regnum == REG_DIGITAL_IOCTRL) {
|
||||
process_digital_inputs(xpd, info);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1364,6 +1364,19 @@ static inline void list_replace(struct list_head *old, struct list_head *new)
|
||||
new->prev = old->prev;
|
||||
new->prev->next = new;
|
||||
}
|
||||
|
||||
#ifndef WARN_ON_ONCE
|
||||
#define WARN_ON_ONCE(__condition) do { \
|
||||
static int __once = 1; \
|
||||
if (unlikely(__condition)) { \
|
||||
if (__once) { \
|
||||
__once = 0; \
|
||||
WARN_ON(0); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14)
|
||||
#define kzalloc(a, b) kcalloc(1, a, b)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12)
|
||||
|
||||
Reference in New Issue
Block a user