dahdi: Completely stop spans when unassigning.

When spans are unassigned, dahdi_span_ops.shutdown was called, but the RUNNING
flag was never cleared. Now make sure all calls to the shutdown span ops
callback are the same.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
(cherry picked from commit 9b11847aee6fd6100d8c0c8ca8b20893facda1aa)
wcte12xp: Allow non-interrupting cards to unload faster.

If a card stops generating interrupts for any reason, it can take awhile to
unload the driver while waiting for the commands to timeout. Now if there is a
problem, immediately set a bit that the card is failed so that no new commands
will be submitted.

Also, do not free and commands in submit since all commands are freed in get
results now. This prevents list/memory corruption when commands time out.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
(cherry picked from commit c4a17f9442a26f2d124d835e0986436837256b86)
wcte12xp: Reset all the framer registers when switching linemodes.

If a span was fully configured before unassigning and reassigning to a new span
type it was possible for stale values to be present in the register. When
switching from T1 to E1 via the spantype sysfs attribute this could result in a
test pattern being written.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
(cherry picked from commit 96652d88c64ba0d7e9c56c2671376fb5e70407ae)

Conflicts:
	drivers/dahdi/wcte12xp/base.c