Compare commits
2 Commits
v2.6.1
...
v2.6.1-rc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1844a16eeb | ||
|
|
fb3d623a05 |
181
ChangeLog
181
ChangeLog
@@ -1,184 +1,3 @@
|
||||
2012-04-18 Shaun Ruffell <sruffell@digium.com>
|
||||
|
||||
* Released 2.6.1
|
||||
|
||||
2012-04-11 20:19 +0000 [r10657-10660] Shaun Ruffell <sruffell@digium.com>
|
||||
|
||||
* drivers/dahdi/xpp/xpp_dahdi.c, drivers/dahdi/xpp/xpp_dahdi.h:
|
||||
xpp: Fix compilation when CONFIG_DAHDI_WATCHDOG is defined. Looks
|
||||
like a hold over from when dahdi_span_ops was first implemented
|
||||
in r8985 "dahdi: Move the callbacks in dahdi_span into its own
|
||||
structure" [1]. [1]
|
||||
http://svnview.digium.com/svn/dahdi?view=revision&revision=8985
|
||||
Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by:
|
||||
Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin:
|
||||
http://svnview.digium.com/svn/dahdi?view=rev&rev=10658
|
||||
|
||||
* drivers/dahdi/dahdi-base.c: dahdi: Fix compilation when
|
||||
CONFIG_DAHDI_WATCHDOG is defined. From: Mike Sinkovsky
|
||||
<msink@trikom.ru> Internal-Issue-ID: DAHLIN-288 Signed-off-by:
|
||||
Shaun Ruffell <sruffell@digium.com> Origin:
|
||||
http://svnview.digium.com/svn/dahdi?view=rev&rev=10655
|
||||
|
||||
2012-04-11 09:16 +0000 [r10651-10654] Tzafrir Cohen <tzafrir.cohen@xorcom.com>
|
||||
|
||||
* drivers/dahdi/xpp/firmwares/FPGA_1161.201.hex: FPGA_1161.201.hex
|
||||
rev 10545: fix reset of XR1000 Previous commit (r10651) included
|
||||
an incorrect version. Including full message from that commit for
|
||||
the description. rev. 10502 of the FPGA firmware for the new
|
||||
E-Main rev. 4 fixes a potential issue when used on Xorcom XR1000
|
||||
systems: an issue with the power supply may cause the unit to
|
||||
reset. Note that there is no issue with previous models, with a
|
||||
normal setup of an Astribank, or other XRx000 systems.
|
||||
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Origin:
|
||||
http://svnview.digium.com/svn/dahdi?view=rev&rev=10652
|
||||
|
||||
* drivers/dahdi/xpp/firmwares/FPGA_1161.201.hex: FPGA_1161.201.hex
|
||||
rev 10532: fix reset of XR1000 rev. 10502 of the FPGA firmware
|
||||
for the new E-Main rev. 4 fixes a potential issue when used on
|
||||
Xorcom XR1000 systems: an issue with the power supply may cause
|
||||
the unit to reset. Note that there is no issue with previous
|
||||
models, with a normal setup of an Astribank, or other XRx000
|
||||
systems. Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
|
||||
Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10649
|
||||
|
||||
2012-04-05 20:34 +0000 [r10644-10648] Shaun Ruffell <sruffell@digium.com>
|
||||
|
||||
* drivers/dahdi/voicebus/Kbuild, drivers/dahdi/wct4xxp/Kbuild:
|
||||
wcte12xp, wctdm24xxp, wct4xxp: Print warning about potential GPL
|
||||
violation w/HOTPLUG_FIRMWARE=no. Print a warning message that it
|
||||
may be a GPL violation to redistribute these binaries if the
|
||||
firmware for the VPMOCT032/64/128/256 is compiled in.
|
||||
Signed-off-by: Shaun Ruffell <sruffell@digium.com> Origin:
|
||||
http://svnview.digium.com/svn/dahdi?view=rev&rev=10646
|
||||
|
||||
* drivers/dahdi/wcb4xxp/base.c: wcb4xxp: Remove asm/system.h
|
||||
include. Not needed anymore and will break compilation on Kernel
|
||||
versions >= 3.4 since commit 0195c00244dc2e [1] [1]
|
||||
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=0195c00244dc2e
|
||||
Signed-off-by: Shaun Ruffell <sruffell@digium.com> Origin:
|
||||
http://svnview.digium.com/svn/dahdi?view=rev&rev=10641
|
||||
|
||||
* drivers/dahdi/dahdi_dummy.c: dahdi_dummy: Include timer.h instead
|
||||
of time.h It appears that some kernel configurations do not
|
||||
include timer.h in any of the include files that are included by
|
||||
dahdi_dummy. The timer_structs are defined in timer.h and not
|
||||
time.h, so this change is correct even though I never could find
|
||||
a configuation myself that actually failed to compile. This has
|
||||
negligible impact since dahdi_dummy is not compiled by default.
|
||||
Internal-Issue-ID: DAHLIN-185 Reported-by: Steve Murphy
|
||||
Signed-off-by: Shaun Ruffell <sruffell@digium.com> Origin:
|
||||
http://svnview.digium.com/svn/dahdi?view=rev&rev=10640
|
||||
|
||||
2012-04-03 22:02 +0000 [r10628-10637] Shaun Ruffell <sruffell@digium.com>
|
||||
|
||||
* drivers/dahdi/dahdi-base.c: dahdi: Fix compilation when
|
||||
CONFIG_DAHDI_NET is defined. 'irq' field was removed from
|
||||
dahdi_span in r10276 "dahdi: Remove dahdi_span.irq and move
|
||||
dahdi_span.irqmisses into dahdi_device." [1] which was first
|
||||
released in dahdi-linux 2.6.0. [1]
|
||||
http://svnview.digium.com/svn/dahdi?view=revision&revision=10276
|
||||
Reported-by: Pavel Selivanov Internal-Issue-ID: DAHLIN-278
|
||||
Patches: hdlc.patch by Pavel Selivanov (license #5420)
|
||||
Signed-off-by: Shaun Ruffell <sruffell@digium.com> Origin:
|
||||
http://svnview.digium.com/svn/dahdi?view=rev&rev=10634
|
||||
|
||||
* drivers/dahdi/dahdi-base.c: dahdi: Fix compilation when
|
||||
CONFIG_DAHDI_ECHOCAN_PROCESS_TX is defined. 'ec_state' was
|
||||
renamed to 'dahdi_echocan_state' in r6529 [1] but support for
|
||||
CONFIG_DAHDI_ECHOCAN_PROCESS_TX was first committed in r9442 [2].
|
||||
So it appears that I never compiled tested this exact commit when
|
||||
it went in for the 2.5.0 release. [1]
|
||||
http://svnview.digium.com/svn/dahdi?view=revision&revision=6529
|
||||
[2]
|
||||
http://svnview.digium.com/svn/dahdi?view=revision&revision=9442
|
||||
Reported-by: Pavel Selivanov Internal-Issue-ID: DAHLIN-279
|
||||
Patches: ec.patch uploaded by Pavel Selivanov (License #5420) [
|
||||
edited the patch slightly for minor formatting ] Signed-off-by:
|
||||
Shaun Ruffell <sruffell@digium.com> Origin:
|
||||
http://svnview.digium.com/svn/dahdi?view=rev&rev=10633
|
||||
|
||||
* drivers/dahdi/dahdi_dynamic_loc.c: dahdi_dynamic_loc: Change and
|
||||
check the dyn->pvt pointer under lock. Fixes a crash on unload if
|
||||
the sync_tick callback was running at the same time the dynamic
|
||||
local span was destroyed. It was possible for
|
||||
dahdi_dynamic_local_transmit to dereference a pointer that may
|
||||
have already been freed. Signed-off-by: Shaun Ruffell
|
||||
<sruffell@digium.com> Origin:
|
||||
http://svnview.digium.com/svn/dahdi?view=rev&rev=10627
|
||||
|
||||
* drivers/dahdi/dahdi_dynamic_eth.c: dahdi_dynamic_eth: Make
|
||||
ztdeth_exit() symetrical with ztdeth_init() and fix race on
|
||||
unload. Minor change to follow generally recommended practice.
|
||||
Prevents new packets from being queued up for devices when they
|
||||
are about to be cleaned up. Also clean up any skbs that may still
|
||||
be on the queue after unloading. Also closes anoter potential
|
||||
kernel oops on module unload. It was possible to delete the
|
||||
private structure while the master span process was running. The
|
||||
result was an attempt to page memory from interrupt context. Make
|
||||
sure that the pvt function is set and cleared under the zlock.
|
||||
Also do not assume that the pvt pointer is valid in
|
||||
ztdeth_transmit. Signed-off-by: Shaun Ruffell
|
||||
<sruffell@digium.com> Origin:
|
||||
http://svnview.digium.com/svn/dahdi?view=rev&rev=10626
|
||||
|
||||
* drivers/dahdi/dahdi_dynamic.c: dahdi_dynamic: Close race on
|
||||
unload if red alarm timer was running when unloaded. I saw a
|
||||
kernel oops that was the result of the timer running after the
|
||||
dahdi_dynamic module was unloaded. Now we wait for the timer to
|
||||
complete, and then delete it again in case it reactivated itself.
|
||||
Signed-off-by: Shaun Ruffell <sruffell@digium.com> Origin:
|
||||
http://svnview.digium.com/svn/dahdi?view=rev&rev=10625
|
||||
|
||||
* drivers/dahdi/dahdi_dynamic.c: dahdi_dynamic: Remove calls to
|
||||
__module_get(). The board drivers are the ones calling the
|
||||
unregister function, and therefore we do not need to worry about
|
||||
them unloading while calling the destroy callback. When
|
||||
destroying spans with the ioctl, replace __module_get() with
|
||||
try_module_get. This avoids hitting a BUG in module_get on kernel
|
||||
versions < 2.6.29. ALSO move the call to try_module_get out of
|
||||
the dahdi_dynamic_release function and into destroy. This way if
|
||||
the destroy callback isn't called because the dynamic driver is
|
||||
unloading the dynamic device can be left on the list to be
|
||||
cleaned up by the dahdi_dynamic_unregister_driver function().
|
||||
Signed-off-by: Shaun Ruffell <sruffell@digium.com> Origin:
|
||||
http://svnview.digium.com/svn/dahdi?view=rev&rev=10624
|
||||
|
||||
* drivers/dahdi/dahdi-base.c, include/dahdi/kernel.h,
|
||||
drivers/dahdi/dahdi_dynamic.c: dahdi_dynamic: Do not call into
|
||||
dahdi_dynamic without holding reference. Instead of registering a
|
||||
function pointer, register a dahdi_dynamic_ops structure that
|
||||
contains the owner as well as the ioctl callback. This way
|
||||
dahdi.ko can bump up the reference count on dahdi_dynamic.ko
|
||||
before calling the ioctl callback. Also, use the registration
|
||||
mutex to guard against the module being unloaded between the time
|
||||
the structure pointer was checked, and the module reference is
|
||||
taken. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Origin:
|
||||
http://svnview.digium.com/svn/dahdi?view=rev&rev=10623
|
||||
|
||||
2012-04-02 14:05 +0000 [r10620] Shaun Ruffell <sruffell@digium.com>
|
||||
|
||||
* drivers/dahdi/voicebus/vpmoct.c, drivers/dahdi/firmware/Makefile,
|
||||
drivers/dahdi/voicebus/Kbuild: wctdm24xxp, wcte12xp: Allow
|
||||
VPMOCT032 firmware to be compiled into driver. Enables the driver
|
||||
to update firmware on systems that do not have the firmware
|
||||
loader configured / enabled (Linux config option
|
||||
CONFIG_FW_LOADER). Compiling the firmware into the driver
|
||||
increase the memory footprint by around ~440K. Internal-Issue-ID:
|
||||
DAHDI-963 Reported-and-Tested-by: Guenther Kelleter
|
||||
Signed-off-by: Shaun Ruffell <sruffell@digium.com> Origin:
|
||||
http://svnview.digium.com/svn/dahdi?view=rev&rev=10618
|
||||
|
||||
2012-03-29 15:28 +0000 [r10614] Shaun Ruffell <sruffell@digium.com>
|
||||
|
||||
* drivers/dahdi/wctdm24xxp/base.c: wctdm24xxp: Remove forward
|
||||
declaration of inline for GCC 3.4.4 GCC 3.4.4 does not allow
|
||||
forward declaration of inline functions. Internal-Issue-ID:
|
||||
DAHLIN-286 Reported-by: Guenther Kelleter Patches:
|
||||
wctdm24xxp-inline.patch uploaded by Guenther Kelleter (License
|
||||
#6372) Signed-off-by: Shaun Ruffell <sruffell@digium.com> Origin:
|
||||
http://svnview.digium.com/svn/dahdi?view=rev&rev=10613
|
||||
|
||||
2012-03-28 Shaun Ruffell <sruffell@digium.com>
|
||||
|
||||
* Released 2.6.0-rc1
|
||||
|
||||
@@ -122,6 +122,7 @@ EXPORT_SYMBOL(dahdi_qevent_nolock);
|
||||
EXPORT_SYMBOL(dahdi_qevent_lock);
|
||||
EXPORT_SYMBOL(dahdi_hooksig);
|
||||
EXPORT_SYMBOL(dahdi_alarm_notify);
|
||||
EXPORT_SYMBOL(dahdi_set_dynamic_ioctl);
|
||||
EXPORT_SYMBOL(dahdi_hdlc_abort);
|
||||
EXPORT_SYMBOL(dahdi_hdlc_finish);
|
||||
EXPORT_SYMBOL(dahdi_hdlc_getbuf);
|
||||
@@ -2463,11 +2464,12 @@ static ssize_t dahdi_chan_write(struct file *file, const char __user *usrbuf,
|
||||
if ((chan->ec_state) &&
|
||||
(ECHO_MODE_ACTIVE == chan->ec_state->status.mode) &&
|
||||
(chan->ec_state->ops->echocan_process_tx)) {
|
||||
struct dahdi_echocan_state *const ec = chan->ec_state;
|
||||
struct ec_state *const ec_state = chan->ec_state;
|
||||
for (x = 0; x < chan->writen[res]; ++x) {
|
||||
short tx;
|
||||
tx = DAHDI_XLAW(chan->writebuf[res][x], chan);
|
||||
ec->ops->echocan_process_tx(ec, &tx, 1);
|
||||
ec_state->ops->echocan_process_tx(ec_state,
|
||||
&tx, 1);
|
||||
chan->writebuf[res][x] = DAHDI_LIN2X((int) tx,
|
||||
chan);
|
||||
}
|
||||
@@ -4420,14 +4422,12 @@ static int dahdi_common_ioctl(struct file *file, unsigned int cmd,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct dahdi_dynamic_ops *dahdi_dynamic_ops;
|
||||
void dahdi_set_dynamic_ops(const struct dahdi_dynamic_ops *ops)
|
||||
static int (*dahdi_dynamic_ioctl)(unsigned int cmd, unsigned long data);
|
||||
|
||||
void dahdi_set_dynamic_ioctl(int (*func)(unsigned int cmd, unsigned long data))
|
||||
{
|
||||
mutex_lock(®istration_mutex);
|
||||
dahdi_dynamic_ops = ops;
|
||||
mutex_unlock(®istration_mutex);
|
||||
dahdi_dynamic_ioctl = func;
|
||||
}
|
||||
EXPORT_SYMBOL(dahdi_set_dynamic_ops);
|
||||
|
||||
static int (*dahdi_hpec_ioctl)(unsigned int cmd, unsigned long data);
|
||||
|
||||
@@ -4648,6 +4648,7 @@ static int dahdi_ioctl_chanconfig(struct file *file, unsigned long data)
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
|
||||
SET_MODULE_OWNER(chan->hdlcnetdev->netdev);
|
||||
#endif
|
||||
chan->hdlcnetdev->netdev->irq = chan->span->irq;
|
||||
chan->hdlcnetdev->netdev->tx_queue_len = 50;
|
||||
#ifdef HAVE_NET_DEVICE_OPS
|
||||
chan->hdlcnetdev->netdev->netdev_ops = &dahdi_netdev_ops;
|
||||
@@ -5145,33 +5146,6 @@ static int dahdi_ioctl_maint(unsigned long data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dahdi_ioctl_dynamic(unsigned int cmd, unsigned long data)
|
||||
{
|
||||
bool tried_load = false;
|
||||
int res;
|
||||
|
||||
retry_check:
|
||||
mutex_lock(®istration_mutex);
|
||||
if (!dahdi_dynamic_ops) {
|
||||
mutex_unlock(®istration_mutex);
|
||||
if (tried_load)
|
||||
return -ENOSYS;
|
||||
|
||||
request_module("dahdi_dynamic");
|
||||
tried_load = true;
|
||||
goto retry_check;
|
||||
}
|
||||
if (!try_module_get(dahdi_dynamic_ops->owner)) {
|
||||
mutex_unlock(®istration_mutex);
|
||||
return -ENOSYS;
|
||||
}
|
||||
mutex_unlock(®istration_mutex);
|
||||
|
||||
res = dahdi_dynamic_ops->ioctl(cmd, data);
|
||||
module_put(dahdi_dynamic_ops->owner);
|
||||
return res;
|
||||
}
|
||||
|
||||
static int
|
||||
dahdi_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long data)
|
||||
{
|
||||
@@ -5206,7 +5180,14 @@ dahdi_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long data)
|
||||
return dahdi_ioctl_maint(data);
|
||||
case DAHDI_DYNAMIC_CREATE:
|
||||
case DAHDI_DYNAMIC_DESTROY:
|
||||
return dahdi_ioctl_dynamic(cmd, data);
|
||||
if (dahdi_dynamic_ioctl) {
|
||||
return dahdi_dynamic_ioctl(cmd, data);
|
||||
} else {
|
||||
request_module("dahdi_dynamic");
|
||||
if (dahdi_dynamic_ioctl)
|
||||
return dahdi_dynamic_ioctl(cmd, data);
|
||||
}
|
||||
return -ENOSYS;
|
||||
case DAHDI_EC_LICENSE_CHALLENGE:
|
||||
case DAHDI_EC_LICENSE_RESPONSE:
|
||||
if (dahdi_hpec_ioctl) {
|
||||
@@ -9976,7 +9957,7 @@ static void watchdog_check(unsigned long ignored)
|
||||
static int wdcheck=0;
|
||||
struct dahdi_span *s;
|
||||
|
||||
spin_lock_irqsave(&chan_lock, flags);
|
||||
spin_lock_irqsave(&span_list_lock, flags);
|
||||
list_for_each_entry(s, &span_list, spans_node) {
|
||||
if (s->flags & DAHDI_FLAG_RUNNING) {
|
||||
if (s->watchcounter == DAHDI_WATCHDOG_INIT) {
|
||||
@@ -9984,9 +9965,9 @@ static void watchdog_check(unsigned long ignored)
|
||||
if ((s->watchstate == DAHDI_WATCHSTATE_OK) ||
|
||||
(s->watchstate == DAHDI_WATCHSTATE_UNKNOWN)) {
|
||||
s->watchstate = DAHDI_WATCHSTATE_RECOVERING;
|
||||
if (s->ops->watchdog) {
|
||||
if (s->watchdog) {
|
||||
module_printk(KERN_NOTICE, "Kicking span %s\n", s->name);
|
||||
s->ops->watchdog(s, DAHDI_WATCHDOG_NOINTS);
|
||||
s->watchdog(spans[x], DAHDI_WATCHDOG_NOINTS);
|
||||
} else {
|
||||
module_printk(KERN_NOTICE, "Span %s is dead with no revival\n", s->name);
|
||||
s->watchstate = DAHDI_WATCHSTATE_FAILED;
|
||||
@@ -10001,7 +9982,7 @@ static void watchdog_check(unsigned long ignored)
|
||||
s->watchcounter = DAHDI_WATCHDOG_INIT;
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&chan_lock, flags);
|
||||
spin_unlock_irqrestore(&span_list_lock, flags);
|
||||
if (!wdcheck) {
|
||||
module_printk(KERN_NOTICE, "watchdog on duty!\n");
|
||||
wdcheck=1;
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
#if defined(USE_HIGHRESTIMER)
|
||||
#include <linux/hrtimer.h>
|
||||
#else
|
||||
#include <linux/timer.h>
|
||||
#include <linux/time.h>
|
||||
#endif
|
||||
|
||||
#include <dahdi/kernel.h>
|
||||
|
||||
@@ -385,6 +385,16 @@ static void dahdi_dynamic_release(struct kref *kref)
|
||||
|
||||
WARN_ON(test_bit(DAHDI_FLAGBIT_REGISTERED, &d->span.flags));
|
||||
|
||||
if (d->pvt) {
|
||||
if (d->driver && d->driver->destroy) {
|
||||
__module_get(d->driver->owner);
|
||||
d->driver->destroy(d);
|
||||
module_put(d->driver->owner);
|
||||
} else {
|
||||
WARN_ON(1);
|
||||
}
|
||||
}
|
||||
|
||||
kfree(d->msgbuf);
|
||||
|
||||
for (x = 0; x < d->span.channels; x++)
|
||||
@@ -460,24 +470,6 @@ static int _destroy_dynamic(struct dahdi_dynamic_span *dds)
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
if (d->pvt) {
|
||||
if (d->driver && d->driver->destroy) {
|
||||
if (!try_module_get(d->driver->owner)) {
|
||||
/* The driver for this device is in the
|
||||
* process of unloading. Leave this dynamic on
|
||||
* the list so it's cleaned up when the driver
|
||||
* unregisters. */
|
||||
dynamic_put(d);
|
||||
return -ENXIO;
|
||||
}
|
||||
d->driver->destroy(d);
|
||||
module_put(d->driver->owner);
|
||||
} else {
|
||||
WARN_ON(1);
|
||||
}
|
||||
d->pvt = NULL;
|
||||
}
|
||||
|
||||
dahdi_unregister_device(d->ddev);
|
||||
|
||||
spin_lock_irqsave(&dspan_lock, flags);
|
||||
@@ -775,17 +767,19 @@ void dahdi_dynamic_unregister_driver(struct dahdi_dynamic_driver *dri)
|
||||
list_for_each_entry_safe(d, n, &dspan_list, list) {
|
||||
if (d->driver == dri) {
|
||||
if (d->pvt) {
|
||||
if (d->driver && d->driver->destroy)
|
||||
if (d->driver && d->driver->destroy) {
|
||||
__module_get(d->driver->owner);
|
||||
d->driver->destroy(d);
|
||||
else
|
||||
module_put(d->driver->owner);
|
||||
} else {
|
||||
WARN_ON(1);
|
||||
}
|
||||
}
|
||||
dahdi_unregister_device(d->ddev);
|
||||
spin_lock_irqsave(&dspan_lock, flags);
|
||||
list_del_rcu(&d->list);
|
||||
spin_unlock_irqrestore(&dspan_lock, flags);
|
||||
synchronize_rcu();
|
||||
d->driver = NULL;
|
||||
dynamic_put(d);
|
||||
}
|
||||
}
|
||||
@@ -829,13 +823,10 @@ static void check_for_red_alarm(unsigned long ignored)
|
||||
mod_timer(&alarmcheck, jiffies + 1 * HZ);
|
||||
}
|
||||
|
||||
static const struct dahdi_dynamic_ops dahdi_dynamic_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
.ioctl = dahdi_dynamic_ioctl,
|
||||
};
|
||||
|
||||
static int dahdi_dynamic_init(void)
|
||||
{
|
||||
dahdi_set_dynamic_ioctl(dahdi_dynamic_ioctl);
|
||||
|
||||
/* Start process to check for RED ALARM */
|
||||
init_timer(&alarmcheck);
|
||||
alarmcheck.expires = 0;
|
||||
@@ -846,25 +837,19 @@ static int dahdi_dynamic_init(void)
|
||||
#ifdef ENABLE_TASKLETS
|
||||
tasklet_init(&dahdi_dynamic_tlet, dahdi_dynamic_tasklet, 0);
|
||||
#endif
|
||||
dahdi_set_dynamic_ops(&dahdi_dynamic_ops);
|
||||
|
||||
printk(KERN_INFO "DAHDI Dynamic Span support LOADED\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dahdi_dynamic_cleanup(void)
|
||||
{
|
||||
dahdi_set_dynamic_ops(NULL);
|
||||
|
||||
#ifdef ENABLE_TASKLETS
|
||||
if (taskletpending) {
|
||||
tasklet_disable(&dahdi_dynamic_tlet);
|
||||
tasklet_kill(&dahdi_dynamic_tlet);
|
||||
}
|
||||
#endif
|
||||
del_timer_sync(&alarmcheck);
|
||||
/* Must call again in case it was running before and rescheduled
|
||||
* itself. */
|
||||
dahdi_set_dynamic_ioctl(NULL);
|
||||
del_timer(&alarmcheck);
|
||||
printk(KERN_INFO "DAHDI Dynamic Span support unloaded\n");
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ static void ztdeth_transmit(struct dahdi_dynamic *dyn, u8 *msg, size_t msglen)
|
||||
|
||||
spin_lock_irqsave(&zlock, flags);
|
||||
z = dyn->pvt;
|
||||
if (z && z->dev) {
|
||||
if (z->dev) {
|
||||
/* Copy fields to local variables to remove spinlock ASAP */
|
||||
dev = z->dev;
|
||||
memcpy(addr, z->addr, sizeof(z->addr));
|
||||
@@ -315,12 +315,11 @@ static void ztdeth_destroy(struct dahdi_dynamic *dyn)
|
||||
prev = cur;
|
||||
cur = cur->next;
|
||||
}
|
||||
spin_unlock_irqrestore(&zlock, flags);
|
||||
if (cur == z) { /* Successfully removed */
|
||||
dyn->pvt = NULL;
|
||||
printk(KERN_INFO "TDMoE: Removed interface for %s\n", z->span->name);
|
||||
kfree(z);
|
||||
}
|
||||
spin_unlock_irqrestore(&zlock, flags);
|
||||
}
|
||||
|
||||
static int ztdeth_create(struct dahdi_dynamic *dyn, const char *addr)
|
||||
@@ -443,12 +442,12 @@ static struct notifier_block ztdeth_nblock = {
|
||||
|
||||
static int __init ztdeth_init(void)
|
||||
{
|
||||
skb_queue_head_init(&skbs);
|
||||
|
||||
dev_add_pack(&ztdeth_ptype);
|
||||
register_netdevice_notifier(&ztdeth_nblock);
|
||||
dahdi_dynamic_register_driver(&ztd_eth);
|
||||
|
||||
skb_queue_head_init(&skbs);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -459,11 +458,9 @@ static void __exit ztdeth_exit(void)
|
||||
#else
|
||||
cancel_work_sync(&dahdi_dynamic_eth_flush_work);
|
||||
#endif
|
||||
dahdi_dynamic_unregister_driver(&ztd_eth);
|
||||
unregister_netdevice_notifier(&ztdeth_nblock);
|
||||
dev_remove_pack(&ztdeth_ptype);
|
||||
|
||||
skb_queue_purge(&skbs);
|
||||
unregister_netdevice_notifier(&ztdeth_nblock);
|
||||
dahdi_dynamic_unregister_driver(&ztd_eth);
|
||||
}
|
||||
|
||||
MODULE_DESCRIPTION("DAHDI Dynamic TDMoE Support");
|
||||
|
||||
@@ -78,11 +78,10 @@ static LIST_HEAD(dynamic_local_list);
|
||||
static void
|
||||
dahdi_dynamic_local_transmit(struct dahdi_dynamic *dyn, u8 *msg, size_t msglen)
|
||||
{
|
||||
struct dahdi_dynamic_local *d;
|
||||
struct dahdi_dynamic_local *const d = dyn->pvt;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&local_lock, flags);
|
||||
d = dyn->pvt;
|
||||
if (d && d->peer && d->peer->span) {
|
||||
if (test_bit(DAHDI_FLAGBIT_REGISTERED, &d->peer->span->flags))
|
||||
dahdi_dynamic_receive(d->peer->span, msg, msglen);
|
||||
@@ -131,12 +130,11 @@ static int digit2int(char d)
|
||||
|
||||
static void dahdi_dynamic_local_destroy(struct dahdi_dynamic *dyn)
|
||||
{
|
||||
struct dahdi_dynamic_local *d;
|
||||
struct dahdi_dynamic_local *d = dyn->pvt;
|
||||
unsigned long flags;
|
||||
struct dahdi_dynamic_local *cur;
|
||||
|
||||
spin_lock_irqsave(&local_lock, flags);
|
||||
d = dyn->pvt;
|
||||
list_for_each_entry(cur, &dynamic_local_list, node) {
|
||||
if (cur->peer == d)
|
||||
cur->peer = NULL;
|
||||
|
||||
@@ -58,7 +58,6 @@ OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-OCT6114-128=dahdi-fw-oct6114-128.o)
|
||||
OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-OCT6114-256=dahdi-fw-oct6114-256.o)
|
||||
OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-TC400M=dahdi-fw-tc400m.o)
|
||||
OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-HX8=dahdi-fw-hx8.o)
|
||||
OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-VPMOCT032=dahdi-fw-vpmoct032.o)
|
||||
|
||||
# Force usage of wget, for now
|
||||
DOWNLOAD=wget
|
||||
@@ -221,8 +220,3 @@ dahdi-fw-oct6114-256.o: dahdi-fw-oct6114-256-$(OCT6114_256_VERSION).tar.gz dahdi
|
||||
dahdi-fw-tc400m.o: dahdi-fw-tc400m-$(TC400M_VERSION).tar.gz dahdi-fw-tc400m.bin make_firmware_object
|
||||
@echo Making firmware object file for dahdi-fw-tc400m.bin
|
||||
./make_firmware_object dahdi-fw-tc400m.bin $@
|
||||
|
||||
# Build object file of a VPMOCT032 firmware image for linking
|
||||
dahdi-fw-vpmoct032.o: dahdi-fw-vpmoct032-$(VPMOCT032_VERSION).tar.gz dahdi-fw-vpmoct032.bin make_firmware_object
|
||||
@echo Making firmware object file for dahdi-fw-vpmoct032.bin
|
||||
./make_firmware_object dahdi-fw-vpmoct032.bin $@
|
||||
|
||||
@@ -2,17 +2,4 @@ obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_VOICEBUS) += dahdi_voicebus.o
|
||||
|
||||
dahdi_voicebus-objs := voicebus.o GpakCust.o GpakApi.o voicebus_net.o vpmoct.o
|
||||
|
||||
FIRM_DIR := ../firmware
|
||||
|
||||
ifneq ($(HOTPLUG_FIRMWARE),yes)
|
||||
dahdi_voicebus-objs += $(FIRM_DIR)/dahdi-fw-vpmoct032.o
|
||||
$(warning WARNING: You are compiling firmware into voicebus.ko which is not available under the terms of the GPL. It may be a violation of the GPL to distribute the resulting image since it combines both GPL and non-GPL work. You should consult a lawyer of your own before distributing such an image.)
|
||||
else
|
||||
EXTRA_CFLAGS+=-DHOTPLUG_FIRMWARE
|
||||
endif
|
||||
|
||||
EXTRA_CFLAGS += -I$(src)/.. -Wno-undef
|
||||
|
||||
$(obj)/$(FIRM_DIR)/dahdi-fw-vpmoct032.o: $(obj)/voicebus.o
|
||||
$(MAKE) -C $(obj)/$(FIRM_DIR) dahdi-fw-vpmoct032.o
|
||||
|
||||
EXTRA_CFLAGS := -I$(src)/.. -Wno-undef
|
||||
|
||||
@@ -443,47 +443,6 @@ static void vpmoct_set_defaults(struct vpmoct *vpm)
|
||||
vpmoct_write_dword(vpm, 0x30, 0);
|
||||
}
|
||||
|
||||
static const char *const FIRMWARE_NAME = "dahdi-fw-vpmoct032.bin";
|
||||
#if defined(HOTPLUG_FIRMWARE)
|
||||
static int
|
||||
vpmoct_request_firmware(const struct firmware **fw, struct device *dev)
|
||||
{
|
||||
return request_firmware(fw, FIRMWARE_NAME, dev);
|
||||
}
|
||||
|
||||
static void vpmoct_release_firmware(const struct firmware *fw)
|
||||
{
|
||||
release_firmware(fw);
|
||||
}
|
||||
#else
|
||||
static int
|
||||
vpmoct_request_firmware(const struct firmware **fw_p, struct device *dev)
|
||||
{
|
||||
struct firmware *fw;
|
||||
extern void _binary_dahdi_fw_vpmoct032_bin_size;
|
||||
extern u8 _binary_dahdi_fw_vpmoct032_bin_start[];
|
||||
|
||||
*fw_p = fw = kzalloc(sizeof(*fw), GFP_KERNEL);
|
||||
if (!fw)
|
||||
return -ENOMEM;
|
||||
|
||||
fw->data = _binary_dahdi_fw_vpmoct032_bin_start;
|
||||
/* Yes... this is weird. objcopy gives us a symbol containing
|
||||
the size of the firmware, not a pointer a variable containing the
|
||||
size. The only way we can get the value of the symbol is to take
|
||||
its address, so we define it as a pointer and then cast that value
|
||||
to the proper type. */
|
||||
fw->size = (size_t) &_binary_dahdi_fw_vpmoct032_bin_size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void vpmoct_release_firmware(const struct firmware *fw)
|
||||
{
|
||||
kfree(fw);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* vpmoct_load_flash - Check the current flash version and possibly load.
|
||||
* @vpm: The VPMOCT032 module to check / load.
|
||||
@@ -504,9 +463,10 @@ static void vpmoct_load_flash(struct work_struct *data)
|
||||
const struct firmware *fw;
|
||||
const struct vpmoct_header *header;
|
||||
char serial[VPMOCT_SERIAL_SIZE+1];
|
||||
const char *const FIRMWARE_NAME = "dahdi-fw-vpmoct032.bin";
|
||||
int i;
|
||||
|
||||
res = vpmoct_request_firmware(&fw, vpm->dev);
|
||||
res = request_firmware(&fw, FIRMWARE_NAME, vpm->dev);
|
||||
if (res) {
|
||||
dev_warn(vpm->dev,
|
||||
"vpmoct: Failed to load firmware from userspace! %d\n",
|
||||
@@ -545,7 +505,7 @@ static void vpmoct_load_flash(struct work_struct *data)
|
||||
FIRMWARE_NAME);
|
||||
|
||||
/* Just use the old version of the fimware. */
|
||||
vpmoct_release_firmware(fw);
|
||||
release_firmware(fw);
|
||||
vpmoct_set_defaults(vpm);
|
||||
vpmoct_load_complete(work, true);
|
||||
return;
|
||||
@@ -554,7 +514,7 @@ static void vpmoct_load_flash(struct work_struct *data)
|
||||
if (vpm->minor == header->minor &&
|
||||
vpm->major == header->major) {
|
||||
/* Proper version is running */
|
||||
vpmoct_release_firmware(fw);
|
||||
release_firmware(fw);
|
||||
vpmoct_set_defaults(vpm);
|
||||
vpmoct_load_complete(work, true);
|
||||
return;
|
||||
@@ -588,14 +548,14 @@ static void vpmoct_load_flash(struct work_struct *data)
|
||||
if (vpmoct_check_firmware_crc(vpm, fw->size-VPMOCT_FIRM_HEADER_LEN*2,
|
||||
header->major, header->minor))
|
||||
goto error;
|
||||
vpmoct_release_firmware(fw);
|
||||
release_firmware(fw);
|
||||
vpmoct_set_defaults(vpm);
|
||||
vpmoct_load_complete(work, true);
|
||||
return;
|
||||
|
||||
error:
|
||||
dev_info(vpm->dev, "Unable to load firmware\n");
|
||||
vpmoct_release_firmware(fw);
|
||||
release_firmware(fw);
|
||||
/* TODO: Should we disable module if the firmware doesn't load? */
|
||||
vpmoct_load_complete(work, false);
|
||||
return;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/device.h> /* dev_err() */
|
||||
#include <linux/interrupt.h>
|
||||
#include <asm/system.h> /* cli(), *_flags */
|
||||
#include <asm/uaccess.h> /* copy_*_user */
|
||||
#include <linux/workqueue.h> /* work_struct */
|
||||
#include <linux/timer.h> /* timer_struct */
|
||||
|
||||
@@ -18,7 +18,6 @@ wct4xxp-objs := base.o vpm450m.o $(shell $(src)/../oct612x/octasic-helper object
|
||||
|
||||
ifneq ($(HOTPLUG_FIRMWARE),yes)
|
||||
wct4xxp-objs += $(FIRM_DIR)/dahdi-fw-oct6114-064.o $(FIRM_DIR)/dahdi-fw-oct6114-128.o $(FIRM_DIR)/dahdi-fw-oct6114-256.o
|
||||
$(warning WARNING: You are compiling firmware into wct4xxp.ko which is not available under the terms of the GPL. It may be a violation of the GPL to distribute the resulting image since it combines both GPL and non-GPL work. You should consult a lawyer of your own before distributing such an image.)
|
||||
endif
|
||||
|
||||
$(obj)/$(FIRM_DIR)/dahdi-fw-oct6114-064.o: $(obj)/base.o
|
||||
|
||||
@@ -1073,22 +1073,9 @@ wctdm_isr_getreg(struct wctdm *wc, struct wctdm_module *const mod, u8 address)
|
||||
list_add(&cmd->node, &mod->pending_cmds);
|
||||
}
|
||||
|
||||
/* Must be called with wc.reglock held and local interrupts disabled */
|
||||
static inline void
|
||||
wctdm_setreg_intr(struct wctdm *wc, struct wctdm_module *mod, int addr, int val)
|
||||
{
|
||||
struct wctdm_cmd *cmd;
|
||||
|
||||
cmd = kmalloc(sizeof(*cmd), GFP_ATOMIC);
|
||||
if (unlikely(!cmd))
|
||||
return;
|
||||
|
||||
cmd->complete = NULL;
|
||||
cmd->cmd = CMD_WR(addr, val);
|
||||
|
||||
list_add_tail(&cmd->node, &mod->pending_cmds);
|
||||
}
|
||||
|
||||
wctdm_setreg_intr(struct wctdm *wc, struct wctdm_module *mod,
|
||||
int addr, int val);
|
||||
|
||||
static void cmd_checkisr(struct wctdm *wc, struct wctdm_module *const mod)
|
||||
{
|
||||
@@ -1233,6 +1220,22 @@ static inline void wctdm_transmitprep(struct wctdm *wc, unsigned char *sframe)
|
||||
spin_unlock(&wc->reglock);
|
||||
}
|
||||
|
||||
/* Must be called with wc.reglock held and local interrupts disabled */
|
||||
static inline void
|
||||
wctdm_setreg_intr(struct wctdm *wc, struct wctdm_module *mod, int addr, int val)
|
||||
{
|
||||
struct wctdm_cmd *cmd;
|
||||
|
||||
cmd = kmalloc(sizeof(*cmd), GFP_ATOMIC);
|
||||
if (unlikely(!cmd))
|
||||
return;
|
||||
|
||||
cmd->complete = NULL;
|
||||
cmd->cmd = CMD_WR(addr, val);
|
||||
|
||||
list_add_tail(&cmd->node, &mod->pending_cmds);
|
||||
}
|
||||
|
||||
int wctdm_setreg(struct wctdm *wc, struct wctdm_module *mod, int addr, int val)
|
||||
{
|
||||
struct wctdm_cmd *cmd;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -834,7 +834,7 @@ int xpp_maint(struct dahdi_span *span, int cmd)
|
||||
* If the watchdog detects no received data, it will call the
|
||||
* watchdog routine
|
||||
*/
|
||||
int xpp_watchdog(struct dahdi_span *span, int cause)
|
||||
static int xpp_watchdog(struct dahdi_span *span, int cause)
|
||||
{
|
||||
static int rate_limit = 0;
|
||||
|
||||
@@ -842,7 +842,6 @@ int xpp_watchdog(struct dahdi_span *span, int cause)
|
||||
DBG(GENERAL, "\n");
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(xpp_watchdog);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -47,7 +47,6 @@ int xpp_close(struct dahdi_chan *chan);
|
||||
int xpp_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long arg);
|
||||
int xpp_hooksig(struct dahdi_chan *chan, enum dahdi_txsig txsig);
|
||||
int xpp_maint(struct dahdi_span *span, int cmd);
|
||||
int xpp_watchdog(struct dahdi_span *span, int cause);
|
||||
void xpp_span_assigned(struct dahdi_span *span);
|
||||
void report_bad_ioctl(const char *msg, xpd_t *xpd, int pos, unsigned int cmd);
|
||||
int total_registered_spans(void);
|
||||
|
||||
@@ -1280,13 +1280,8 @@ extern u_char __dahdi_lin2mu[16384];
|
||||
extern u_char __dahdi_lin2a[16384];
|
||||
#endif
|
||||
|
||||
struct dahdi_dynamic_ops {
|
||||
struct module *owner;
|
||||
int (*ioctl)(unsigned int cmd, unsigned long data);
|
||||
};
|
||||
|
||||
/*! \brief Used by dynamic DAHDI -- don't use directly */
|
||||
void dahdi_set_dynamic_ops(const struct dahdi_dynamic_ops *ops);
|
||||
void dahdi_set_dynamic_ioctl(int (*func)(unsigned int cmd, unsigned long data));
|
||||
|
||||
/*! \brief Used by DAHDI HPEC module -- don't use directly */
|
||||
void dahdi_set_hpec_ioctl(int (*func)(unsigned int cmd, unsigned long data));
|
||||
|
||||
Reference in New Issue
Block a user