dahdi_get_auto_assigned_spans

Commit 74e949c33aeb6cf2cf2c33364e12b227c4579ca7 exported the module
variable dahdi.auto_assigned_spans. However this is not a good name.

This commit reverts the export and replaces it with a new function to
get the value of the variable.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
xpp: PRI stability fixes

* We didn't handle proper E1/T1 transitions after device registration.

* Fix SPAN_REGISTERED(xpd):
  It now checks for DAHDI_FLAGBIT_REGISTERED as well, as this flag is
  set/clear by assign/unassign.

* From set_pri_proto():
  - Always free/allocate channels
  - Always call dahdi_init_span()

* Improve phonedev_cleanup() safety:
  - NULL pointers after free.
  - Zero number of channels at the end.

* Refactor channel allocation out of phonedev_init():
  - Into phonedev_alloc_channels()
  - Also called from xpd_init_span() to prevent duplicated logic.
  - And called from set_pri_proto() to prevent our bug.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
wctc4xxp: Trivial. Remove unused timer_list from struct tcb.

The timer_list member of the transcoder buffer has not been used for a long
time. Saves some space in the buffer in addition to removing any future
curiosity about what it is for.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Add #include <linux/slab.h> to all files that call kzalloc|kmalloc|kfree.

Some architectures, like arm, do not automatically pull in the definitions for
kzalloc and friends. This allows DAHDI to build on those platforms.

Originally reported to the asterisk-users mailing list here
http://lists.digium.com/pipermail/asterisk-users/2014-February/282338.html

Signed-off-by: Shaun Ruffell <sruffell@digium.com>