Compare commits
26 Commits
branched-2
...
v2.4.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e87ec518e4 | ||
|
|
1e87525755 | ||
|
|
68a0bf1d47 | ||
|
|
51c53f217b | ||
|
|
82bd4c0b27 | ||
|
|
af9a9751fa | ||
|
|
7e2b9485e4 | ||
|
|
b44162f69a | ||
|
|
49de604d12 | ||
|
|
40f2fa685a | ||
|
|
06fdf8a772 | ||
|
|
8fcc88893c | ||
|
|
39bc4ef672 | ||
|
|
e60eb95453 | ||
|
|
cc7cc7cb51 | ||
|
|
53cbba5c8b | ||
|
|
35c833afef | ||
|
|
d0bf20c36d | ||
|
|
6fb24bc346 | ||
|
|
346fccbea0 | ||
|
|
de59662acb | ||
|
|
fb35e6afd2 | ||
|
|
3be68a1105 | ||
|
|
21875abb42 | ||
|
|
75b7b53f10 | ||
|
|
6105ec0b16 |
@@ -386,13 +386,8 @@ struct dahdi_timer {
|
||||
|
||||
static LIST_HEAD(zaptimers);
|
||||
|
||||
#ifdef DEFINE_SPINLOCK
|
||||
static DEFINE_SPINLOCK(zaptimerlock);
|
||||
static DEFINE_SPINLOCK(bigzaplock);
|
||||
#else
|
||||
static spinlock_t zaptimerlock = SPIN_LOCK_UNLOCKED;
|
||||
static spinlock_t bigzaplock = SPIN_LOCK_UNLOCKED;
|
||||
#endif
|
||||
|
||||
struct dahdi_zone {
|
||||
atomic_t refcount;
|
||||
@@ -1675,7 +1670,7 @@ static inline void print_debug_writebuf(struct dahdi_chan* ss, struct sk_buff *s
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DAHDI_NET
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 26)
|
||||
static inline struct net_device_stats *hdlc_stats(struct net_device *dev)
|
||||
{
|
||||
return &dev->stats;
|
||||
@@ -3330,6 +3325,7 @@ struct dahdi_tone *dahdi_mf_tone(const struct dahdi_chan *chan, char digit, int
|
||||
case 'C':
|
||||
case 'D':
|
||||
tone_index = DAHDI_TONE_DTMF_A + (digit - 'A');
|
||||
break;
|
||||
case 'W':
|
||||
return &tone_pause;
|
||||
default:
|
||||
|
||||
@@ -113,13 +113,8 @@ struct dahdi_dynamic {
|
||||
struct list_head list;
|
||||
};
|
||||
|
||||
#ifdef DEFINE_SPINLOCK
|
||||
static DEFINE_SPINLOCK(dspan_lock);
|
||||
static DEFINE_SPINLOCK(driver_lock);
|
||||
#else
|
||||
static spinlock_t dspan_lock = SPIN_LOCK_UNLOCKED;
|
||||
static spinlock_t driver_lock = SPIN_LOCK_UNLOCKED;
|
||||
#endif
|
||||
|
||||
static LIST_HEAD(dspan_list);
|
||||
static LIST_HEAD(driver_list);
|
||||
@@ -227,16 +222,10 @@ static void __ztdynamic_run(void)
|
||||
{
|
||||
struct dahdi_dynamic *z;
|
||||
struct dahdi_dynamic_driver *drv;
|
||||
int y;
|
||||
|
||||
rcu_read_lock();
|
||||
list_for_each_entry_rcu(z, &dspan_list, list) {
|
||||
if (!z->dead) {
|
||||
for (y=0;y<z->span.channels;y++) {
|
||||
/* Echo cancel double buffered data */
|
||||
dahdi_ec_chunk(z->span.chans[y], z->span.chans[y]->readchunk, z->span.chans[y]->writechunk);
|
||||
}
|
||||
dahdi_receive(&z->span);
|
||||
dahdi_transmit(&z->span);
|
||||
/* Handle all transmissions now */
|
||||
ztd_sendmessage(z);
|
||||
@@ -402,6 +391,9 @@ void dahdi_dynamic_receive(struct dahdi_span *span, unsigned char *msg, int msgl
|
||||
if (unlikely(rxpos != rxcnt))
|
||||
printk(KERN_NOTICE "Span %s: Expected seq no %d, but received %d instead\n", span->name, rxcnt, rxpos);
|
||||
|
||||
dahdi_ec_span(span);
|
||||
dahdi_receive(span);
|
||||
|
||||
/* If this is our master span, then run everything */
|
||||
if (master)
|
||||
ztdynamic_run();
|
||||
|
||||
@@ -42,11 +42,7 @@ struct ztdeth_header {
|
||||
|
||||
/* We take the raw message, put it in an ethernet frame, and add a
|
||||
two byte addressing header at the top for future use */
|
||||
#ifdef DEFINE_SPINLOCK
|
||||
static DEFINE_SPINLOCK(zlock);
|
||||
#else
|
||||
static spinlock_t zlock = SPIN_LOCK_UNLOCKED;
|
||||
#endif
|
||||
|
||||
static struct sk_buff_head skbs;
|
||||
|
||||
|
||||
@@ -129,11 +129,7 @@ struct ztdeth {
|
||||
/**
|
||||
* Lock for adding and removing items in ethmf_list
|
||||
*/
|
||||
#ifdef DEFINE_SPINLOCK
|
||||
static DEFINE_SPINLOCK(ethmf_lock);
|
||||
#else
|
||||
static spinlock_t ethmf_lock = SPIN_LOCK_UNLOCKED;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The active list of all running spans
|
||||
@@ -401,7 +397,7 @@ static int ztdethmf_transmit(void *pvt, unsigned char *msg, int msglen)
|
||||
unsigned char addr[ETH_ALEN];
|
||||
int spans_ready = 0, index = 0;
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 10)
|
||||
static spinlock_t lock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(lock);
|
||||
unsigned long flags;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -57,11 +57,7 @@
|
||||
|
||||
#include <dahdi/kernel.h>
|
||||
|
||||
#ifdef DEFINE_SPINLOCK
|
||||
static DEFINE_SPINLOCK(zlock);
|
||||
#else
|
||||
static spinlock_t zlock = SPIN_LOCK_UNLOCKED;
|
||||
#endif
|
||||
|
||||
static struct ztdlocal {
|
||||
unsigned short key;
|
||||
|
||||
@@ -46,7 +46,7 @@ static LIST_HEAD(registration_list);
|
||||
* is used as a simplistic way to spread the load amongst the different hardware
|
||||
* transcoders in the system. */
|
||||
static LIST_HEAD(active_list);
|
||||
static spinlock_t translock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(translock);
|
||||
|
||||
EXPORT_SYMBOL(dahdi_transcoder_register);
|
||||
EXPORT_SYMBOL(dahdi_transcoder_unregister);
|
||||
|
||||
@@ -48,10 +48,10 @@ typedef struct _OCT6100_API_CHANNEL_TDM_
|
||||
UINT8 byRoutPcmLaw : 1;
|
||||
UINT8 bySoutPcmLaw : 1;
|
||||
|
||||
UINT8 byRinNumTssts : 1;
|
||||
UINT8 bySinNumTssts : 1;
|
||||
UINT8 byRoutNumTssts : 1;
|
||||
UINT8 bySoutNumTssts : 1;
|
||||
UINT8 byRinNumTssts : 2;
|
||||
UINT8 bySinNumTssts : 2;
|
||||
UINT8 byRoutNumTssts : 2;
|
||||
UINT8 bySoutNumTssts : 2;
|
||||
|
||||
/* RIN port. */
|
||||
UINT16 usRinTimeslot;
|
||||
@@ -93,19 +93,20 @@ typedef struct _OCT6100_API_CHANNEL_VQE_
|
||||
UINT8 fSoutAdaptiveNoiseReduction : 1;
|
||||
UINT8 fDtmfToneRemoval : 1;
|
||||
UINT8 fAcousticEcho : 1;
|
||||
UINT8 byComfortNoiseMode : 1;
|
||||
UINT8 byComfortNoiseMode : 2;
|
||||
UINT8 fSoutNaturalListenerEnhancement : 1;
|
||||
UINT8 fRoutNoiseReduction : 1;
|
||||
UINT8 fEnableMusicProtection : 1;
|
||||
UINT8 fIdleCodeDetection : 1;
|
||||
UINT8 byAnrVoiceNoiseSegregation : 1;
|
||||
UINT8 byAnrVoiceNoiseSegregation : 4;
|
||||
UINT8 byDoubleTalkBehavior : 1;
|
||||
UINT8 fSoutNoiseBleaching : 1;
|
||||
UINT8 fSoutConferencingNoiseReduction : 1;
|
||||
UINT8 bySoutAutomaticListenerEnhancementGainDb : 1;
|
||||
UINT8 byNonLinearityBehaviorA : 1;
|
||||
UINT8 byNonLinearityBehaviorB : 1;
|
||||
UINT8 bySoutNaturalListenerEnhancementGainDb : 1;
|
||||
UINT8 byNonLinearityBehaviorA : 4;
|
||||
UINT8 byNonLinearityBehaviorB : 4;
|
||||
|
||||
UINT8 bySoutAutomaticListenerEnhancementGainDb;
|
||||
UINT8 bySoutNaturalListenerEnhancementGainDb;
|
||||
|
||||
OCT_INT8 chRinAutomaticLevelControlTargetDb;
|
||||
OCT_INT8 chSoutAutomaticLevelControlTargetDb;
|
||||
@@ -134,15 +135,15 @@ typedef struct _OCT6100_API_CHANNEL_CODEC_
|
||||
UINT8 byAdpcmNibblePosition : 1;
|
||||
UINT8 fEnableSilenceSuppression : 1;
|
||||
|
||||
UINT8 byEncoderPort : 1;
|
||||
UINT8 byEncodingRate : 1;
|
||||
UINT8 byEncoderPort : 4;
|
||||
UINT8 byDecoderPort : 4;
|
||||
|
||||
UINT8 byDecoderPort : 1;
|
||||
UINT8 byDecodingRate : 1;
|
||||
UINT8 byPhasingType : 2;
|
||||
|
||||
UINT8 byEncodingRate;
|
||||
UINT8 byDecodingRate;
|
||||
|
||||
UINT8 byPhase : 1;
|
||||
UINT8 byPhasingType : 1;
|
||||
|
||||
UINT16 byPhase;
|
||||
} tOCT6100_API_CHANNEL_CODEC, *tPOCT6100_API_CHANNEL_CODEC;
|
||||
|
||||
typedef struct _OCT6100_API_CHANNEL_
|
||||
@@ -163,7 +164,7 @@ typedef struct _OCT6100_API_CHANNEL_
|
||||
UINT8 fEnableToneDisabler : 1;
|
||||
|
||||
/* Current echo operation mode. */
|
||||
UINT8 byEchoOperationMode : 1;
|
||||
UINT8 byEchoOperationMode : 3;
|
||||
|
||||
UINT8 byToneDisablerStatus : 1;
|
||||
|
||||
@@ -359,7 +360,7 @@ typedef struct _OCT6100_API_BIDIR_CHANNEL_
|
||||
/* Flag specifying whether the entry is used or not. */
|
||||
UINT8 fReserved : 1;
|
||||
/* Count used to manage entry handles allocated to user. */
|
||||
UINT8 byEntryOpenCnt : 1;
|
||||
UINT8 byEntryOpenCnt;
|
||||
|
||||
} tOCT6100_API_BIDIR_CHANNEL, *tPOCT6100_API_BIDIR_CHANNEL;
|
||||
|
||||
|
||||
@@ -1129,11 +1129,7 @@ static void tor2_tasklet(unsigned long data)
|
||||
static int syncsrc = 0;
|
||||
static int syncnum = 0 /* -1 */;
|
||||
static int syncspan = 0;
|
||||
#ifdef DEFINE_SPINLOCK
|
||||
static DEFINE_SPINLOCK(synclock);
|
||||
#else
|
||||
static spinlock_t synclock = SPIN_LOCK_UNLOCKED;
|
||||
#endif
|
||||
|
||||
static int tor2_findsync(struct tor2 *tor)
|
||||
{
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#ifndef _GPAKCUST_H /* prevent multiple inclusion */
|
||||
#define _GPAKCUST_H
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/completion.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
@@ -35,22 +35,16 @@
|
||||
|
||||
#ifdef VOICEBUS_NET_DEBUG
|
||||
|
||||
#ifdef HAVE_NETDEV_PRIV
|
||||
struct voicebus_netdev_priv {
|
||||
struct voicebus *vb;
|
||||
};
|
||||
#endif
|
||||
|
||||
static inline struct voicebus *
|
||||
voicebus_from_netdev(struct net_device *netdev)
|
||||
{
|
||||
#ifdef HAVE_NETDEV_PRIV
|
||||
struct voicebus_netdev_priv *priv;
|
||||
priv = netdev_priv(netdev);
|
||||
return priv->vb;
|
||||
#else
|
||||
return netdev->priv;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void *
|
||||
@@ -206,23 +200,14 @@ int vb_net_register(struct voicebus *vb, const char *board_name)
|
||||
{
|
||||
int res;
|
||||
struct net_device *netdev;
|
||||
# ifdef HAVE_NETDEV_PRIV
|
||||
struct voicebus_netdev_priv *priv;
|
||||
# endif
|
||||
const char our_mac[] = { 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
|
||||
|
||||
# ifdef HAVE_NETDEV_PRIV
|
||||
netdev = alloc_netdev(sizeof(*priv), board_name, ether_setup);
|
||||
if (!netdev)
|
||||
return -ENOMEM;
|
||||
priv = netdev_priv(netdev);
|
||||
priv->vb = vb;
|
||||
# else
|
||||
netdev = alloc_netdev(0, vb->board_name, ether_setup);
|
||||
if (!netdev)
|
||||
return -ENOMEM;
|
||||
netdev->priv = vb;
|
||||
# endif
|
||||
memcpy(netdev->dev_addr, our_mac, sizeof(our_mac));
|
||||
# ifdef HAVE_NET_DEVICE_OPS
|
||||
netdev->netdev_ops = &vb_netdev_ops;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* WCB410P Quad-BRI PCI Driver
|
||||
* Written by Andrew Kohlsmith <akohlsmith@mixdown.ca>
|
||||
*
|
||||
* Copyright (C) 2009 Digium, Inc.
|
||||
* Copyright (C) 2009-2011 Digium, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
@@ -2303,6 +2303,9 @@ static int b4xxp_chanconfig(struct dahdi_chan *chan, int sigtype)
|
||||
|
||||
if (alreadyrunning && bspan->sigchan) {
|
||||
hdlc_stop(b4, fifo);
|
||||
atomic_set(&bspan->hdlc_pending, 0);
|
||||
bspan->sigactive = 0;
|
||||
smp_mb();
|
||||
bspan->sigchan = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -763,11 +763,9 @@ static inline unsigned int __t4_raw_oct_in(struct t4 *wc, const unsigned int add
|
||||
__t4_pci_out(wc, WC_LADDR, (WC_LWRITE | WC_LALE));
|
||||
if (!pedanticpci)
|
||||
__t4_pci_in(wc, WC_VERSION);
|
||||
#ifdef PEDANTIC_OCTASIC_CHECKING
|
||||
__t4_pci_out(wc, WC_LADDR, (WC_LALE));
|
||||
if (!pedanticpci)
|
||||
__t4_pci_in(wc, WC_VERSION);
|
||||
#endif
|
||||
if (!octopt) {
|
||||
__t4_gpio_setdir(wc, 0xff, 0x00);
|
||||
__t4_gpio_set(wc, 0xff, 0x00);
|
||||
@@ -2231,11 +2229,7 @@ static void t4_serial_setup(struct t4 *wc, int unit)
|
||||
static int syncsrc = 0;
|
||||
static int syncnum = 0 /* -1 */;
|
||||
static int syncspan = 0;
|
||||
#ifdef DEFINE_SPINLOCK
|
||||
static DEFINE_SPINLOCK(synclock);
|
||||
#else
|
||||
static spinlock_t synclock = SPIN_LOCK_UNLOCKED;
|
||||
#endif
|
||||
|
||||
static void __t4_set_rclk_src(struct t4 *wc, int span)
|
||||
{
|
||||
@@ -2357,7 +2351,7 @@ static int __t4_findsync(struct t4 *wc)
|
||||
while (p < 8) {
|
||||
nonzero = 0;
|
||||
for (x=0;cards[x];x++) {
|
||||
for (i = 0; i < wc->numspans; i++) {
|
||||
for (i = 0; i < cards[x]->numspans; i++) {
|
||||
if (cards[x]->tspans[i]->syncpos) {
|
||||
nonzero = 1;
|
||||
if ((cards[x]->tspans[i]->syncpos == p) &&
|
||||
|
||||
@@ -399,22 +399,16 @@ struct wcdte {
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef HAVE_NETDEV_PRIV
|
||||
struct wcdte_netdev_priv {
|
||||
struct wcdte *wc;
|
||||
};
|
||||
#endif
|
||||
|
||||
static inline struct wcdte *
|
||||
wcdte_from_netdev(struct net_device *netdev)
|
||||
{
|
||||
#ifdef HAVE_NETDEV_PRIV
|
||||
struct wcdte_netdev_priv *priv;
|
||||
priv = netdev_priv(netdev);
|
||||
return priv->wc;
|
||||
#else
|
||||
return netdev->priv;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -499,6 +493,7 @@ wctc4xxp_skb_to_cmd(struct wcdte *wc, const struct sk_buff *skb)
|
||||
return cmd;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
|
||||
static void
|
||||
wctc4xxp_net_set_multi(struct net_device *netdev)
|
||||
{
|
||||
@@ -506,6 +501,15 @@ wctc4xxp_net_set_multi(struct net_device *netdev)
|
||||
DTE_DEBUG(DTE_DEBUG_GENERAL, "%s promiscuity:%d\n",
|
||||
__func__, netdev->promiscuity);
|
||||
}
|
||||
#else
|
||||
static void
|
||||
wctc4xxp_set_rx_mode(struct net_device *netdev)
|
||||
{
|
||||
struct wcdte *wc = wcdte_from_netdev(netdev);
|
||||
DTE_DEBUG(DTE_DEBUG_GENERAL, "%s promiscuity:%d\n",
|
||||
__func__, netdev->promiscuity);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
wctc4xxp_net_up(struct net_device *netdev)
|
||||
@@ -669,7 +673,11 @@ wctc4xxp_net_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
|
||||
|
||||
#ifdef HAVE_NET_DEVICE_OPS
|
||||
static const struct net_device_ops wctc4xxp_netdev_ops = {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
|
||||
.ndo_set_multicast_list = &wctc4xxp_net_set_multi,
|
||||
#else
|
||||
.ndo_set_rx_mode = &wctc4xxp_set_rx_mode,
|
||||
#endif
|
||||
.ndo_open = &wctc4xxp_net_up,
|
||||
.ndo_stop = &wctc4xxp_net_down,
|
||||
.ndo_start_xmit = &wctc4xxp_net_hard_start_xmit,
|
||||
@@ -691,23 +699,14 @@ wctc4xxp_net_register(struct wcdte *wc)
|
||||
{
|
||||
int res;
|
||||
struct net_device *netdev;
|
||||
# ifdef HAVE_NETDEV_PRIV
|
||||
struct wcdte_netdev_priv *priv;
|
||||
# endif
|
||||
const char our_mac[] = { 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
|
||||
|
||||
# ifdef HAVE_NETDEV_PRIV
|
||||
netdev = alloc_netdev(sizeof(*priv), wc->board_name, ether_setup);
|
||||
if (!netdev)
|
||||
return -ENOMEM;
|
||||
priv = netdev_priv(netdev);
|
||||
priv->wc = wc;
|
||||
# else
|
||||
netdev = alloc_netdev(0, wc->board_name, ether_setup);
|
||||
if (!netdev)
|
||||
return -ENOMEM;
|
||||
netdev->priv = wc;
|
||||
# endif
|
||||
memcpy(netdev->dev_addr, our_mac, sizeof(our_mac));
|
||||
|
||||
# ifdef HAVE_NET_DEVICE_OPS
|
||||
@@ -1615,6 +1614,20 @@ wctc4xxp_transmit_cmd(struct wcdte *wc, struct tcb *cmd)
|
||||
{
|
||||
int res;
|
||||
|
||||
/* If we're shutdown all commands will timeout. Just complete the
|
||||
* command here with the timeout flag */
|
||||
if (unlikely(test_bit(DTE_SHUTDOWN, &wc->flags))) {
|
||||
if (cmd->flags & DO_NOT_AUTO_FREE) {
|
||||
cmd->flags |= DTE_CMD_TIMEOUT;
|
||||
list_del_init(&cmd->node);
|
||||
complete(&cmd->complete);
|
||||
} else {
|
||||
list_del(&cmd->node);
|
||||
free_cmd(cmd);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (cmd->data_len < MIN_PACKET_LEN) {
|
||||
memset((u8 *)(cmd->data) + cmd->data_len, 0,
|
||||
MIN_PACKET_LEN-cmd->data_len);
|
||||
@@ -2159,12 +2172,13 @@ wctc4xxp_write(struct file *file, const char __user *frame,
|
||||
}
|
||||
|
||||
if (DAHDI_FORMAT_G723_1 == dtc->srcfmt) {
|
||||
if ((G723_5K_BYTES != count) && (G723_6K_BYTES != count)) {
|
||||
if ((G723_5K_BYTES != count) && (G723_6K_BYTES != count) &&
|
||||
(G723_SID_BYTES != count)) {
|
||||
DTE_DEBUG(DTE_DEBUG_GENERAL,
|
||||
"Trying to transcode packet into G723 format " \
|
||||
"that is %Zu bytes instead of the expected " \
|
||||
"%d/%d bytes.\n", count, G723_5K_BYTES,
|
||||
G723_6K_BYTES);
|
||||
"%d/%d/%d bytes.\n", count, G723_5K_BYTES,
|
||||
G723_6K_BYTES, G723_SID_BYTES);
|
||||
return -EINVAL;
|
||||
}
|
||||
cpvt->timestamp += G723_SAMPLES;
|
||||
@@ -2741,11 +2755,10 @@ wctc4xxp_start_dma(struct wcdte *wc)
|
||||
}
|
||||
|
||||
static void
|
||||
wctc4xxp_stop_dma(struct wcdte *wc)
|
||||
_wctc4xxp_stop_dma(struct wcdte *wc)
|
||||
{
|
||||
/* Disable interrupts and reset */
|
||||
unsigned int reg;
|
||||
unsigned long newjiffies;
|
||||
/* Disable interrupts */
|
||||
wctc4xxp_setintmask(wc, 0x00000000);
|
||||
wctc4xxp_setctl(wc, 0x0084, 0x00000000);
|
||||
@@ -2754,7 +2767,14 @@ wctc4xxp_stop_dma(struct wcdte *wc)
|
||||
reg = wctc4xxp_getctl(wc, 0x0000);
|
||||
reg |= 0x00000001;
|
||||
wctc4xxp_setctl(wc, 0x0000, reg);
|
||||
}
|
||||
|
||||
static void
|
||||
wctc4xxp_stop_dma(struct wcdte *wc)
|
||||
{
|
||||
unsigned long newjiffies;
|
||||
|
||||
_wctc4xxp_stop_dma(wc);
|
||||
newjiffies = jiffies + HZ; /* One second timeout */
|
||||
/* We'll wait here for the part to come out of reset */
|
||||
while (((wctc4xxp_getctl(wc, 0x0000)) & 0x00000001) &&
|
||||
@@ -2762,7 +2782,6 @@ wctc4xxp_stop_dma(struct wcdte *wc)
|
||||
msleep(1);
|
||||
}
|
||||
|
||||
|
||||
#define MDIO_SHIFT_CLK 0x10000
|
||||
#define MDIO_DATA_WRITE1 0x20000
|
||||
#define MDIO_ENB 0x00000
|
||||
@@ -3307,13 +3326,19 @@ wctc4xxp_watchdog(unsigned long data)
|
||||
if (time_after(jiffies, cmd->timeout)) {
|
||||
if (++cmd->retries > MAX_RETRIES) {
|
||||
if (!(cmd->flags & TX_COMPLETE)) {
|
||||
|
||||
cmd->flags |= DTE_CMD_TIMEOUT;
|
||||
list_del_init(&cmd->node);
|
||||
complete(&cmd->complete);
|
||||
|
||||
set_bit(DTE_SHUTDOWN, &wc->flags);
|
||||
spin_unlock(&wc->cmd_list_lock);
|
||||
wctc4xxp_stop_dma(wc);
|
||||
_wctc4xxp_stop_dma(wc);
|
||||
DTE_PRINTK(ERR,
|
||||
"Board malfunctioning. " \
|
||||
"Halting operation.\n");
|
||||
return;
|
||||
reschedule_timer = 0;
|
||||
break;
|
||||
}
|
||||
/* ERROR: We've retried the command and
|
||||
* haven't received the ACK or the response.
|
||||
|
||||
@@ -921,12 +921,8 @@ static inline void wctdm_transmitprep(struct wctdm *wc, unsigned char *writechun
|
||||
if (x < DAHDI_CHUNKSIZE - 1) {
|
||||
writechunk[EFRAME_SIZE] = wc->ctlreg;
|
||||
writechunk[EFRAME_SIZE + 1] = wc->txident++;
|
||||
|
||||
if ((wc->desc->ports == 4) && ((wc->ctlreg & 0x10))) {
|
||||
writechunk[EFRAME_SIZE + 2] = 0;
|
||||
for (y = 0; y < 4; y++)
|
||||
writechunk[EFRAME_SIZE + 2] |= (1 << y);
|
||||
}
|
||||
if (4 == wc->desc->ports)
|
||||
writechunk[EFRAME_SIZE + 2] = wc->tdm410leds;
|
||||
}
|
||||
writechunk += (EFRAME_SIZE + EFRAME_GAP);
|
||||
}
|
||||
@@ -1821,7 +1817,8 @@ static void wctdm_fxs_off_hook(struct wctdm *wc, const int card)
|
||||
SLIC_LF_ACTIVE_FWD;
|
||||
break;
|
||||
}
|
||||
wctdm_fxs_hooksig(wc, card, DAHDI_TXSIG_OFFHOOK);
|
||||
if ((fxs->lasttxhook & SLIC_LF_SETMASK) != SLIC_LF_OPEN)
|
||||
wctdm_fxs_hooksig(wc, card, DAHDI_TXSIG_OFFHOOK);
|
||||
dahdi_hooksig(wc->aspan->span.chans[card], DAHDI_RXSIG_OFFHOOK);
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -1837,7 +1834,8 @@ static void wctdm_fxs_on_hook(struct wctdm *wc, const int card)
|
||||
if (debug & DEBUG_CARD)
|
||||
dev_info(&wc->vb.pdev->dev,
|
||||
"fxs_on_hook: Card %d Going on hook\n", card);
|
||||
wctdm_fxs_hooksig(wc, card, DAHDI_TXSIG_ONHOOK);
|
||||
if ((fxs->lasttxhook & SLIC_LF_SETMASK) != SLIC_LF_OPEN)
|
||||
wctdm_fxs_hooksig(wc, card, DAHDI_TXSIG_ONHOOK);
|
||||
dahdi_hooksig(wc->aspan->span.chans[card], DAHDI_RXSIG_ONHOOK);
|
||||
fxs->oldrxhook = 0;
|
||||
}
|
||||
@@ -4592,6 +4590,21 @@ static inline void remove_sysfs_files(struct wctdm *wc) { return; }
|
||||
|
||||
#endif /* CONFIG_VOICEBUS_SYSFS */
|
||||
|
||||
static void wctdm_set_tdm410_leds(struct wctdm *wc)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (4 != wc->desc->ports)
|
||||
return;
|
||||
|
||||
wc->tdm410leds = 0; /* all on by default */
|
||||
for (i = 0; i < wc->desc->ports; ++i) {
|
||||
/* Turn off the LED for any module that isn't installed. */
|
||||
if (MOD_TYPE_NONE == wc->modtype[i])
|
||||
wc->tdm410leds |= (1 << i);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_ASYNC_INIT
|
||||
struct async_data {
|
||||
struct pci_dev *pdev;
|
||||
@@ -4734,6 +4747,8 @@ __wctdm_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
/* Now track down what modules are installed */
|
||||
wctdm_identify_modules(wc);
|
||||
|
||||
wctdm_set_tdm410_leds(wc);
|
||||
|
||||
if (fatal_signal_pending(current)) {
|
||||
wctdm_back_out_gracefully(wc);
|
||||
return -EINTR;
|
||||
|
||||
@@ -165,7 +165,8 @@ struct wctdm {
|
||||
unsigned char rxident;
|
||||
|
||||
int flags[NUM_MODULES]; /* bitmap of board-specific + module-specific flags */
|
||||
unsigned char ctlreg; /* FIXME: something to do with VPM? */
|
||||
u8 ctlreg;
|
||||
u8 tdm410leds;
|
||||
|
||||
int mods_per_board; /* maximum number of modules for this board */
|
||||
int digi_mods; /* number of digital modules present */
|
||||
|
||||
@@ -88,7 +88,6 @@ static const struct dahdi_echocan_ops vpm150m_ec_ops = {
|
||||
};
|
||||
|
||||
static struct t1 *ifaces[WC_MAX_IFACES];
|
||||
spinlock_t ifacelock = SPIN_LOCK_UNLOCKED;
|
||||
|
||||
struct t1_desc {
|
||||
const char *name;
|
||||
@@ -628,12 +627,22 @@ static void t1_setleds(struct t1 *wc, int leds)
|
||||
submit_cmd(wc, cmd);
|
||||
}
|
||||
|
||||
static inline int t1_getpins(struct t1 *wc, int inisr)
|
||||
/**
|
||||
* t1_getpins - Returns the value of the jumpers on the card.
|
||||
* @wc: The card to read from.
|
||||
* @pins: Pointer to u8 character to hold the pins value.
|
||||
*
|
||||
* Returns 0 on success, otherwise an error code.
|
||||
*
|
||||
*/
|
||||
static int t1_getpins(struct t1 *wc, u8 *pins)
|
||||
{
|
||||
struct command *cmd;
|
||||
unsigned long flags;
|
||||
unsigned long ret;
|
||||
|
||||
*pins = 0;
|
||||
|
||||
cmd = get_free_cmd(wc);
|
||||
BUG_ON(!cmd);
|
||||
|
||||
@@ -656,9 +665,9 @@ static inline int t1_getpins(struct t1 *wc, int inisr)
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
ret = cmd->data;
|
||||
*pins = cmd->data;
|
||||
free_cmd(wc, cmd);
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __t1xxp_set_clear(struct t1 *wc)
|
||||
@@ -1639,6 +1648,7 @@ static inline unsigned char t1_vpm_out(struct t1 *wc, int unit, const unsigned i
|
||||
|
||||
static int t1_hardware_post_init(struct t1 *wc)
|
||||
{
|
||||
int res;
|
||||
unsigned int reg;
|
||||
int x;
|
||||
|
||||
@@ -1649,10 +1659,12 @@ static int t1_hardware_post_init(struct t1 *wc)
|
||||
else
|
||||
wc->spantype = TYPE_T1;
|
||||
} else {
|
||||
if (t1_getpins(wc,0) & 0x01) /* returns 1 for T1 mode */
|
||||
wc->spantype = TYPE_T1;
|
||||
else
|
||||
wc->spantype = TYPE_E1;
|
||||
u8 pins;
|
||||
res = t1_getpins(wc, &pins);
|
||||
if (res)
|
||||
return res;
|
||||
|
||||
wc->spantype = (pins & 0x01) ? TYPE_T1 : TYPE_E1;
|
||||
}
|
||||
debug_printk(wc, 1, "spantype: %s\n", 1 == wc->spantype ? "T1" : "E1");
|
||||
|
||||
@@ -2327,7 +2339,13 @@ static int __devinit te12xp_init_one(struct pci_dev *pdev, const struct pci_devi
|
||||
free_wc(wc);
|
||||
return -EIO;
|
||||
}
|
||||
t1_hardware_post_init(wc);
|
||||
|
||||
res = t1_hardware_post_init(wc);
|
||||
if (res) {
|
||||
voicebus_release(&wc->vb);
|
||||
free_wc(wc);
|
||||
return res;
|
||||
}
|
||||
|
||||
for (x = 0; x < (wc->spantype == TYPE_E1 ? 31 : 24); x++) {
|
||||
if (!(wc->chans[x] = kmalloc(sizeof(*wc->chans[x]), GFP_KERNEL))) {
|
||||
@@ -2363,6 +2381,7 @@ static void __devexit te12xp_remove_one(struct pci_dev *pdev)
|
||||
remove_sysfs_files(wc);
|
||||
|
||||
clear_bit(INITIALIZED, &wc->bit_flags);
|
||||
smp_mb__after_clear_bit();
|
||||
|
||||
del_timer_sync(&wc->timer);
|
||||
flush_workqueue(wc->wq);
|
||||
|
||||
@@ -77,8 +77,6 @@
|
||||
#define TYPE_T1 1
|
||||
#define TYPE_E1 2
|
||||
|
||||
extern spinlock_t ifacelock;
|
||||
|
||||
struct command {
|
||||
struct list_head node;
|
||||
struct completion complete;
|
||||
|
||||
@@ -399,7 +399,7 @@ static xpd_t *FXS_card_new(xbus_t *xbus, int unit, int subunit, const xproto_tab
|
||||
else
|
||||
regular_channels = min(8, subunit_ports);
|
||||
channels = regular_channels;
|
||||
if(unit == 0)
|
||||
if(unit == 0 && subtype != 4)
|
||||
channels += 6; /* 2 DIGITAL OUTPUTS, 4 DIGITAL INPUTS */
|
||||
xpd = xpd_alloc(xbus, unit, subunit, subtype, subunits, sizeof(struct FXS_priv_data), proto_table, channels);
|
||||
if(!xpd)
|
||||
|
||||
@@ -68,7 +68,7 @@ struct counter {
|
||||
|
||||
static xbus_t *global_xbus;
|
||||
static bool tx_ready = 1;
|
||||
static spinlock_t tx_ready_lock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(tx_ready_lock);
|
||||
static struct xframe_queue txpool;
|
||||
static unsigned int pcm_in_pool_count;
|
||||
static bool disconnecting;
|
||||
|
||||
@@ -36,7 +36,7 @@ static int parport_toggles[8]; /* 8 bit flip-flop */
|
||||
void flip_parport_bit(unsigned char bitnum)
|
||||
{
|
||||
static unsigned char last_value;
|
||||
spinlock_t lock = SPIN_LOCK_UNLOCKED;
|
||||
DEFINE_SPINLOCK(lock);
|
||||
unsigned long flags;
|
||||
unsigned char mask;
|
||||
unsigned char value;
|
||||
|
||||
@@ -78,7 +78,7 @@ static void transport_init(xbus_t *xbus, struct xbus_ops *ops, ushort max_send_s
|
||||
static void transport_destroy(xbus_t *xbus);
|
||||
|
||||
/* Data structures */
|
||||
static spinlock_t xbuses_lock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(xbuses_lock);
|
||||
#ifdef CONFIG_PROC_FS
|
||||
static struct proc_dir_entry *proc_xbuses = NULL;
|
||||
#endif
|
||||
@@ -104,7 +104,7 @@ int xbus_check_unique(xbus_t *xbus)
|
||||
{
|
||||
if (!xbus)
|
||||
return -ENOENT;
|
||||
if (xbus->label) {
|
||||
if (xbus->label && *(xbus->label)) {
|
||||
xbus_t *xbus_old;
|
||||
|
||||
XBUS_DBG(DEVICES, xbus, "Checking LABEL='%s'\n", xbus->label);
|
||||
@@ -118,7 +118,7 @@ int xbus_check_unique(xbus_t *xbus)
|
||||
return -EBUSY;
|
||||
}
|
||||
} else {
|
||||
XBUS_NOTICE(xbus, "MISSING BOARD LABEL!!!\n");
|
||||
XBUS_NOTICE(xbus, "Missing board label (old Astribank?)\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -405,7 +405,7 @@ xpacket_t *xframe_next_packet(xframe_t *frm, int len)
|
||||
return (xpacket_t *)(frm->packets + newlen - len);
|
||||
}
|
||||
|
||||
static spinlock_t serialize_dump_xframe = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(serialize_dump_xframe);
|
||||
|
||||
static void do_hexdump(const char msg[], byte *data, uint16_t len)
|
||||
{
|
||||
|
||||
@@ -55,8 +55,8 @@ static struct xpp_ticker dahdi_ticker;
|
||||
* I.e: one of our AB or dahdi_ticker
|
||||
*/
|
||||
static struct xpp_ticker *ref_ticker = NULL;
|
||||
static spinlock_t ref_ticker_lock = SPIN_LOCK_UNLOCKED;
|
||||
static spinlock_t elect_syncer_lock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(ref_ticker_lock);
|
||||
static DEFINE_SPINLOCK(elect_syncer_lock);
|
||||
static bool force_dahdi_sync = 0; /* from /sys/bus/astribanks/drivers/xppdrv/sync */
|
||||
static xbus_t *global_ticker;
|
||||
static struct xpp_ticker global_ticks_series;
|
||||
|
||||
@@ -57,6 +57,7 @@ typedef unsigned gfp_t; /* Added in 2.6.14 */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
|
||||
/*
|
||||
* FIXME: Kludge for 2.6.19
|
||||
* bool is now defined as a proper boolean type (gcc _Bool)
|
||||
@@ -66,6 +67,12 @@ typedef unsigned gfp_t; /* Added in 2.6.14 */
|
||||
int name = init; \
|
||||
module_param(name, bool, perm); \
|
||||
MODULE_PARM_DESC(name, desc " [default " #init "]")
|
||||
#else
|
||||
#define DEF_PARM_BOOL(name, init, perm, desc) \
|
||||
bool name = init; \
|
||||
module_param(name, bool, perm); \
|
||||
MODULE_PARM_DESC(name, desc " [default " #init "]")
|
||||
#endif
|
||||
|
||||
#define DEF_PARM(type,name,init,perm,desc) \
|
||||
type name = init; \
|
||||
|
||||
@@ -242,7 +242,7 @@ struct xusb {
|
||||
|
||||
};
|
||||
|
||||
static spinlock_t xusb_lock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(xusb_lock);
|
||||
static xusb_t *xusb_array[MAX_BUSES] = {};
|
||||
static unsigned bus_count = 0;
|
||||
|
||||
|
||||
@@ -75,6 +75,12 @@ static const xproto_table_t *xproto_table(xpd_type_t cardtype)
|
||||
return xprotocol_tables[cardtype];
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
|
||||
#define MODULE_REFCOUNT_FORMAT "%s refcount was %d\n"
|
||||
#else
|
||||
#define MODULE_REFCOUNT_FORMAT "%s refcount was %lu\n"
|
||||
#endif
|
||||
|
||||
const xproto_table_t *xproto_get(xpd_type_t cardtype)
|
||||
{
|
||||
const xproto_table_t *xtable;
|
||||
@@ -94,7 +100,8 @@ const xproto_table_t *xproto_get(xpd_type_t cardtype)
|
||||
if(xtable) {
|
||||
BUG_ON(!xtable->owner);
|
||||
#ifdef CONFIG_MODULE_UNLOAD
|
||||
DBG(GENERAL, "%s refcount was %d\n", xtable->name, module_refcount(xtable->owner));
|
||||
DBG(GENERAL, MODULE_REFCOUNT_FORMAT, xtable->name,
|
||||
module_refcount(xtable->owner));
|
||||
#endif
|
||||
if(!try_module_get(xtable->owner)) {
|
||||
ERR("%s: try_module_get for %s failed.\n", __FUNCTION__, xtable->name);
|
||||
@@ -108,7 +115,8 @@ void xproto_put(const xproto_table_t *xtable)
|
||||
{
|
||||
BUG_ON(!xtable);
|
||||
#ifdef CONFIG_MODULE_UNLOAD
|
||||
DBG(GENERAL, "%s refcount was %d\n", xtable->name, module_refcount(xtable->owner));
|
||||
DBG(GENERAL, MODULE_REFCOUNT_FORMAT, xtable->name,
|
||||
module_refcount(xtable->owner));
|
||||
BUG_ON(module_refcount(xtable->owner) <= 0);
|
||||
#endif
|
||||
module_put(xtable->owner);
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#endif
|
||||
#include <linux/fs.h>
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#ifdef CONFIG_DAHDI_NET
|
||||
@@ -69,6 +70,10 @@
|
||||
#define DAHDI_IRQ_HANDLER(a) static irqreturn_t a(int irq, void *dev_id, struct pt_regs *regs)
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
|
||||
#define HAVE_NET_DEVICE_OPS
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
|
||||
#define DAHDI_IRQ_SHARED IRQF_SHARED
|
||||
#define DAHDI_IRQ_DISABLED IRQF_DISABLED
|
||||
@@ -87,7 +92,13 @@
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
|
||||
#define dev_name(dev) (dev)->bus_id
|
||||
# ifdef RHEL_RELEASE_VERSION
|
||||
# if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5, 6)
|
||||
#define dev_name(dev) ((dev)->bus_id)
|
||||
# endif
|
||||
# else
|
||||
#define dev_name(dev) ((dev)->bus_id)
|
||||
# endif
|
||||
#define dev_set_name(dev, format, ...) \
|
||||
snprintf((dev)->bus_id, BUS_ID_SIZE, format, ## __VA_ARGS__);
|
||||
#endif
|
||||
@@ -1279,6 +1290,10 @@ wait_for_completion_interruptible_timeout(struct completion *x,
|
||||
const struct pci_device_id _x[] __devinitdata
|
||||
#endif
|
||||
|
||||
#ifndef DEFINE_SPINLOCK
|
||||
#define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED
|
||||
#endif
|
||||
|
||||
#ifndef DMA_BIT_MASK
|
||||
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user