Compare commits
26 Commits
v2.8.0-rc2
...
v2.8.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e7acd212e | ||
|
|
71c003ba49 | ||
|
|
3707ee713e | ||
|
|
f5d3b35d7b | ||
|
|
6bcc70a421 | ||
|
|
d389f9f743 | ||
|
|
0faac26dde | ||
|
|
d803fad133 | ||
|
|
acfec5dfbb | ||
|
|
5ec9d756aa | ||
|
|
4bfdd8bea5 | ||
|
|
c0d52a04cb | ||
|
|
1cf7d9b08c | ||
|
|
3a0905b1ec | ||
|
|
4a75f58156 | ||
|
|
2b20289cb7 | ||
|
|
dd944f3362 | ||
|
|
d8fe2af23d | ||
|
|
35e9924b3c | ||
|
|
a9c85de700 | ||
|
|
7a822db82c | ||
|
|
007ff90025 | ||
|
|
be25fdb6fa | ||
|
|
06daf6c270 | ||
|
|
1672e07deb | ||
|
|
7b578b83b9 |
9
.gitignore
vendored
9
.gitignore
vendored
@@ -5,6 +5,7 @@
|
||||
*.mod
|
||||
*.mod.[oc]
|
||||
*.ko
|
||||
*.ko.unsigned
|
||||
*.cmd
|
||||
*.order
|
||||
*.tar.gz
|
||||
@@ -38,4 +39,12 @@ 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/dahdi-fw-a4a.bin
|
||||
drivers/dahdi/firmware/dahdi-fw-a4b.bin
|
||||
drivers/dahdi/firmware/dahdi-fw-a8a.bin
|
||||
drivers/dahdi/firmware/dahdi-fw-a8b.bin
|
||||
drivers/dahdi/firmware/dahdi-fw-oct6114-032.bin
|
||||
drivers/dahdi/firmware/dahdi-fw-te133.bin
|
||||
drivers/dahdi/firmware/dahdi-fw-te134.bin
|
||||
drivers/dahdi/firmware/dahdi-fw-te435.bin
|
||||
drivers/dahdi/firmware/make_firmware_object
|
||||
|
||||
19
Makefile
19
Makefile
@@ -47,8 +47,6 @@ ifeq (yes,$(HAS_KSRC))
|
||||
HOTPLUG_FIRMWARE:=$(shell if grep -q '^CONFIG_FW_LOADER=[ym]' $(KCONFIG); then echo "yes"; else echo "no"; fi)
|
||||
endif
|
||||
|
||||
UDEV_DIR:=/etc/udev/rules.d
|
||||
|
||||
MODULE_ALIASES:=wcfxs wctdm8xxp wct2xxp
|
||||
|
||||
INST_HEADERS:=kernel.h user.h fasthdlc.h wctdm_user.h dahdi_config.h
|
||||
@@ -87,7 +85,7 @@ prereq: include/dahdi/version.h firmware-loaders
|
||||
stackcheck: $(CHECKSTACK) modules
|
||||
objdump -d drivers/dahdi/*.ko drivers/dahdi/*/*.ko | $(CHECKSTACK)
|
||||
|
||||
install: all install-modules install-devices install-include install-firmware install-xpp-firm
|
||||
install: all install-modules install-include install-firmware install-xpp-firm
|
||||
@echo "###################################################"
|
||||
@echo "###"
|
||||
@echo "### DAHDI installed successfully."
|
||||
@@ -96,7 +94,7 @@ install: all install-modules install-devices install-include install-firmware in
|
||||
@echo "###"
|
||||
@echo "###################################################"
|
||||
|
||||
uninstall: uninstall-modules uninstall-devices uninstall-include uninstall-firmware
|
||||
uninstall: uninstall-modules uninstall-include uninstall-firmware
|
||||
|
||||
install-modconf:
|
||||
build_tools/genmodconf $(BUILDVER) "$(ROOT_PREFIX)" "$(filter-out dahdi dahdi_dummy xpp dahdi_transcode dahdi_dynamic,$(BUILD_MODULES)) $(MODULE_ALIASES)"
|
||||
@@ -130,14 +128,6 @@ uninstall-include:
|
||||
done
|
||||
-rmdir $(DESTDIR)/usr/include/dahdi
|
||||
|
||||
install-devices:
|
||||
install -d $(DESTDIR)$(UDEV_DIR)
|
||||
build_tools/genudevrules > $(DESTDIR)$(UDEV_DIR)/dahdi.rules
|
||||
install -m 644 drivers/dahdi/xpp/xpp.rules $(DESTDIR)$(UDEV_DIR)/
|
||||
|
||||
uninstall-devices:
|
||||
rm -f $(DESTDIR)$(UDEV_DIR)/dahdi.rules
|
||||
|
||||
install-modules: modules
|
||||
ifndef DESTDIR
|
||||
@if modinfo zaptel > /dev/null 2>&1; then \
|
||||
@@ -179,6 +169,9 @@ update:
|
||||
echo "Not under version control"; \
|
||||
fi
|
||||
|
||||
dist:
|
||||
@./build_tools/make_dist "dahdi-linux" "$(DAHDIVERSION)"
|
||||
|
||||
clean:
|
||||
ifneq (no,$(HAS_KSRC))
|
||||
$(KMAKE) clean
|
||||
@@ -208,6 +201,6 @@ README.html: README
|
||||
dahdi-api.html: drivers/dahdi/dahdi-base.c
|
||||
build_tools/kernel-doc --kernel $(KSRC) $^ >$@
|
||||
|
||||
.PHONY: distclean dist-clean clean all install devices modules stackcheck install-udev update install-modules install-include uninstall-modules firmware-download install-xpp-firm firmware-loaders
|
||||
.PHONY: distclean dist-clean clean all install devices modules stackcheck install-udev update install-modules install-include uninstall-modules firmware-download install-xpp-firm firmware-loaders dist
|
||||
|
||||
FORCE:
|
||||
|
||||
17
README
17
README
@@ -534,10 +534,19 @@ DAHDI hardware. However if you have such systems, automatic
|
||||
registration can cause the order of spans to be unpredictable.
|
||||
The standard startup scripts use 'dahdi_registration on' instead of this.
|
||||
|
||||
==== tools_rootdir
|
||||
(xpp)
|
||||
|
||||
Defaults to /. Passed (as the variable DAHDI_TOOLS_ROOTDIR) to generated
|
||||
events (which can be used in udev hooks). Also serves as the base of
|
||||
the variable DAHDI_INIT_DIR (by default: $DAHDI_TOOLS_DIR/usr/share/dahdi).
|
||||
|
||||
==== initdir
|
||||
(xpp)
|
||||
|
||||
This is the directory containing the initialization scripts.
|
||||
Deprecated. Setting both initdir and tools_rootdir will generate an error.
|
||||
|
||||
A directory under tools_rootdir containing the initialization scripts.
|
||||
The default is /usr/share/dahdi .
|
||||
Setting this value could be useful if that location is inconvenient for you.
|
||||
|
||||
@@ -980,6 +989,12 @@ A very short type string.
|
||||
===== /sys/bus/dahdi_spans/devices/span-N/syncsrc
|
||||
Current sync source.
|
||||
|
||||
==== sys/bus/dahdi_spans/drivers/generic_lowlevel/master_span
|
||||
All spans in the bus are handled by a single driver. The driver has one
|
||||
non-standard attribute: master_span. printing it shows the current DAHDI
|
||||
master span writing a number to it forces setting this span as the master
|
||||
span.
|
||||
|
||||
|
||||
Channels Bus
|
||||
^^^^^^^^^^^^
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
ver=`udevinfo -V | cut -f3 -d" "`
|
||||
|
||||
if [ -z "${ver}" ]; then
|
||||
# Not found - try udevadm
|
||||
ver=`udevadm info -V | cut -f3 -d" "`
|
||||
|
||||
if [ -z "${ver}" ]; then
|
||||
# nobody has that old version, anyway.
|
||||
ver=54
|
||||
fi
|
||||
fi
|
||||
|
||||
# udev versions prior to 055 use a single '=' for matching key values
|
||||
# udev versions 055 and later support '==' for that purpose, and versions
|
||||
# beyond 092 will probably make it mandatory
|
||||
#
|
||||
# very old versions of udev required naming rules and permissions rules to be
|
||||
# in separate files, but it's not clear at what version number that changed
|
||||
|
||||
if [ ${ver} -gt 54 ]; then
|
||||
match="=="
|
||||
else
|
||||
match="="
|
||||
fi
|
||||
|
||||
cat <<EOF
|
||||
# udev rules to generate the /dev/dahdi device files (if not yet provided
|
||||
# by your distribution):
|
||||
KERNEL${match}"dahdictl", NAME="dahdi/ctl"
|
||||
KERNEL${match}"dahditranscode", NAME="dahdi/transcode"
|
||||
KERNEL${match}"dahditimer", NAME="dahdi/timer"
|
||||
KERNEL${match}"dahdichannel", NAME="dahdi/channel"
|
||||
KERNEL${match}"dahdipseudo", NAME="dahdi/pseudo"
|
||||
KERNEL${match}"dahdi[0-9]*", NAME="dahdi/%n"
|
||||
|
||||
# DAHDI devices with ownership/permissions for running as non-root
|
||||
SUBSYSTEM${match}"dahdi", OWNER="asterisk", GROUP="asterisk", MODE="0660"
|
||||
EOF
|
||||
@@ -61,7 +61,7 @@ export ASTRIBANK_HEXLOAD
|
||||
|
||||
# make sure Astribank initialization scripts are from our tree.
|
||||
xpp_ARGS="$xpp_ARGS initdir=$FIRMWARE_DIR"
|
||||
#dahdi_ARGS="$dahdi_ARGS initdir=$FIRMWARE_DIR"
|
||||
dahdi_ARGS="$dahdi_ARGS tools_rootdir=$DESTDIR"
|
||||
|
||||
if [ "$DYNAMIC_LOC" = 'yes' ]; then
|
||||
MODULES_LOAD="$MODULES_LOAD dahdi_dynamic dahdi_dynamic_loc"
|
||||
|
||||
26
build_tools/make_dist
Executable file
26
build_tools/make_dist
Executable file
@@ -0,0 +1,26 @@
|
||||
#! /bin/sh
|
||||
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo >&2 "Usage: $0 <package> <version>"
|
||||
exit 1
|
||||
fi
|
||||
package="$1"
|
||||
version="$2"
|
||||
tarball_prefix="$package-$version"
|
||||
echo "I: Making dist tarball for $tarball_prefix"
|
||||
tarball_name="$tarball_prefix.tar.gz"
|
||||
|
||||
tmp_work_dir=".tmp"
|
||||
tmp_version_dir="$tmp_work_dir/$tarball_prefix"
|
||||
|
||||
if [ "$DESTDIR" != '' ]; then
|
||||
destdir="$DESTDIR/"
|
||||
fi
|
||||
output="$destdir$tarball_name"
|
||||
|
||||
mkdir -p "$tmp_version_dir"
|
||||
git archive --format tar HEAD | tar xf - -C "$tmp_version_dir"
|
||||
echo "$version" > "$tmp_version_dir/.version"
|
||||
tar czf "$output" -C "$tmp_work_dir" "$tarball_prefix"
|
||||
rm -rf "$tmp_work_dir"
|
||||
echo "I: tarball is ready: '$output'"
|
||||
@@ -173,7 +173,7 @@ static sumtype *conf_sums_next;
|
||||
static sumtype *conf_sums;
|
||||
static sumtype *conf_sums_prev;
|
||||
|
||||
static struct dahdi_span *master;
|
||||
static struct dahdi_span *master_span;
|
||||
struct file_operations *dahdi_transcode_fops = NULL;
|
||||
|
||||
|
||||
@@ -611,7 +611,7 @@ void dahdi_unregister_echocan_factory(const struct dahdi_echocan_factory *ec)
|
||||
/* Is this span our syncronization master? */
|
||||
int dahdi_is_sync_master(const struct dahdi_span *span)
|
||||
{
|
||||
return span == master;
|
||||
return span == master_span;
|
||||
}
|
||||
|
||||
static inline void rotate_sums(void)
|
||||
@@ -732,6 +732,8 @@ enum spantypes dahdi_str2spantype(const char *name)
|
||||
return SPANTYPE_DIGITAL_BRI_TE;
|
||||
else if (strcasecmp("BRI_SOFT", name) == 0)
|
||||
return SPANTYPE_DIGITAL_BRI_SOFT;
|
||||
else if (strcasecmp("DYNAMIC", name) == 0)
|
||||
return SPANTYPE_DIGITAL_DYNAMIC;
|
||||
else
|
||||
return SPANTYPE_INVALID;
|
||||
}
|
||||
@@ -749,6 +751,7 @@ const char *dahdi_spantype2str(enum spantypes st)
|
||||
case SPANTYPE_DIGITAL_BRI_NT: return "BRI_NT";
|
||||
case SPANTYPE_DIGITAL_BRI_TE: return "BRI_TE";
|
||||
case SPANTYPE_DIGITAL_BRI_SOFT: return "BRI_SOFT";
|
||||
case SPANTYPE_DIGITAL_DYNAMIC: return "DYNAMIC";
|
||||
default:
|
||||
case SPANTYPE_INVALID: return "INVALID";
|
||||
};
|
||||
@@ -3840,6 +3843,31 @@ void dahdi_alarm_channel(struct dahdi_chan *chan, int alarms)
|
||||
spin_unlock_irqrestore(&chan->lock, flags);
|
||||
}
|
||||
|
||||
struct dahdi_span *get_master_span(void)
|
||||
{
|
||||
return master_span;
|
||||
}
|
||||
|
||||
void set_master_span(int spanno)
|
||||
{
|
||||
struct dahdi_span *s;
|
||||
unsigned long flags;
|
||||
struct dahdi_span *old_master;
|
||||
|
||||
spin_lock_irqsave(&chan_lock, flags);
|
||||
old_master = master_span;
|
||||
list_for_each_entry(s, &span_list, spans_node) {
|
||||
if (spanno == s->spanno) {
|
||||
master_span = s;
|
||||
break;
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&chan_lock, flags);
|
||||
if ((debug & DEBUG_MAIN) && (old_master != master_span))
|
||||
module_printk(KERN_NOTICE, "Master span is set to %d (%s)\n",
|
||||
master_span->spanno, master_span->name);
|
||||
}
|
||||
|
||||
static void __dahdi_find_master_span(void)
|
||||
{
|
||||
struct dahdi_span *s;
|
||||
@@ -3847,7 +3875,7 @@ static void __dahdi_find_master_span(void)
|
||||
struct dahdi_span *old_master;
|
||||
|
||||
spin_lock_irqsave(&chan_lock, flags);
|
||||
old_master = master;
|
||||
old_master = master_span;
|
||||
list_for_each_entry(s, &span_list, spans_node) {
|
||||
if (s->alarms && old_master)
|
||||
continue;
|
||||
@@ -3857,15 +3885,15 @@ static void __dahdi_find_master_span(void)
|
||||
continue;
|
||||
if (!can_provide_timing(s))
|
||||
continue;
|
||||
if (master == s)
|
||||
if (master_span == s)
|
||||
continue;
|
||||
|
||||
master = s;
|
||||
master_span = s;
|
||||
break;
|
||||
}
|
||||
spin_unlock_irqrestore(&chan_lock, flags);
|
||||
|
||||
if ((debug & DEBUG_MAIN) && (old_master != master))
|
||||
if ((debug & DEBUG_MAIN) && (old_master != master_span))
|
||||
module_printk(KERN_NOTICE, "Master changed to %s\n", s->name);
|
||||
}
|
||||
|
||||
@@ -3906,7 +3934,7 @@ void dahdi_alarm_notify(struct dahdi_span *span)
|
||||
dahdi_alarm_channel(span->chans[x], span->alarms);
|
||||
|
||||
/* If we're going into or out of alarm we should try to find a
|
||||
* new master that may be a better fit. */
|
||||
* new master_span that may be a better fit. */
|
||||
dahdi_find_master_span();
|
||||
|
||||
/* Report more detailed alarms */
|
||||
@@ -5136,7 +5164,7 @@ static int dahdi_ioctl_startup(struct file *file, unsigned long data)
|
||||
}
|
||||
|
||||
/* Now that this span is running, it might be selected as the
|
||||
* master span */
|
||||
* master_span */
|
||||
__dahdi_find_master_span();
|
||||
}
|
||||
put_span(s);
|
||||
@@ -7208,7 +7236,7 @@ EXPORT_SYMBOL(dahdi_init_span);
|
||||
* @spanno: The span number we would like assigned. If 0, the first
|
||||
* available spanno/basechan will be used.
|
||||
* @basechan: The base channel number we would like. Ignored if spanno is 0.
|
||||
* @prefmaster: will the new span be preferred as a master?
|
||||
* @prefmaster: will the new span be preferred as a master_span?
|
||||
*
|
||||
* Assigns a span for usage with DAHDI. All the channel numbers in it will
|
||||
* have their numbering started at basechan.
|
||||
@@ -7486,8 +7514,8 @@ static int _dahdi_unassign_span(struct dahdi_span *span)
|
||||
for (x=0;x<span->channels;x++)
|
||||
dahdi_chan_unreg(span->chans[x]);
|
||||
|
||||
new_master = master; /* FIXME: locking */
|
||||
if (master == span)
|
||||
new_master = master_span; /* FIXME: locking */
|
||||
if (master_span == span)
|
||||
new_master = NULL;
|
||||
|
||||
spin_lock_irqsave(&chan_lock, flags);
|
||||
@@ -7498,13 +7526,13 @@ static int _dahdi_unassign_span(struct dahdi_span *span)
|
||||
break;
|
||||
}
|
||||
spin_unlock_irqrestore(&chan_lock, flags);
|
||||
if (master != new_master) {
|
||||
if (master_span != new_master) {
|
||||
if (debug & DEBUG_MAIN) {
|
||||
module_printk(KERN_NOTICE, "%s: Span ('%s') is new master\n", __FUNCTION__,
|
||||
(new_master)? new_master->name: "no master");
|
||||
}
|
||||
}
|
||||
master = new_master;
|
||||
master_span = new_master;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,15 @@
|
||||
#include "dahdi-sysfs.h"
|
||||
|
||||
|
||||
static char *initdir = "/usr/share/dahdi";
|
||||
module_param(initdir, charp, 0644);
|
||||
static char *initdir;
|
||||
module_param(initdir, charp, 0444);
|
||||
MODULE_PARM_DESC(initdir,
|
||||
"deprecated, should use <tools_rootdir>/usr/share/dahdi");
|
||||
|
||||
static char *tools_rootdir;
|
||||
module_param(tools_rootdir, charp, 0444);
|
||||
MODULE_PARM_DESC(tools_rootdir,
|
||||
"root directory of all tools paths (default /)");
|
||||
|
||||
static int span_match(struct device *dev, struct device_driver *driver)
|
||||
{
|
||||
@@ -47,7 +54,9 @@ static inline struct dahdi_span *dev_to_span(struct device *dev)
|
||||
|
||||
#define SPAN_VAR_BLOCK \
|
||||
do { \
|
||||
DAHDI_ADD_UEVENT_VAR("DAHDI_INIT_DIR=%s", initdir); \
|
||||
DAHDI_ADD_UEVENT_VAR("DAHDI_TOOLS_ROOTDIR=%s", tools_rootdir); \
|
||||
DAHDI_ADD_UEVENT_VAR("DAHDI_INIT_DIR=%s/%s", tools_rootdir, \
|
||||
initdir); \
|
||||
DAHDI_ADD_UEVENT_VAR("SPAN_NUM=%d", span->spanno); \
|
||||
DAHDI_ADD_UEVENT_VAR("SPAN_NAME=%s", span->name); \
|
||||
} while (0)
|
||||
@@ -222,16 +231,51 @@ static struct device_attribute span_dev_attrs[] = {
|
||||
__ATTR_NULL,
|
||||
};
|
||||
|
||||
static ssize_t master_span_show(struct device_driver *driver, char *buf)
|
||||
{
|
||||
struct dahdi_span *s = get_master_span();
|
||||
|
||||
return snprintf(buf, PAGE_SIZE, "%d\n", (s) ? s->spanno : 0);
|
||||
}
|
||||
|
||||
static ssize_t master_span_store(struct device_driver *driver, const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
int spanno;
|
||||
|
||||
if (sscanf(buf, "%d", &spanno) != 1) {
|
||||
module_printk(KERN_ERR, "non-numeric input '%s'\n", buf);
|
||||
return -EINVAL;
|
||||
}
|
||||
set_master_span(spanno);
|
||||
return count;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
|
||||
static struct driver_attribute dahdi_attrs[] = {
|
||||
__ATTR(master_span, S_IRUGO | S_IWUSR, master_span_show,
|
||||
master_span_store),
|
||||
__ATTR_NULL,
|
||||
};
|
||||
#else
|
||||
static DRIVER_ATTR_RW(master_span);
|
||||
static struct attribute *dahdi_attrs[] = {
|
||||
&driver_attr_master_span.attr,
|
||||
NULL,
|
||||
};
|
||||
ATTRIBUTE_GROUPS(dahdi);
|
||||
#endif
|
||||
|
||||
static struct bus_type spans_bus_type = {
|
||||
.name = "dahdi_spans",
|
||||
.match = span_match,
|
||||
.uevent = span_uevent,
|
||||
.dev_attrs = span_dev_attrs,
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
|
||||
.drv_attrs = dahdi_attrs,
|
||||
#else
|
||||
.drv_groups = dahdi_groups,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int span_probe(struct device *dev)
|
||||
@@ -296,6 +340,7 @@ void span_sysfs_remove(struct dahdi_span *span)
|
||||
|
||||
get_device(span_device);
|
||||
span_uevent_send(span, KOBJ_OFFLINE);
|
||||
sysfs_remove_link(&span_device->kobj, "ddev");
|
||||
device_unregister(span->span_device);
|
||||
dev_set_drvdata(span_device, NULL);
|
||||
span_device->parent = NULL;
|
||||
@@ -336,6 +381,15 @@ int span_sysfs_create(struct dahdi_span *span)
|
||||
span->span_device = NULL;
|
||||
goto cleanup;
|
||||
}
|
||||
res = sysfs_create_link(&span_device->kobj, &span_device->parent->kobj,
|
||||
"ddev");
|
||||
if (res) {
|
||||
span_err(span, "%s: sysfs_create_link failed: %d\n", __func__,
|
||||
res);
|
||||
kfree(span->span_device);
|
||||
span->span_device = NULL;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
for (x = 0; x < span->channels; x++) {
|
||||
res = chan_sysfs_create(span->chans[x]);
|
||||
@@ -362,6 +416,71 @@ static inline struct dahdi_device *to_ddev(struct device *dev)
|
||||
return container_of(dev, struct dahdi_device, dev);
|
||||
}
|
||||
|
||||
#define DEVICE_VAR_BLOCK \
|
||||
do { \
|
||||
DAHDI_ADD_UEVENT_VAR("DAHDI_TOOLS_ROOTDIR=%s", tools_rootdir); \
|
||||
DAHDI_ADD_UEVENT_VAR("DAHDI_INIT_DIR=%s/%s", tools_rootdir, \
|
||||
initdir); \
|
||||
DAHDI_ADD_UEVENT_VAR("DAHDI_DEVICE_HWID=%s", \
|
||||
ddev->hardware_id); \
|
||||
DAHDI_ADD_UEVENT_VAR("DAHDI_DEVICE_LOCATION=%s", \
|
||||
ddev->location); \
|
||||
} while (0)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
|
||||
#define DAHDI_ADD_UEVENT_VAR(fmt, val...) \
|
||||
do { \
|
||||
int err = add_uevent_var(envp, num_envp, &i, \
|
||||
buffer, buffer_size, &len, \
|
||||
fmt, val); \
|
||||
if (err) \
|
||||
return err; \
|
||||
} while (0)
|
||||
|
||||
static int device_uevent(struct device *dev, char **envp, int num_envp,
|
||||
char *buffer, int buffer_size)
|
||||
{
|
||||
struct dahdi_device *ddev;
|
||||
int i = 0;
|
||||
int len = 0;
|
||||
|
||||
if (!dev)
|
||||
return -ENODEV;
|
||||
|
||||
ddev = to_ddev(dev);
|
||||
if (!ddev)
|
||||
return -ENODEV;
|
||||
|
||||
dahdi_dbg(GENERAL, "SYFS dev_name=%s\n", dev_name(dev));
|
||||
DEVICE_VAR_BLOCK;
|
||||
envp[i] = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
#define DAHDI_ADD_UEVENT_VAR(fmt, val...) \
|
||||
do { \
|
||||
int err = add_uevent_var(kenv, fmt, val); \
|
||||
if (err) \
|
||||
return err; \
|
||||
} while (0)
|
||||
|
||||
static int device_uevent(struct device *dev, struct kobj_uevent_env *kenv)
|
||||
{
|
||||
struct dahdi_device *ddev;
|
||||
|
||||
if (!dev)
|
||||
return -ENODEV;
|
||||
ddev = to_ddev(dev);
|
||||
if (!ddev)
|
||||
return -ENODEV;
|
||||
dahdi_dbg(GENERAL, "SYFS dev_name=%s\n", dev_name(dev));
|
||||
DEVICE_VAR_BLOCK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static ssize_t
|
||||
dahdi_device_manufacturer_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
@@ -570,6 +689,7 @@ static struct device_attribute dahdi_device_attrs[] = {
|
||||
|
||||
static struct bus_type dahdi_device_bus = {
|
||||
.name = "dahdi_devices",
|
||||
.uevent = device_uevent,
|
||||
.dev_attrs = dahdi_device_attrs,
|
||||
};
|
||||
|
||||
@@ -650,6 +770,19 @@ int __init dahdi_sysfs_init(const struct file_operations *dahdi_fops)
|
||||
int res = 0;
|
||||
|
||||
dahdi_dbg(DEVICES, "Registering DAHDI device bus\n");
|
||||
|
||||
/* Handle dahdi-tools paths (for udev environment) */
|
||||
if (tools_rootdir && initdir) {
|
||||
dahdi_err("Cannot use tools-rootdir and initdir parameters simultaneously\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (initdir)
|
||||
pr_notice("dahdi: initdir is depracated -- prefer using \"tools_rootdir\" parameter\n");
|
||||
else
|
||||
initdir = "/usr/share/dahdi";
|
||||
if (!tools_rootdir)
|
||||
tools_rootdir = "";
|
||||
|
||||
res = bus_register(&dahdi_device_bus);
|
||||
if (res)
|
||||
return res;
|
||||
|
||||
@@ -630,6 +630,10 @@ static int _create_dynamic(struct dahdi_dynamic_span *dds)
|
||||
d->span.deflaw = DAHDI_LAW_MULAW;
|
||||
d->span.flags |= DAHDI_FLAG_RBS;
|
||||
d->span.chans = d->chans;
|
||||
d->span.spantype = SPANTYPE_DIGITAL_DYNAMIC;
|
||||
d->span.linecompat = DAHDI_CONFIG_D4 | DAHDI_CONFIG_ESF |
|
||||
DAHDI_CONFIG_AMI | DAHDI_CONFIG_B8ZS | DAHDI_CONFIG_CCS |
|
||||
DAHDI_CONFIG_HDB3 | DAHDI_CONFIG_CRC4 | DAHDI_CONFIG_NOTOPEN;
|
||||
d->span.ops = &dynamic_ops;
|
||||
for (x = 0; x < d->span.channels; x++) {
|
||||
sprintf(d->chans[x]->name, "DYN/%s/%s/%d",
|
||||
|
||||
@@ -33,7 +33,7 @@ VPMOCT032_VERSION:=1.12.0
|
||||
WCT820_VERSION:=1.76
|
||||
TE133_VERSION:=6f0017
|
||||
TE134_VERSION:=6f0017
|
||||
TE435_VERSION:=d0017
|
||||
TE435_VERSION:=e0017
|
||||
A8A_VERSION:=1d0017
|
||||
A8B_VERSION:=1d0017
|
||||
A4A_VERSION:=a0017
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <dahdi/kernel.h>
|
||||
|
||||
#include "oct612x.h"
|
||||
|
||||
UINT32 Oct6100UserGetTime(tPOCT6100_GET_TIME f_pTime)
|
||||
@@ -176,6 +178,23 @@ EXPORT_SYMBOL(Oct6100ChannelOpen);
|
||||
EXPORT_SYMBOL(Oct6100ChannelOpenDef);
|
||||
EXPORT_SYMBOL(Oct6100ChannelModifyDef);
|
||||
|
||||
static int __init oct612x_module_init(void)
|
||||
{
|
||||
/* This registration with dahdi.ko will fail since the span is not
|
||||
* defined, but it will make sure that this module is a dependency of
|
||||
* dahdi.ko, so that when it is being unloded, this module will be
|
||||
* unloaded as well. */
|
||||
dahdi_register_device(NULL, NULL);
|
||||
return 0;
|
||||
}
|
||||
module_init(oct612x_module_init);
|
||||
|
||||
static void __exit oct612x_module_cleanup(void)
|
||||
{
|
||||
/* Nothing to do */;
|
||||
}
|
||||
module_exit(oct612x_module_cleanup);
|
||||
|
||||
MODULE_AUTHOR("Digium Incorporated <support@digium.com>");
|
||||
MODULE_DESCRIPTION("Octasic OCT6100 Hardware Echocan Library");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -3606,6 +3606,10 @@ static bool check_for_single_fxs(struct wcaxx *wc, unsigned int port)
|
||||
result = wcaxx_init_fxs_port(wc, mod);
|
||||
if (!result)
|
||||
mod->type = NONE;
|
||||
|
||||
/* It is currently unclear why this read is necessary for some of the
|
||||
* S100M modules to properly function. */
|
||||
wcaxx_getreg(wc, mod, 0x00);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -4384,32 +4384,6 @@ wctdm_chanconfig(struct file *file, struct dahdi_chan *chan, int sigtype)
|
||||
return wctdm_wait_for_ready(wc);
|
||||
}
|
||||
|
||||
/*
|
||||
* wctdm24xxp_assigned - Called when span is assigned.
|
||||
* @span: The span that is now assigned.
|
||||
*
|
||||
* This function is called by the core of DAHDI after the span number and
|
||||
* channel numbers have been assigned.
|
||||
*
|
||||
*/
|
||||
static void wctdm24xxp_assigned(struct dahdi_span *span)
|
||||
{
|
||||
struct dahdi_span *s;
|
||||
struct dahdi_device *ddev = span->parent;
|
||||
struct wctdm *wc = NULL;
|
||||
|
||||
list_for_each_entry(s, &ddev->spans, device_node) {
|
||||
wc = (container_of(s, struct wctdm_span, span))->wc;
|
||||
if (!test_bit(DAHDI_FLAGBIT_REGISTERED, &s->flags))
|
||||
return;
|
||||
}
|
||||
|
||||
if (wc) {
|
||||
WARN_ON(0 == wc->not_ready);
|
||||
--wc->not_ready;
|
||||
}
|
||||
}
|
||||
|
||||
static const struct dahdi_span_ops wctdm24xxp_analog_span_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
.hooksig = wctdm_hooksig,
|
||||
@@ -4419,7 +4393,6 @@ static const struct dahdi_span_ops wctdm24xxp_analog_span_ops = {
|
||||
.watchdog = wctdm_watchdog,
|
||||
.chanconfig = wctdm_chanconfig,
|
||||
.dacs = wctdm_dacs,
|
||||
.assigned = wctdm24xxp_assigned,
|
||||
#ifdef VPM_SUPPORT
|
||||
.enable_hw_preechocan = wctdm_enable_hw_preechocan,
|
||||
.disable_hw_preechocan = wctdm_disable_hw_preechocan,
|
||||
@@ -4438,7 +4411,6 @@ static const struct dahdi_span_ops wctdm24xxp_digital_span_ops = {
|
||||
.spanconfig = b400m_spanconfig,
|
||||
.chanconfig = b400m_chanconfig,
|
||||
.dacs = wctdm_dacs,
|
||||
.assigned = wctdm24xxp_assigned,
|
||||
#ifdef VPM_SUPPORT
|
||||
.enable_hw_preechocan = wctdm_enable_hw_preechocan,
|
||||
.disable_hw_preechocan = wctdm_disable_hw_preechocan,
|
||||
@@ -5951,6 +5923,9 @@ __wctdm_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
return -1;
|
||||
}
|
||||
|
||||
WARN_ON(wc->not_ready <= 0);
|
||||
--wc->not_ready;
|
||||
|
||||
dev_info(&wc->vb.pdev->dev,
|
||||
"Found a %s: %s (%d BRI spans, %d analog %s)\n",
|
||||
(is_hx8(wc)) ? "Hybrid card" : "Wildcard TDM",
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "wcxb_flash.h"
|
||||
|
||||
static const char *TE435_FW_FILENAME = "dahdi-fw-te435.bin";
|
||||
static const u32 TE435_VERSION = 0xd0017;
|
||||
static const u32 TE435_VERSION = 0xe0017;
|
||||
|
||||
/* #define RPC_RCLK */
|
||||
#define VPM_SUPPORT
|
||||
|
||||
@@ -122,11 +122,15 @@ struct wcxb_meta_desc {
|
||||
|
||||
static inline bool wcxb_is_pcie(const struct wcxb *xb)
|
||||
{
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 33)
|
||||
return pci_is_pcie(xb->pdev);
|
||||
#else
|
||||
#ifndef WCXB_PCI_DEV_DOES_NOT_HAVE_IS_PCIE
|
||||
return (xb->pdev->is_pcie > 0);
|
||||
#else
|
||||
return (xb->flags.is_pcie > 0);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static const unsigned int CLK_SRC_MASK = ((1 << 13) | (1 << 12) | (1 << 1));
|
||||
|
||||
@@ -291,14 +291,18 @@ _wcxb_spi_next_transfer(struct wcxb_spi_transfer *t)
|
||||
*/
|
||||
void wcxb_spi_handle_interrupt(struct wcxb_spi_master *master)
|
||||
{
|
||||
struct wcxb_spi_message *msg = master->cur_msg;
|
||||
struct wcxb_spi_transfer *t = master->cur_transfer;
|
||||
struct wcxb_spi_message *msg;
|
||||
struct wcxb_spi_transfer *t;
|
||||
void (*complete)(void *arg) = NULL;
|
||||
unsigned long flags;
|
||||
|
||||
/* Check if we're not in the middle of a transfer, or not finished with
|
||||
* a part of one. */
|
||||
spin_lock_irqsave(&master->lock, flags);
|
||||
|
||||
t = master->cur_transfer;
|
||||
msg = master->cur_msg;
|
||||
|
||||
if (!msg || !is_txfifo_empty(master))
|
||||
goto done;
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ static DEF_PARM(uint, command_queue_length, 1500, 0444,
|
||||
static DEF_PARM(uint, poll_timeout, 1000, 0644,
|
||||
"Timeout (in jiffies) waiting for units to reply");
|
||||
static DEF_PARM_BOOL(rx_tasklet, 0, 0644, "Use receive tasklets");
|
||||
static DEF_PARM_BOOL(dahdi_autoreg, 0, 0644,
|
||||
static DEF_PARM_BOOL(dahdi_autoreg, 1, 0644,
|
||||
"Register devices automatically (1) or not (0)");
|
||||
|
||||
#ifdef CONFIG_PROC_FS
|
||||
|
||||
@@ -55,10 +55,19 @@ static ssize_t sync_store(struct device_driver *driver, const char *buf,
|
||||
return exec_sync_command(buf, count);
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
|
||||
static struct driver_attribute xpp_attrs[] = {
|
||||
__ATTR(sync, S_IRUGO | S_IWUSR, sync_show, sync_store),
|
||||
__ATTR_NULL,
|
||||
};
|
||||
#else
|
||||
static DRIVER_ATTR_RW(sync);
|
||||
static struct attribute *xpp_attrs[] = {
|
||||
&driver_attr_sync.attr,
|
||||
NULL,
|
||||
};
|
||||
ATTRIBUTE_GROUPS(xpp);
|
||||
#endif
|
||||
|
||||
/*--------- Sysfs Bus handling ----*/
|
||||
static DEVICE_ATTR_READER(xbus_state_show, dev, buf)
|
||||
@@ -410,7 +419,11 @@ static struct bus_type toplevel_bus_type = {
|
||||
.match = astribank_match,
|
||||
.uevent = astribank_uevent,
|
||||
.dev_attrs = xbus_dev_attrs,
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
|
||||
.drv_attrs = xpp_attrs,
|
||||
#else
|
||||
.drv_groups = xpp_groups,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int astribank_probe(struct device *dev)
|
||||
@@ -604,7 +617,7 @@ static DEVICE_ATTR_WRITER(span_store, dev, buf, count)
|
||||
return -EINVAL;
|
||||
if (!XBUS_IS(xpd->xbus, READY))
|
||||
return -ENODEV;
|
||||
XPD_DBG(DEVICES, xpd, "%s -- deprecated (should use pinned-spans)\n",
|
||||
XPD_DBG(DEVICES, xpd, "%s -- deprecated (should use assigned-spans)\n",
|
||||
(dahdi_reg) ? "register" : "unregister");
|
||||
ret = mutex_lock_interruptible(&span_store_mutex);
|
||||
if (ret < 0) {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
# Load firmware into the Xorcom Astribank device:
|
||||
SUBSYSTEM=="usb", ACTION=="add", \
|
||||
ENV{PRODUCT}=="e4e4/11[3456][013]/*", ENV{DEVTYPE}!="usb_interface", \
|
||||
RUN+="/usr/share/dahdi/xpp_fxloader udev $env{PRODUCT}"
|
||||
|
||||
# Hotplug hook for Astribank up/down
|
||||
# If you need this functionality, copy the astribank_hook.sample
|
||||
# to $XPP_INIT_DIR/astribank_hook
|
||||
#
|
||||
# By default XPP_INIT_DIR="/usr/share/dahdi"
|
||||
KERNEL=="xbus*", RUN+="%E{XPP_INIT_DIR}/astribank_hook udev $kernel $sysfs{status} $sysfs{connector}"
|
||||
@@ -811,6 +811,7 @@ enum spantypes {
|
||||
SPANTYPE_DIGITAL_BRI_NT,
|
||||
SPANTYPE_DIGITAL_BRI_TE,
|
||||
SPANTYPE_DIGITAL_BRI_SOFT,
|
||||
SPANTYPE_DIGITAL_DYNAMIC,
|
||||
};
|
||||
const char *dahdi_spantype2str(enum spantypes st);
|
||||
enum spantypes dahdi_str2spantype(const char *name);
|
||||
@@ -909,7 +910,7 @@ struct dahdi_span_ops {
|
||||
/*! Opt: Provide the name of the echo canceller on a channel */
|
||||
const char *(*echocan_name)(const struct dahdi_chan *chan);
|
||||
|
||||
/*! When using "pinned_spans", this function is called back when this
|
||||
/*! When using "assigned spans", this function is called back when this
|
||||
* span has been assigned with the system. */
|
||||
void (*assigned)(struct dahdi_span *span);
|
||||
|
||||
@@ -1003,6 +1004,8 @@ struct dahdi_transcoder_channel {
|
||||
};
|
||||
|
||||
int dahdi_is_sync_master(const struct dahdi_span *span);
|
||||
struct dahdi_span *get_master_span(void);
|
||||
void set_master_span(int spanno);
|
||||
|
||||
static inline int
|
||||
dahdi_tc_is_built(struct dahdi_transcoder_channel *dtc) {
|
||||
@@ -1402,6 +1405,8 @@ static inline short dahdi_txtone_nextsample(struct dahdi_chan *ss)
|
||||
#define DAHDI_FORMAT_AUDIO_MASK ((1 << 16) - 1)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
||||
#ifdef RHEL_RELEASE_VERSION
|
||||
#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(6, 5)
|
||||
#ifdef CONFIG_PROC_FS
|
||||
#include <linux/proc_fs.h>
|
||||
static inline void *PDE_DATA(const struct inode *inode)
|
||||
@@ -1409,6 +1414,16 @@ static inline void *PDE_DATA(const struct inode *inode)
|
||||
return PDE(inode)->data;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#ifdef CONFIG_PROC_FS
|
||||
#include <linux/proc_fs.h>
|
||||
static inline void *PDE_DATA(const struct inode *inode)
|
||||
{
|
||||
return PDE(inode)->data;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
|
||||
#define KERN_CONT ""
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27)
|
||||
|
||||
Reference in New Issue
Block a user