summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-10-26 19:01:19 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-10-26 19:01:19 +0000
commit7f136e308d607a9b3e1d82137dbdee0b36c90de7 (patch)
treefff367e0299dedba3eb092ebf6100892716da045 /include
parent835a0a722df18f4db9ccf5daf7bd54266d14e4a7 (diff)
dahdi: Allow 'spantype' to be changed before span assignement via sysfs.
For some boards, the linemode (E1/T1/J1) is software selectable but needs to be configured before the spans were historically registered since the line mode determines the channel count available on the span. This change exports a "spantype" attribute from the dahdi_device that can be used to set E1/T1/J1 before the spans are assigned. When userspace writes to this attribute (in a <span offset>:<span type string> format), and if the board driver has implemented a set_spantype function in it's dahdi_span_ops, then the board driver can optionally change it's mode before registration. Also part of this change is breaking out the raw data structure initialization of the spans / channels via the dahdi_init_device_spans function since the board drivers may need to reallocate channels / spans as part of this callback. For example, changing from T1 to E1 mode will require allocating 7 new channels. Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10277 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'include')
-rw-r--r--include/dahdi/kernel.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index b4df850..18f5319 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -891,6 +891,10 @@ struct dahdi_span_ops {
/*! When using "pinned_spans", this function is called back when this
* span has been assigned with the system. */
void (*assigned)(struct dahdi_span *span);
+
+ /*! Called when the spantype / linemode is changed before the span is
+ * assigned a number. */
+ int (*set_spantype)(struct dahdi_span *span, const char *spantype);
};
/**