summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-11-04 16:40:49 +0000
committerShaun Ruffell <sruffell@digium.com>2010-11-04 16:40:49 +0000
commit2def674c9f3245826f1abfb274a78bcebad9d8a6 (patch)
tree0c186143f223930457de3f2ad59a6f84ba0fb957
parent399e633479874906beef12c3d1fe46086a890e00 (diff)
dahdi: Constify the dahdi_txlevelnames and return of dahdi_lboname().
Also moves the dahdi_txlevelnames array into the dahdi_lboname function, which is the only place it it used. 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@9468 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/dahdi-base.c38
-rw-r--r--include/dahdi/kernel.h2
2 files changed, 22 insertions, 18 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 122c655..1e61272 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -96,18 +96,6 @@
/* macro-oni for determining a unit (channel) number */
#define UNIT(file) MINOR(file->f_dentry->d_inode->i_rdev)
-/* names of tx level settings */
-static char *dahdi_txlevelnames[] = {
-"0 db (CSU)/0-133 feet (DSX-1)",
-"133-266 feet (DSX-1)",
-"266-399 feet (DSX-1)",
-"399-533 feet (DSX-1)",
-"533-655 feet (DSX-1)",
-"-7.5db (CSU)",
-"-15db (CSU)",
-"-22.5db (CSU)"
-} ;
-
EXPORT_SYMBOL(dahdi_transcode_fops);
EXPORT_SYMBOL(dahdi_init_tone_state);
EXPORT_SYMBOL(dahdi_mf_tone);
@@ -122,7 +110,6 @@ EXPORT_SYMBOL(__dahdi_lineartoalaw);
EXPORT_SYMBOL(__dahdi_lin2mu);
EXPORT_SYMBOL(__dahdi_lin2a);
#endif
-EXPORT_SYMBOL(dahdi_lboname);
EXPORT_SYMBOL(dahdi_transmit);
EXPORT_SYMBOL(dahdi_receive);
EXPORT_SYMBOL(dahdi_rbsbits);
@@ -1636,12 +1623,29 @@ static int dahdi_chan_reg(struct dahdi_chan *chan)
return 0;
}
-char *dahdi_lboname(int x)
-{
- if ((x < 0) || (x > 7))
+/**
+ * dahdi_lboname() - Convert line build out number to string.
+ *
+ */
+const char *dahdi_lboname(int lbo)
+{
+ /* names of tx level settings */
+ static const char *const dahdi_txlevelnames[] = {
+ "0 db (CSU)/0-133 feet (DSX-1)",
+ "133-266 feet (DSX-1)",
+ "266-399 feet (DSX-1)",
+ "399-533 feet (DSX-1)",
+ "533-655 feet (DSX-1)",
+ "-7.5db (CSU)",
+ "-15db (CSU)",
+ "-22.5db (CSU)"
+ };
+
+ if ((lbo < 0) || (lbo > 7))
return "Unknown";
- return dahdi_txlevelnames[x];
+ return dahdi_txlevelnames[lbo];
}
+EXPORT_SYMBOL(dahdi_lboname);
#if defined(CONFIG_DAHDI_NET) || defined(CONFIG_DAHDI_PPP)
static inline void print_debug_writebuf(struct dahdi_chan* ss, struct sk_buff *skb, int oldbuf)
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index e784b34..9a21c63 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -1060,7 +1060,7 @@ int dahdi_transcoder_alert(struct dahdi_transcoder_channel *ztc);
int dahdi_unregister(struct dahdi_span *span);
/*! \brief Gives a name to an LBO */
-char *dahdi_lboname(int lbo);
+const char *dahdi_lboname(int lbo);
/*! \brief Tell DAHDI about changes in received rbs bits */
void dahdi_rbsbits(struct dahdi_chan *chan, int bits);