diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2012-05-23 12:35:56 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2012-05-23 12:35:56 +0000 |
commit | 3359e84a8d937b96153af9b1d608b68f9c0a949b (patch) | |
tree | 94e4abf9a2d2c868310066800fc5fca1ad60f867 /drivers/dahdi/dahdi-base.c | |
parent | fa1d3ba9465064f7a1551fe7369525d8b355861d (diff) |
sysfs: add a linecompat span attribute
This way, dahdi_genconf may gather needed information without issuing
ioctl()'s
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10684 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi-base.c')
-rw-r--r-- | drivers/dahdi/dahdi-base.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index eddd137..367b951 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -749,6 +749,31 @@ const char *dahdi_spantype2str(enum spantypes st) } EXPORT_SYMBOL(dahdi_spantype2str); + +const char *dahdi_lineconfig_bit_name(int lineconfig_bit) +{ + static const char * const table[] = { + /* These apply to T1 */ + [4] = "D4", + [5] = "ESF", + [6] = "AMI", + [7] = "B8ZS", + /* These apply to E1 */ + [8] = "CCS", + [9] = "HDB3", + [10] = "CRC4", + /* These apply to BRI */ + [11] = "NTTE", + [12] = "TERM", + /* Finish */ + [16] = "NOTOPEN", + }; + if (lineconfig_bit < 0 || lineconfig_bit >= ARRAY_SIZE(table)) + return NULL; + return table[lineconfig_bit]; +} +EXPORT_SYMBOL(dahdi_lineconfig_bit_name); + #ifdef CONFIG_PROC_FS static const char *sigstr(int sig) { |