[dahdi-commits] dahdi/linux.git branch "master" updated.
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Sun Nov 24 09:23:01 CST 2013
branch "master" has been updated
via 2b20289cb7e038f3bf2e095adad026b717ca7a03 (commit)
via dd944f3362ceba7166ddb6cfecb0cbf8e8d878fe (commit)
from d8fe2af23de69ddc90bdbc676a5b7cb38a6301c3 (commit)
Summary of changes:
.gitignore | 8 ++++++++
README | 6 ++++++
drivers/dahdi/dahdi-base.c | 25 +++++++++++++++++++++++++
drivers/dahdi/dahdi-sysfs.c | 23 +++++++++++++++++++++++
include/dahdi/kernel.h | 2 ++
5 files changed, 64 insertions(+)
- Log -----------------------------------------------------------------
commit 2b20289cb7e038f3bf2e095adad026b717ca7a03
Author: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Date: Sun Nov 24 17:17:34 2013 +0200
Ignore some more firmware files
Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
diff --git a/.gitignore b/.gitignore
index a35433e..b84745b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,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
commit dd944f3362ceba7166ddb6cfecb0cbf8e8d878fe
Author: Oron Peled <oron.peled at xorcom.com>
Date: Mon Oct 14 13:36:01 2013 +0200
sysfs: new driver attribute: master_span
* This changeset adds master_span as an attribute of the span's driver:
/sys/bus/dahdi_spans/drivers/generic_lowlevel/master_span
* This is mainly used for debugging.
* Reading from it the master span number (or 0 if there is no master
span).
* Writing a number to it, force specified span to be master
* Existing Alternatives:
- grep "MASTER" from /proc/dahdi/*
- cat /sys/bus/dahdi_spans/devices/span-*/is_sync_master
(Note: commit d8fe2af23de69ddc90bdbc676a5b7cb38a6301c3 is also Acked-By
Tzafrir Cohen <tzafrir.cohen at xorcom.com>)
Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks at digium.com>
diff --git a/README b/README
index 51a8fb3..6985f2b 100644
--- a/README
+++ b/README
@@ -989,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
^^^^^^^^^^^^
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 5a2ec49..74d46f3 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -3840,6 +3840,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;
diff --git a/drivers/dahdi/dahdi-sysfs.c b/drivers/dahdi/dahdi-sysfs.c
index 3de37d5..6b1962c 100644
--- a/drivers/dahdi/dahdi-sysfs.c
+++ b/drivers/dahdi/dahdi-sysfs.c
@@ -231,7 +231,30 @@ 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;
+}
+
+
static struct driver_attribute dahdi_attrs[] = {
+ __ATTR(master_span, S_IRUGO | S_IWUSR, master_span_show,
+ master_span_store),
__ATTR_NULL,
};
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index ac70e1a..c71e909 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -1003,6 +1003,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) {
-----------------------------------------------------------------------
--
dahdi/linux.git
More information about the dahdi-commits
mailing list