2014-01-23 21:07:31 +08:00
|
|
|
.TH "DAHDI_SPAN_ASSIGNMENTS" "8" "23 Jan 2014" "" ""
|
2013-10-14 04:28:29 +08:00
|
|
|
|
|
|
|
.SH NAME
|
2014-01-23 21:07:31 +08:00
|
|
|
dahdi_span_assignments \- handle DAHDI spans assignments
|
2013-10-14 04:28:29 +08:00
|
|
|
.SH SYNOPSIS
|
|
|
|
|
2014-01-23 21:07:31 +08:00
|
|
|
.B dahdi_span_assignments [\-v|\-\-verbose] [\-n|\-\-dry\-run] <add|remove|auto> \fB[\fIdevpath\fB...]
|
2013-10-14 04:28:29 +08:00
|
|
|
|
2014-01-23 21:07:31 +08:00
|
|
|
.B dahdi_span_assignments [\-v|\-\-verbose] list \fB[\fIdevpath\fB...]
|
2013-10-14 04:28:29 +08:00
|
|
|
|
2013-11-26 23:15:13 +08:00
|
|
|
.B dahdi_span_assignments [\-v|\-\-verbose] [\-k|\-\-key \fIkey\fB] dumpconfig
|
2013-10-14 04:28:29 +08:00
|
|
|
|
2013-11-26 23:15:13 +08:00
|
|
|
.B dahdi_span_assignments \-h|\-\-help
|
2013-10-14 04:28:29 +08:00
|
|
|
|
|
|
|
.SH DESCRIPTION
|
2014-01-23 21:07:31 +08:00
|
|
|
Channels in DAHDI devices (such as DAHDI PCI cards) are groups to logical
|
|
|
|
units called "spans" (for example: a port in a digital card is a span).
|
2013-10-14 04:28:29 +08:00
|
|
|
When the kernel module parameter \fBdahdi.auto_assign_span\fR is unset,
|
2014-01-23 21:07:31 +08:00
|
|
|
DAHDI devices that register with DAHDI don't cause their spans to be
|
|
|
|
automatically assigned.
|
|
|
|
|
|
|
|
This allows user-space to order DAHDI to assign them to specific span
|
|
|
|
and channel numbers. That way, specific spans on specific DAHDI devices
|
|
|
|
may be assigned with specific span and channel numbers \fBregardless\fR
|
|
|
|
of the registration order of the hardware (or if all hardware is present
|
|
|
|
at all).
|
2013-10-14 04:28:29 +08:00
|
|
|
|
2013-11-26 23:15:13 +08:00
|
|
|
.B dahdi_span_assignments
|
2014-01-23 21:07:31 +08:00
|
|
|
is used to assign those spans or to help creating the configuration
|
|
|
|
file used in their assignment:
|
2014-01-28 02:27:09 +08:00
|
|
|
.B /etc/dahdi/assigned\-spans.conf .
|
2013-10-14 04:28:29 +08:00
|
|
|
|
2014-01-23 21:07:31 +08:00
|
|
|
.SH SUB-COMMANDS
|
2013-10-14 04:28:29 +08:00
|
|
|
|
2014-01-23 21:07:31 +08:00
|
|
|
There are several sub-commands.
|
2013-10-14 04:28:29 +08:00
|
|
|
|
2014-01-23 21:07:31 +08:00
|
|
|
All sub-commands take an optional list of paths to SysFS nodes of
|
|
|
|
devices. If given, the command will only operate on those DAHDI
|
|
|
|
devices. The default is to operate on all devices (which would normally
|
|
|
|
be the sane case when running from the command-line).
|
|
|
|
|
|
|
|
.B add \fB[\fIdevpath \fB...]
|
2013-10-14 04:28:29 +08:00
|
|
|
.RS
|
2014-01-23 21:07:31 +08:00
|
|
|
Applies to all devices or to those listed on the command line.
|
|
|
|
Parameters are paths (in SysFS) to DAHDI devices with unassigned
|
|
|
|
spans.
|
|
|
|
|
|
|
|
The command will assign spans with DAHDI according to
|
2014-01-28 02:27:09 +08:00
|
|
|
configuration in \fBassigned\-spans.conf\fR.
|
2014-01-23 21:07:31 +08:00
|
|
|
|
|
|
|
If no line matches the span, or if the assignment for it fails (it is
|
|
|
|
not available) it will remain unassigned.
|
|
|
|
|
|
|
|
If any of the span settings fails (the span number or range of channels
|
|
|
|
is already in use), the program will print a message, but continue
|
2014-01-28 02:27:09 +08:00
|
|
|
applying the others. In such a case you should fix assigned\-spans.conf
|
2014-01-23 21:07:31 +08:00
|
|
|
and re-run \fBadd\fR (or run \fBauto\fR to give those channels the
|
|
|
|
first available range and regenerate the file with 'dahdi_genconf
|
|
|
|
assignedspans').
|
2013-10-14 04:28:29 +08:00
|
|
|
.RE
|
|
|
|
|
2014-01-23 21:07:31 +08:00
|
|
|
.B remove \fB[\fIdevpath \fB...]
|
2013-10-14 04:28:29 +08:00
|
|
|
.RS
|
2014-01-23 21:07:31 +08:00
|
|
|
Applies to all devices or to those listed on the command line.
|
|
|
|
Parameters are paths (in SysFS) to DAHDI devices with assigned
|
|
|
|
spans.
|
|
|
|
|
|
|
|
The command will un-assign them.
|
2013-10-14 04:28:29 +08:00
|
|
|
.RE
|
|
|
|
|
2014-01-23 21:07:31 +08:00
|
|
|
.B auto \fB[\fIdevpath \fB...]
|
2013-10-14 04:28:29 +08:00
|
|
|
.RS
|
2014-01-23 21:07:31 +08:00
|
|
|
Applies to all devices or to those listed on the command line.
|
|
|
|
Parameters are paths (in SysFS) to DAHDI devices with unassigned
|
|
|
|
spans.
|
|
|
|
|
|
|
|
Each span is assigned to first available span number and channel
|
|
|
|
numbers, as if \fBdahdi.auto_assign_span\fR was set. The configuration
|
|
|
|
file doesn't affect these assignments.
|
2013-10-14 04:28:29 +08:00
|
|
|
.RE
|
|
|
|
|
|
|
|
.B list
|
|
|
|
.RS
|
|
|
|
List all spans in the system.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
.B dumpconfig
|
|
|
|
.RS
|
2014-01-23 21:07:31 +08:00
|
|
|
List all assigned spans in the system in a format fit to be used in
|
|
|
|
\fBassigned\-spans.conf\fR. Use this to generate a configuration file after
|
|
|
|
you have (automatically or manually) assigned all existing spans.
|
2013-10-14 04:28:29 +08:00
|
|
|
|
2013-11-19 00:14:34 +08:00
|
|
|
.B dahdi_genconf assignedspans
|
2013-10-14 04:28:29 +08:00
|
|
|
uses this command internally.
|
|
|
|
.RE
|
|
|
|
|
2014-01-23 21:07:31 +08:00
|
|
|
.SH OPTIONS
|
|
|
|
|
2013-10-14 04:28:29 +08:00
|
|
|
.B \-v \-\-verbose
|
|
|
|
.RS
|
|
|
|
Verbose output.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
.B \-n \-\-dry\-run
|
|
|
|
.RS
|
2014-01-23 21:07:31 +08:00
|
|
|
Don't assign / un-assign spans. Only print commands used to do so.
|
2013-10-14 04:28:29 +08:00
|
|
|
.RE
|
|
|
|
|
|
|
|
.B \-k \fIkey
|
|
|
|
.RS
|
|
|
|
For \fBdumpconfig\fR \- The key by which to identify the hardware in the
|
|
|
|
generated configuration. Legal values:
|
|
|
|
|
|
|
|
.B hwid
|
|
|
|
.RS
|
|
|
|
Hardware identifier (e.g.: software-readable serial number). This is the
|
|
|
|
default. If the device has no hwid, devpath is used.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
.B location
|
|
|
|
.RS
|
|
|
|
The location field (file) in the SysFS device node (directory) for the
|
|
|
|
DAHDI device. If not available (typically: DAHDI version <= 2.7.x),
|
|
|
|
devpath is used.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
.B devpath
|
|
|
|
.RS
|
|
|
|
Path in SysFS to the device node.
|
|
|
|
.RE
|
|
|
|
.RE
|
|
|
|
|
2014-01-23 21:07:31 +08:00
|
|
|
.SH CONFIGURATION
|
|
|
|
.B /etc/dahdi/assigned\-spans.conf
|
|
|
|
is a file with lines specifying assignment of spans.
|
2013-10-14 04:28:29 +08:00
|
|
|
|
|
|
|
Empty lines or lines beginning with '#' are ignored.
|
|
|
|
|
|
|
|
Each line is in the format of:
|
|
|
|
|
|
|
|
.I ID spanspec ...
|
|
|
|
|
|
|
|
The \fIID\fR field specifies the DAHDI device and the \fIspanspecs\fR
|
2014-01-23 21:07:31 +08:00
|
|
|
define how to assign its spans. A line may have multiple
|
2013-10-14 04:28:29 +08:00
|
|
|
\fIspanspecs\fR in a single line (though dumpconfig generates a
|
|
|
|
configuration with one per line).
|
|
|
|
|
|
|
|
.SS Span Identifier
|
|
|
|
A DAHDI device may be specified either by a hardware identifier (a
|
|
|
|
software readable serial number or whatever) or the location in which
|
|
|
|
it is installed on the system. The former makes it simpler to change
|
|
|
|
connector / slot whereas the latter makes it simpler to replace a unit.
|
|
|
|
|
|
|
|
The value in this field is matched (when the commands \fBadd\fR and
|
|
|
|
\fBremove\fR) are used) to the following values:
|
|
|
|
|
|
|
|
\fIhwid\fR
|
|
|
|
\fB@\fIlocation\fR
|
|
|
|
\fIdevpath\fR
|
|
|
|
|
|
|
|
See above for their descriptions. The value may include shell wildcards:
|
|
|
|
*, ? and [], which are used in the match. The values to be matched are
|
|
|
|
first cleaned up: '!' is replaced with '/' and any character beyond
|
2014-01-28 02:27:09 +08:00
|
|
|
"a\-zA\-Z0\-9/:.\-" is removed.
|
2013-10-14 04:28:29 +08:00
|
|
|
|
|
|
|
.SS Span Specification
|
|
|
|
|
|
|
|
Each line should have one or more span specifications: this is the value
|
2014-01-23 21:07:31 +08:00
|
|
|
used to assign a span with DAHDI in the SysFS interface. A
|
2013-10-14 04:28:29 +08:00
|
|
|
specification has three colon-separated numbers:
|
|
|
|
|
|
|
|
.I rel_span_no:span_no:first_chan
|
|
|
|
|
|
|
|
for instance, the following are four span specifications for a quad-E1
|
|
|
|
device: 1:6:53 2:7:84 3:8:115 4:9:146 occupying spans 6-9 and channels
|
|
|
|
53-176.
|
|
|
|
|
|
|
|
.B rel_span_no
|
|
|
|
.RS
|
|
|
|
The relative number of the span in the device. E.g.: port number.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
.B span_no
|
|
|
|
.RS
|
|
|
|
The desired DAHDI span number. Must be available.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
.B first_chan
|
|
|
|
.RS
|
|
|
|
The desired DAHDI channel number for the first DAHDI channel in the span.
|
2014-01-23 21:07:31 +08:00
|
|
|
All channels of the span will be assigned following it and hence that
|
2013-10-14 04:28:29 +08:00
|
|
|
space must be available.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
|
|
|
|
.SH ENVIRONMENT
|
|
|
|
|
|
|
|
.B DAHDICONFDIR
|
|
|
|
.RS
|
2014-01-28 02:27:09 +08:00
|
|
|
The directory in which assigned\-spans.conf resides. /etc/dahdi if not
|
2013-10-14 04:28:29 +08:00
|
|
|
overridden from the environment.
|
|
|
|
.RE
|
|
|
|
|
2013-11-27 02:55:09 +08:00
|
|
|
.B DAHDISASSIGNEDSPANSCONF
|
2013-10-14 04:28:29 +08:00
|
|
|
.RS
|
2014-01-28 02:27:09 +08:00
|
|
|
The path to assigned-spans.conf resides. /etc/dahdi/assigned\-spans.conf if
|
2013-10-14 04:28:29 +08:00
|
|
|
not overridden from the environment.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
.B SPAN_ASSIGNMENTS_KEY
|
|
|
|
.RS
|
|
|
|
The default value for \-k . Defaults to "hwid" if not overridden from the
|
|
|
|
environment.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
|
|
|
|
.SH FILES
|
|
|
|
|
2014-01-28 02:27:09 +08:00
|
|
|
.B /etc/dahdi/assigned\-spans.conf
|
2013-10-14 04:28:29 +08:00
|
|
|
.RS
|
|
|
|
The default location for the configuration file.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
.B /sys/bus/dahdi_devices/devices/\fIdevice\fR
|
|
|
|
.RS
|
|
|
|
SysFS node for the device. In this directory reside the following
|
|
|
|
files, among others:
|
|
|
|
|
|
|
|
.B location
|
|
|
|
.RS
|
|
|
|
The value of the device's location field.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
.B assign_span, unassign_span, auto_assign
|
|
|
|
.RS
|
|
|
|
Write only files for the operations. Used by \fBadd\fR, \fBremove\fR and
|
|
|
|
\fBauto\fR, respectively.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
.RE
|
|
|
|
|
|
|
|
.SH SEE ALSO
|
2013-11-26 23:15:13 +08:00
|
|
|
dahdi_span_types(8), dahdi_genconf(8), dahdi_cfg(8)
|
2013-10-14 04:28:29 +08:00
|
|
|
|
|
|
|
.SH AUTHOR
|
2013-11-26 23:15:13 +08:00
|
|
|
dahdi_span_assignments was written by Oron Peled. This manual page was
|
2013-10-14 04:28:29 +08:00
|
|
|
written by Tzafrir Cohen. Permission is granted to copy, distribute
|
|
|
|
and/or modify this document under the terms of the GNU General Public
|
|
|
|
License, Version 2 any later version published by the Free Software
|
|
|
|
Foundation.
|
|
|
|
|