Compare commits

..

2 Commits

Author SHA1 Message Date
Shaun Ruffell
813a2f2319 Importing files for 2.6.1-rc1 release.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/tags/2.6.1-rc1@10580 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21 22:01:47 +00:00
Shaun Ruffell
a6b23c968e Creating tag for the release of dahdi-linux-2.6.1-rc1
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/tags/2.6.1-rc1@10579 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2012-03-21 22:00:50 +00:00
25 changed files with 22373 additions and 16555 deletions

41
.gitignore vendored
View File

@@ -1,41 +0,0 @@
# Files that are generated as part of the build process which we do not want git
# to track.
*.[oa]
*.mod
*.mod.[oc]
*.ko
*.cmd
*.order
*.tar.gz
tags
cscope.*
*.symvers
*.markers
.*.o.d
README.html
modules.order
Module.markers
build_tools/checkpatch.pl
drivers/dahdi/xpp/*.verified
drivers/dahdi/.tmp_versions/
drivers/dahdi/Module.symvers
drivers/dahdi/makefw
drivers/dahdi/radfw.h
drivers/dahdi/tor2fw.h
drivers/dahdi/xpp/init_fxo_modes
drivers/dahdi/xpp/print_fxo_modes
drivers/dahdi/xpp/xpp_version.h
include/dahdi/version.h
drivers/dahdi/vpmadt032_loader/vpmadt032_loader.h
drivers/dahdi/vpmadt032_loader/vpmadt032_x86_32.o_shipped
drivers/dahdi/vpmadt032_loader/vpmadt032_x86_64.o_shipped
drivers/dahdi/firmware/dahdi-fw-hx8.bin
drivers/dahdi/firmware/dahdi-fw-oct6114-064.bin
drivers/dahdi/firmware/dahdi-fw-oct6114-128.bin
drivers/dahdi/firmware/dahdi-fw-oct6114-256.bin
drivers/dahdi/firmware/dahdi-fw-tc400m.bin
drivers/dahdi/firmware/dahdi-fw-te820.bin
drivers/dahdi/firmware/dahdi-fw-vpmoct032.bin
drivers/dahdi/firmware/make_firmware_object

1
.version Normal file
View File

@@ -0,0 +1 @@
2.6.1-rc1

6410
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -67,7 +67,13 @@ GENERATED_DOCS:=README.html
ifneq ($(wildcard .version),)
DAHDIVERSION:=$(shell cat .version)
else
ifneq ($(wildcard .svn),)
DAHDIVERSION:=$(shell build_tools/make_version . dahdi/linux)
else
ifneq ($(wildcard .git),)
DAHDIVERSION:=$(shell build_tools/make_version . dahdi/linux)
endif
endif
endif
all: modules

View File

@@ -59,7 +59,7 @@ elif [ -d ${1}/.git ]; then
MODIFIED=""
SVN_REV=`git log --pretty=full -1 | grep -F "git-svn-id:" | sed -e "s/.*\@\([^\s]*\)\s.*/\1/g"`
if [ -z "$SVN_REV" ]; then
VERSION=`git describe --tags --dirty=M 2> /dev/null | sed -e "s/^v//"`
VERSION=`git describe --long --always --tags --dirty=M 2> /dev/null`
if [ $? -ne 0 ]; then
if [ "`git ls-files -m | wc -l`" != "0" ]; then
MODIFIED="M"
@@ -115,8 +115,4 @@ elif [ -d ${1}/.git ]; then
echo SVN-${RESULT##-}-r${SVN_REV}${MODIFIED}
fi
else
# Use the directory information in the absence of any other version
# information
pwd -P
fi

View File

@@ -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(&registration_mutex);
dahdi_dynamic_ops = ops;
mutex_unlock(&registration_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(&registration_mutex);
if (!dahdi_dynamic_ops) {
mutex_unlock(&registration_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(&registration_mutex);
return -ENOSYS;
}
mutex_unlock(&registration_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;

View File

@@ -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>

View File

@@ -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");
}

View File

@@ -71,8 +71,6 @@ static struct dahdi_span *ztdeth_getspan(unsigned char *addr, unsigned short sub
if (z)
span = z->span;
spin_unlock_irqrestore(&zlock, flags);
if (!span || !test_bit(DAHDI_FLAGBIT_REGISTERED, &span->flags))
return NULL;
return span;
}
@@ -154,7 +152,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 +313,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,27 +440,21 @@ 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;
}
static void __exit ztdeth_exit(void)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)
flush_scheduled_work();
#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");

View File

@@ -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;

View File

@@ -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 $@

View File

@@ -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

View File

@@ -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;

View File

@@ -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 */
@@ -1249,8 +1250,7 @@ static char *hfc_decode_st_state(struct b4xxp *b4, int port, unsigned char state
"?", "?", "?", "?", "?", "?", "?", "?" }
};
str = kmalloc(256, GFP_ATOMIC);
if (!str) {
if (!(str = kmalloc(256, GFP_KERNEL))) {
dev_warn(&b4->pdev->dev, "could not allocate mem for ST state decode string!\n");
return NULL;
}

View File

@@ -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

View File

@@ -1239,11 +1239,9 @@ static int t4_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long dat
else
clear_bit(chan->chanpos - 1, &ts->dtmfmutemask);
channel = has_e1_span(wc) ? chan->chanpos : chan->chanpos + 4;
if (is_octal(wc))
channel = channel << 3;
else
channel = channel << 2;
channel = (chan->chanpos) << 3;
if (!has_e1_span(wc))
channel += (4 << 3);
channel |= chan->span->offset;
vpm450m_setdtmf(wc->vpm, channel, j & DAHDI_TONEDETECT_ON,
j & DAHDI_TONEDETECT_MUTE);
@@ -2039,7 +2037,7 @@ static void t4_span_assigned(struct dahdi_span *span)
/* We use this to make sure all the spans are assigned before
* running the serial setup. */
list_for_each_entry(pos, &wc->ddev->spans, device_node) {
if (!test_bit(DAHDI_FLAGBIT_REGISTERED, &pos->flags))
if (!test_bit(DAHDI_FLAGBIT_REGISTERED, &span->flags))
++unassigned_spans;
}
@@ -2095,8 +2093,6 @@ static int t4_alloc_channels(struct t4 *wc, struct t4_span *ts,
for (i = 0; i < ARRAY_SIZE(ts->chans); ++i) {
kfree(ts->chans[i]);
kfree(ts->ec[i]);
ts->chans[i] = NULL;
ts->ec[i] = NULL;
}
ts->linemode = linemode;
@@ -3788,7 +3784,7 @@ static inline void t4_framer_interrupt(struct t4 *wc, int span)
}
#ifdef SUPPORT_GEN1
static irqreturn_t _t4_interrupt(int irq, void *dev_id)
DAHDI_IRQ_HANDLER(t4_interrupt)
{
struct t4 *wc = dev_id;
unsigned long flags;
@@ -3856,16 +3852,6 @@ static irqreturn_t _t4_interrupt(int irq, void *dev_id)
return IRQ_RETVAL(1);
}
DAHDI_IRQ_HANDLER(t4_interrupt)
{
irqreturn_t ret;
unsigned long flags;
local_irq_save(flags);
ret = _t4_interrupt(irq, dev_id);
local_irq_restore(flags);
return ret;
}
#endif
static int t4_allocate_buffers(struct t4 *wc, int numbufs,
@@ -3983,7 +3969,7 @@ static void t4_isr_bh(unsigned long data)
#endif
}
static irqreturn_t _t4_interrupt_gen2(int irq, void *dev_id)
DAHDI_IRQ_HANDLER(t4_interrupt_gen2)
{
struct t4 *wc = dev_id;
unsigned int status;
@@ -4179,16 +4165,6 @@ out:
return IRQ_RETVAL(1);
}
DAHDI_IRQ_HANDLER(t4_interrupt_gen2)
{
irqreturn_t ret;
unsigned long flags;
local_irq_save(flags);
ret = _t4_interrupt_gen2(irq, dev_id);
local_irq_restore(flags);
return ret;
}
#ifdef SUPPORT_GEN1
static int t4_reset_dma(struct t4 *wc)
{
@@ -5236,23 +5212,22 @@ t4_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
#ifdef SUPPORT_GEN1
if (request_irq(pdev->irq, (wc->devtype->flags & FLAG_2NDGEN) ?
t4_interrupt_gen2 : t4_interrupt,
DAHDI_IRQ_SHARED,
DAHDI_IRQ_SHARED_DISABLED,
(wc->numspans == 8) ? "wct8xxp" :
(wc->numspans == 2) ? "wct2xxp" :
"wct4xxp",
wc)) {
wc))
#else
if (!(wc->tspans[0]->spanflags & FLAG_2NDGEN)) {
dev_notice(&wc->dev->dev, "This driver does not "
"support 1st gen modules\n");
free_wc(wc);
return -ENODEV;
}
if (request_irq(pdev->irq, t4_interrupt_gen2,
DAHDI_IRQ_SHARED, "t4xxp", wc)) {
if (!(wc->tspans[0]->spanflags & FLAG_2NDGEN)) {
dev_notice(&wc->dev->dev, "This driver does not "
"support 1st gen modules\n");
free_wc(wc);
return -ENODEV;
}
if (request_irq(pdev->irq, t4_interrupt_gen2, DAHDI_IRQ_SHARED_DISABLED, "t4xxp", wc))
#endif
dev_notice(&wc->dev->dev, "Unable to request IRQ %d\n",
{
dev_notice(&wc->dev->dev, "t4xxp: Unable to request IRQ %d\n",
pdev->irq);
free_wc(wc);
return -EIO;

View File

@@ -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;
@@ -1833,22 +1836,19 @@ static void wctdm_qrvdri_check_hook(struct wctdm *wc, int card)
static inline bool is_fxo_ringing(const struct fxo *const fxo)
{
return ((fxo->hook_ring_shadow & 0x60) &&
((fxo->battery_state == BATTERY_PRESENT) ||
(fxo->battery_state == BATTERY_DEBOUNCING_LOST)));
(fxo->battery_state == BATTERY_PRESENT));
}
static inline bool is_fxo_ringing_positive(const struct fxo *const fxo)
{
return (((fxo->hook_ring_shadow & 0x60) == 0x20) &&
((fxo->battery_state == BATTERY_PRESENT) ||
(fxo->battery_state == BATTERY_DEBOUNCING_LOST)));
(fxo->battery_state == BATTERY_PRESENT));
}
static inline bool is_fxo_ringing_negative(const struct fxo *const fxo)
{
return (((fxo->hook_ring_shadow & 0x60) == 0x40) &&
((fxo->battery_state == BATTERY_PRESENT) ||
(fxo->battery_state == BATTERY_DEBOUNCING_LOST)));
(fxo->battery_state == BATTERY_PRESENT));
}
static inline void set_ring(struct fxo *fxo, enum ring_detector_state new)
@@ -1859,21 +1859,19 @@ static inline void set_ring(struct fxo *fxo, enum ring_detector_state new)
static void wctdm_fxo_ring_detect(struct wctdm *wc, struct wctdm_module *mod)
{
struct fxo *const fxo = &mod->mod.fxo;
static const unsigned int POLARITY_CHANGES_NEEDED = 2;
/* Look for ring status bits (Ring Detect Signal Negative and Ring
* Detect Signal Positive) to transition back and forth
* POLARITY_CHANGES_NEEDED times to indicate that a ring is occurring.
* Provide some number of samples to allow for the transitions to occur
* before giving up. NOTE: neon mwi voltages will trigger one of these
* bits to go active but not to have transitions between the two bits
* (i.e. no negative to positive or positive to negative traversals) */
* Detect Signal Positive) to transition back and forth some number of
* times to indicate that a ring is occurring. Provide some number of
* samples to allow for the transitions to occur before giving up.
* NOTE: neon mwi voltages will trigger one of these bits to go active
* but not to have transitions between the two bits (i.e. no negative
* to positive or positive to negative traversals) */
switch (fxo->ring_state) {
case DEBOUNCING_RINGING_POSITIVE:
if (is_fxo_ringing_negative(fxo)) {
if (++fxo->ring_polarity_change_count >
POLARITY_CHANGES_NEEDED) {
if (++fxo->ring_polarity_change_count > 4) {
mod_hooksig(wc, mod, DAHDI_RXSIG_RING);
set_ring(fxo, RINGING);
if (debug) {
@@ -1891,8 +1889,7 @@ static void wctdm_fxo_ring_detect(struct wctdm *wc, struct wctdm_module *mod)
break;
case DEBOUNCING_RINGING_NEGATIVE:
if (is_fxo_ringing_positive(fxo)) {
if (++fxo->ring_polarity_change_count >
POLARITY_CHANGES_NEEDED) {
if (++fxo->ring_polarity_change_count > 4) {
mod_hooksig(wc, mod, DAHDI_RXSIG_RING);
set_ring(fxo, RINGING);
if (debug) {
@@ -1962,13 +1959,13 @@ wctdm_check_battery_lost(struct wctdm *wc, struct wctdm_module *const mod)
*/
switch (fxo->battery_state) {
case BATTERY_DEBOUNCING_PRESENT:
case BATTERY_DEBOUNCING_PRESENT_ALARM: /* intentional drop through */
/* we were going to BATTERY_PRESENT, but
* battery was lost again. */
fxo->battery_state = BATTERY_LOST;
break;
case BATTERY_UNKNOWN:
mod_hooksig(wc, mod, DAHDI_RXSIG_ONHOOK);
case BATTERY_DEBOUNCING_PRESENT_ALARM: /* intentional drop through */
case BATTERY_PRESENT:
fxo->battery_state = BATTERY_DEBOUNCING_LOST;
fxo->battdebounce_timer = wc->framecount + battdebounce;
@@ -2023,7 +2020,7 @@ wctdm_check_battery_present(struct wctdm *wc, struct wctdm_module *const mod)
switch (fxo->battery_state) {
case BATTERY_DEBOUNCING_PRESENT:
if (time_after(wc->framecount, fxo->battdebounce_timer)) {
if (time_after(jiffies, fxo->battdebounce_timer)) {
if (debug) {
dev_info(&wc->vb.pdev->dev,
"BATTERY on %d/%d (%s)!\n",
@@ -2048,12 +2045,12 @@ wctdm_check_battery_present(struct wctdm *wc, struct wctdm_module *const mod)
* of its time period has already passed while
* debouncing occurred */
fxo->battery_state = BATTERY_DEBOUNCING_PRESENT_ALARM;
fxo->battdebounce_timer = wc->framecount +
battalarm - battdebounce;
fxo->battdebounce_timer = jiffies +
msecs_to_jiffies(battalarm - battdebounce);
}
break;
case BATTERY_DEBOUNCING_PRESENT_ALARM:
if (time_after(wc->framecount, fxo->battdebounce_timer)) {
if (time_after(jiffies, fxo->battdebounce_timer)) {
fxo->battery_state = BATTERY_PRESENT;
dahdi_alarm_channel(get_dahdi_chan(wc, mod),
DAHDI_ALARM_NONE);
@@ -2062,7 +2059,6 @@ wctdm_check_battery_present(struct wctdm *wc, struct wctdm_module *const mod)
case BATTERY_PRESENT:
break;
case BATTERY_DEBOUNCING_LOST:
case BATTERY_DEBOUNCING_LOST_ALARM:
/* we were going to BATTERY_LOST, but battery appeared again,
* so clear the debounce timer */
fxo->battery_state = BATTERY_PRESENT;
@@ -2070,8 +2066,10 @@ wctdm_check_battery_present(struct wctdm *wc, struct wctdm_module *const mod)
case BATTERY_UNKNOWN:
mod_hooksig(wc, mod, DAHDI_RXSIG_OFFHOOK);
case BATTERY_LOST: /* intentional drop through */
case BATTERY_DEBOUNCING_LOST_ALARM:
fxo->battery_state = BATTERY_DEBOUNCING_PRESENT;
fxo->battdebounce_timer = wc->framecount + battdebounce;
fxo->battdebounce_timer = jiffies +
msecs_to_jiffies(battdebounce);
break;
}
}

View File

@@ -27,8 +27,6 @@
* this program for more details.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/module.h>
@@ -57,14 +55,18 @@
#error VOICEBUS_SFRAME_SIZE != SFRAME_SIZE
#endif
#ifndef pr_fmt
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#endif
static int debug;
static int j1mode = -1;
static int j1mode = 0;
static int alarmdebounce = 2500; /* LOF/LFA def to 2.5s AT&T TR54016*/
static int losalarmdebounce = 2500; /* LOS def to 2.5s AT&T TR54016*/
static int aisalarmdebounce = 2500; /* AIS(blue) def to 2.5s AT&T TR54016*/
static int yelalarmdebounce = 500; /* RAI(yellow) def to 0.5s AT&T devguide */
static int t1e1override = -1; /* deprecated */
static char *default_linemode = "auto"; /* 'auto', 'e1', 't1', or 'j1' */
static char *default_linemode = "auto"; /* 'auto', 'e1', or 't1' */
static int latency = VOICEBUS_DEFAULT_LATENCY;
static unsigned int max_latency = VOICEBUS_DEFAULT_MAXLATENCY;
static int vpmsupport = 1;
@@ -643,21 +645,21 @@ static inline int t1_setreg(struct t1 *wc, int addr, int val)
return 0;
}
static void __t1_getreg(struct t1 *wc, int addr, struct command *cmd)
static int t1_getreg(struct t1 *wc, int addr)
{
cmd->address = addr;
cmd->data = 0x00;
cmd->flags = __CMD_RD;
submit_cmd(wc, cmd);
}
static int __t1_getresult(struct t1 *wc, struct command *cmd)
{
int ret;
struct command *cmd = NULL;
unsigned long ret;
unsigned long flags;
might_sleep();
cmd = get_free_cmd(wc);
if (!cmd)
return -ENOMEM;
cmd->address = addr;
cmd->data = 0x00;
cmd->flags = __CMD_RD;
submit_cmd(wc, cmd);
ret = wait_for_completion_interruptible_timeout(&cmd->complete, HZ*10);
if (unlikely(!ret)) {
spin_lock_irqsave(&wc->reglock, flags);
@@ -688,20 +690,8 @@ static int __t1_getresult(struct t1 *wc, struct command *cmd)
}
}
ret = cmd->data;
return ret;
}
static int t1_getreg(struct t1 *wc, int addr)
{
int res;
struct command *cmd = NULL;
cmd = get_free_cmd(wc);
if (!cmd)
return -ENOMEM;
__t1_getreg(wc, addr, cmd);
res = __t1_getresult(wc, cmd);
free_cmd(wc, cmd);
return res;
return ret;
}
static void t1_setleds(struct t1 *wc, int leds)
@@ -893,8 +883,7 @@ static void t1_configure_t1(struct t1 *wc, int lineconfig, int txlevel)
fmr1 = 0x9e; /* FMR1: Mode 0, T1 mode, CRC on for ESF, 2.048 Mhz system data rate, no XAIS */
fmr2 = 0x20; /* FMR2: no payload loopback, don't auto yellow alarm */
if (!strcasecmp("j1", wc->span.spantype))
if (j1mode)
fmr4 = 0x1c;
else
fmr4 = 0x0c; /* FMR4: Lose sync on 2 out of 5 framing bits, auto resync */
@@ -934,7 +923,7 @@ static void t1_configure_t1(struct t1 *wc, int lineconfig, int txlevel)
t1_setreg(wc, 0x38, 0x0a); /* PCD: LOS after 176 consecutive "zeros" */
t1_setreg(wc, 0x39, 0x15); /* PCR: 22 "ones" clear LOS */
if (!strcasecmp("j1", wc->span.spantype))
if (j1mode)
t1_setreg(wc, 0x24, 0x80); /* J1 overide */
/* Generate pulse mask for T1 */
@@ -1195,47 +1184,15 @@ static int t1xxp_rbsbits(struct dahdi_chan *chan, int bits)
return 0;
}
static void t1_check_sigbits(struct t1 *wc)
static inline void t1_check_sigbits(struct t1 *wc)
{
struct command_container {
struct command *cmd;
struct list_head node;
unsigned int index;
};
struct command_container *cont;
LIST_HEAD(commands);
int a,i,rxs;
if (!(test_bit(DAHDI_FLAGBIT_RUNNING, &wc->span.flags)))
return;
if (dahdi_is_e1_span(&wc->span)) {
/* Send out all the commands first. */
for (i = 0; i < 15; i++) {
if (!(wc->span.chans[i+16]->sig & DAHDI_SIG_CLEAR) ||
!(wc->span.chans[i]->sig & DAHDI_SIG_CLEAR)) {
cont = kzalloc(sizeof(*cont), GFP_KERNEL);
if (!cont) {
WARN_ON_ONCE(1);
goto done;
}
cont->cmd = get_free_cmd(wc);
if (!cont->cmd) {
WARN_ON_ONCE(1);
goto done;
}
cont->index = i;
list_add_tail(&cont->node, &commands);
__t1_getreg(wc, 0x71 + i, cont->cmd);
}
}
/* Now check the results */
list_for_each_entry_reverse(cont, &commands, node) {
i = cont->index;
a = __t1_getresult(wc, cont->cmd);
free_cmd(wc, cont->cmd);
cont->cmd = NULL;
a = t1_getreg(wc, 0x71 + i);
if (a > -1) {
/* Get high channel in low bits */
rxs = (a & 0xf);
@@ -1253,29 +1210,8 @@ static void t1_check_sigbits(struct t1 *wc)
}
}
} else if (wc->span.lineconfig & DAHDI_CONFIG_D4) {
/* First we'll send out the commands */
for (i = 0; i < 24; i += 4) {
cont = kzalloc(sizeof(*cont), GFP_KERNEL);
if (!cont) {
WARN_ON_ONCE(1);
goto done;
}
cont->cmd = get_free_cmd(wc);
if (!cont->cmd) {
WARN_ON_ONCE(1);
goto done;
}
cont->index = i;
list_add_tail(&cont->node, &commands);
__t1_getreg(wc, 0x70 + (i>>2), cont->cmd);
}
/* Now we'll check the results */
list_for_each_entry_reverse(cont, &commands, node) {
i = cont->index;
a = __t1_getresult(wc, cont->cmd);
free_cmd(wc, cont->cmd);
cont->cmd = NULL;
for (i = 0; i < 24; i+=4) {
a = t1_getreg(wc, 0x70 + (i>>2));
if (a > -1) {
/* Get high channel in low bits */
rxs = (a & 0x3) << 2;
@@ -1305,28 +1241,8 @@ static void t1_check_sigbits(struct t1 *wc)
}
}
} else {
/* First send out the commands. */
for (i = 0; i < 24; i += 2) {
cont = kzalloc(sizeof(*cont), GFP_KERNEL);
if (!cont) {
WARN_ON_ONCE(1);
goto done;
}
cont->cmd = get_free_cmd(wc);
if (!cont->cmd) {
WARN_ON_ONCE(1);
goto done;
}
cont->index = i;
list_add_tail(&cont->node, &commands);
__t1_getreg(wc, 0x70 + (i>>1), cont->cmd);
}
list_for_each_entry_reverse(cont, &commands, node) {
i = cont->index;
a = __t1_getresult(wc, cont->cmd);
free_cmd(wc, cont->cmd);
cont->cmd = NULL;
for (i = 0; i < 24; i+=2) {
a = t1_getreg(wc, 0x70 + (i>>1));
if (a > -1) {
/* Get high channel in low bits */
rxs = (a & 0xf);
@@ -1344,21 +1260,6 @@ static void t1_check_sigbits(struct t1 *wc)
}
}
}
done:
while (!list_empty(&commands)) {
cont = container_of(commands.next,
struct command_container, node);
if (unlikely(cont->cmd)) {
/* We do not care about the result, let's just wait for
* the rest of the system to finish with it. */
__t1_getresult(wc, cont->cmd);
free_cmd(wc, cont->cmd);
cont->cmd = NULL;
}
list_del(&cont->node);
kfree(cont);
}
return;
}
struct maint_work_struct {
@@ -1945,32 +1846,18 @@ static int t1_software_init(struct t1 *wc, enum linemode type)
memset(chans, 0, sizeof(chans));
memset(ec, 0, sizeof(ec));
switch (type) {
case E1:
if (type == E1) {
wc->span.channels = 31;
wc->span.spantype = "E1";
wc->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_HDB3 |
DAHDI_CONFIG_CCS | DAHDI_CONFIG_CRC4;
wc->span.deflaw = DAHDI_LAW_ALAW;
break;
case T1:
} else {
wc->span.channels = 24;
wc->span.spantype = "T1";
wc->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_B8ZS |
DAHDI_CONFIG_D4 | DAHDI_CONFIG_ESF;
wc->span.deflaw = DAHDI_LAW_MULAW;
break;
case J1:
wc->span.channels = 24;
wc->span.spantype = "J1";
wc->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_B8ZS |
DAHDI_CONFIG_D4 | DAHDI_CONFIG_ESF;
wc->span.deflaw = DAHDI_LAW_MULAW;
break;
default:
spin_unlock_irqrestore(&wc->reglock, flags);
res = -EINVAL;
goto error_exit;
}
spin_unlock_irqrestore(&wc->reglock, flags);
@@ -1979,7 +1866,7 @@ static int t1_software_init(struct t1 *wc, enum linemode type)
return -ENOMEM;
t1_info(wc, "Setting up global serial parameters for %s\n",
wc->span.spantype);
(dahdi_is_e1_span(&wc->span) ? "E1" : "T1"));
t4_serial_setup(wc);
set_bit(DAHDI_FLAGBIT_RBS, &wc->span.flags);
@@ -2035,19 +1922,12 @@ static int t1xxp_set_linemode(struct dahdi_span *span, const char *linemode)
if (!strcasecmp(linemode, "t1")) {
dev_info(&wc->vb.pdev->dev,
"Changing from %s to T1 line mode.\n",
wc->span.spantype);
"Changing from E1 to T1 line mode.\n");
res = t1_software_init(wc, T1);
} else if (!strcasecmp(linemode, "e1")) {
dev_info(&wc->vb.pdev->dev,
"Changing from %s to E1 line mode.\n",
wc->span.spantype);
"Changing from T1 to E1 line mode.\n");
res = t1_software_init(wc, E1);
} else if (!strcasecmp(linemode, "j1")) {
dev_info(&wc->vb.pdev->dev,
"Changing from %s to E1 line mode.\n",
wc->span.spantype);
res = t1_software_init(wc, J1);
} else {
dev_err(&wc->vb.pdev->dev,
"'%s' is an unknown linemode.\n", linemode);
@@ -2087,15 +1967,14 @@ static int t1_hardware_post_init(struct t1 *wc, enum linemode *type)
int x;
/* T1 or E1 */
if ((-1 != t1e1override) || (-1 != j1mode)) {
*type = (t1e1override) ? E1 : (j1mode) ? J1 : T1;
if (-1 != t1e1override) {
pr_info("t1e1override is deprecated. Please use 'default_linemode'.\n");
*type = (t1e1override) ? E1 : T1;
} else {
if (!strcasecmp(default_linemode, "e1")) {
*type = E1;
} else if (!strcasecmp(default_linemode, "t1")) {
*type = T1;
} else if (!strcasecmp(default_linemode, "j1")) {
*type = J1;
} else {
u8 pins;
res = t1_getpins(wc, &pins);
@@ -2104,8 +1983,7 @@ static int t1_hardware_post_init(struct t1 *wc, enum linemode *type)
*type = (pins & 0x01) ? T1 : E1;
}
}
debug_printk(wc, 1, "linemode: %s\n", (*type == T1) ? "T1" :
(J1 == *type) ? "J1" : "E1");
debug_printk(wc, 1, "linemode: %s\n", (*type == T1) ? "T1" : "E1");
/* what version of the FALC are we using? */
reg = t1_setreg(wc, 0x4a, 0xaa);
@@ -2136,41 +2014,19 @@ static int t1_hardware_post_init(struct t1 *wc, enum linemode *type)
return 0;
}
static void t1_check_alarms(struct t1 *wc)
static inline void t1_check_alarms(struct t1 *wc)
{
unsigned char c,d;
int alarms;
int x,j;
unsigned char fmr4; /* must read this always */
struct command *cmds[3];
if (!(test_bit(DAHDI_FLAGBIT_RUNNING, &wc->span.flags)))
return;
for (x = 0; x < ARRAY_SIZE(cmds); ++x) {
cmds[x] = get_free_cmd(wc);
if (!cmds[x]) {
WARN_ON(1);
for (x = 0; x < ARRAY_SIZE(cmds); ++x)
free_cmd(wc, cmds[x]);
return;
}
}
/* Since this is voicebus, if we issue all the reads initially and then
* check the results we can save ourselves some time. Otherwise, each
* read will take a minimum of 3ms to go through the complete pipeline.
*/
__t1_getreg(wc, 0x4c, cmds[0]);
__t1_getreg(wc, 0x20, cmds[1]); /* must read this even if not used */
__t1_getreg(wc, 0x4d, cmds[2]);
d = __t1_getresult(wc, cmds[2]);
fmr4 = __t1_getresult(wc, cmds[1]);
c = __t1_getresult(wc, cmds[0]);
for (x=0; x < ARRAY_SIZE(cmds); ++x)
free_cmd(wc, cmds[x]);
c = t1_getreg(wc, 0x4c);
fmr4 = t1_getreg(wc, 0x20); /* must read this even if we don't use it */
d = t1_getreg(wc, 0x4d);
/* Assume no alarms */
alarms = 0;
@@ -2586,11 +2442,11 @@ static void timer_work_func(struct work_struct *work)
{
struct t1 *wc = container_of(work, struct t1, timer_work);
#endif
if (test_bit(INITIALIZED, &wc->bit_flags))
mod_timer(&wc->timer, jiffies + HZ/30);
t1_do_counters(wc);
t1_check_alarms(wc);
t1_check_sigbits(wc);
if (test_bit(INITIALIZED, &wc->bit_flags))
mod_timer(&wc->timer, jiffies + HZ/10);
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
@@ -3076,20 +2932,14 @@ static int __init te12xp_init(void)
if (!cmd_cache)
return -ENOMEM;
if ((-1 != t1e1override) || (-1 != j1mode)) {
pr_info("'t1e1override' and 'j1mode' are deprecated. "
"Please use 'default_linemode' instead.\n");
/* If someone is setting j1mode, then, t1e1override most likely
* needs to be forced to t1 mode */
if (j1mode > 0)
t1e1override = 0;
if (-1 != t1e1override) {
pr_info("'t1e1override' is deprecated. "
"Please use 'default_linemode' instead\n");
} else if (strcasecmp(default_linemode, "auto") &&
strcasecmp(default_linemode, "t1") &&
strcasecmp(default_linemode, "j1") &&
strcasecmp(default_linemode, "e1")) {
pr_err("'%s' is an unknown span type.\n", default_linemode);
pr_err("'%s' is an unknown span type.", default_linemode);
default_linemode = "auto";
kmem_cache_destroy(cmd_cache);
return -EINVAL;
}
res = dahdi_pci_module(&te12xp_driver);

View File

@@ -77,7 +77,6 @@
enum linemode {
T1 = 1,
E1,
J1,
};
struct command {

View File

@@ -22,7 +22,6 @@
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/kmod.h>
#include "xdefs.h"
#include "xpd.h"
#include "xpp_dahdi.h"
@@ -656,15 +655,6 @@ static void global_packet_dump(const char *msg, xpacket_t *pack)
#define MAX_PATH_STR 128
#ifndef UMH_WAIT_PROC
/*
* - UMH_WAIT_PROC was introduced as enum in 2.6.23
* with a value of 1
* - It was changed to a macro (and it's value was modified) in 3.3.0
*/
#define UMH_WAIT_PROC 1
#endif
int run_initialize_registers(xpd_t *xpd)
{
int ret;
@@ -747,7 +737,7 @@ int run_initialize_registers(xpd_t *xpd)
}
XPD_DBG(DEVICES, xpd, "running '%s' for type=%d revision=%d\n",
init_card, xpd->type, xbus->revision);
ret = call_usermodehelper(init_card, argv, envp, UMH_WAIT_PROC);
ret = call_usermodehelper(init_card, argv, envp, 1);
/*
* Carefully report results
*/

File diff suppressed because it is too large Load Diff

View File

@@ -144,14 +144,12 @@ typedef unsigned char byte;
#define SET_PROC_DIRENTRY_OWNER(p) do { } while(0);
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
/* Also don't define this for later RHEL >= 5.2. */
#if defined(RHEL_RELEASE_CODE) && defined(RHEL_RELEASE_VERSION)
#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5, 3)
typedef int bool;
#endif
#else
typedef int bool;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
/* Also don't define this for later RHEL >= 5.2 . hex_asc is from the
* same linux-2.6-net-infrastructure-updates-to-mac80211-iwl4965.patch
* as is the bool typedef. */
#if LINUX_VERSION_CODE != KERNEL_VERSION(2,6,18) || ! defined(hex_asc)
typedef int bool;
#endif
#endif
#else

View File

@@ -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
/*
@@ -1083,7 +1082,7 @@ int xpd_dahdi_postregister(xpd_t *xpd)
*/
void xpd_dahdi_preunregister(xpd_t *xpd)
{
if (!xpd || !IS_PHONEDEV(xpd))
if (!xpd)
return;
XPD_DBG(DEVICES, xpd, "\n");
update_xpd_status(xpd, DAHDI_ALARM_NOTOPEN);
@@ -1103,7 +1102,7 @@ void xpd_dahdi_preunregister(xpd_t *xpd)
void xpd_dahdi_postunregister(xpd_t *xpd)
{
if (!xpd || !IS_PHONEDEV(xpd))
if (!xpd)
return;
atomic_dec(&PHONEDEV(xpd).dahdi_registered);
atomic_dec(&num_registered_spans);

View File

@@ -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);

View File

@@ -72,7 +72,7 @@
#define DAHDI_IRQ_HANDLER(a) static irqreturn_t a(int irq, void *dev_id, struct pt_regs *regs)
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
#ifdef CONFIG_PCI
#include <linux/pci-aspm.h>
#endif
@@ -120,14 +120,6 @@
# endif
#endif
/* __dev* were removed in 3.8. They still have effect in 2.6.18. */
#ifndef __devinit
# define __devinit
# define __devinitdata
# define __devexit
# define __devexit_p(x) x
#endif
/*! Default chunk size for conferences and such -- static right now, might make
variable sometime. 8 samples = 1 ms = most frequent service interval possible
for a USB device */
@@ -1288,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));