Compare commits

..

2 Commits

Author SHA1 Message Date
Shaun Ruffell
92d7118803 Importing files for 2.4.1-rc1 release.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/tags/2.4.1-rc1@9762 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-02-15 15:41:20 +00:00
Shaun Ruffell
e826ea22ee Creating tag for the release of dahdi-linux-2.4.1-rc1
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/tags/2.4.1-rc1@9761 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-02-15 15:24:56 +00:00
28 changed files with 3834 additions and 177 deletions

1
.version Normal file
View File

@@ -0,0 +1 @@
2.4.1-rc1

3700
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -386,8 +386,13 @@ 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;
@@ -1670,7 +1675,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;
@@ -3325,7 +3330,6 @@ 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:

View File

@@ -113,8 +113,13 @@ 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);
@@ -222,10 +227,16 @@ 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);
@@ -391,9 +402,6 @@ 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();

View File

@@ -42,7 +42,11 @@ 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;

View File

@@ -129,7 +129,11 @@ 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
@@ -397,7 +401,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 DEFINE_SPINLOCK(lock);
static spinlock_t lock = SPIN_LOCK_UNLOCKED;
unsigned long flags;
#endif

View File

@@ -57,7 +57,11 @@
#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;

View File

@@ -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 DEFINE_SPINLOCK(translock);
static spinlock_t translock = SPIN_LOCK_UNLOCKED;
EXPORT_SYMBOL(dahdi_transcoder_register);
EXPORT_SYMBOL(dahdi_transcoder_unregister);

View File

@@ -48,10 +48,10 @@ typedef struct _OCT6100_API_CHANNEL_TDM_
UINT8 byRoutPcmLaw : 1;
UINT8 bySoutPcmLaw : 1;
UINT8 byRinNumTssts : 2;
UINT8 bySinNumTssts : 2;
UINT8 byRoutNumTssts : 2;
UINT8 bySoutNumTssts : 2;
UINT8 byRinNumTssts : 1;
UINT8 bySinNumTssts : 1;
UINT8 byRoutNumTssts : 1;
UINT8 bySoutNumTssts : 1;
/* RIN port. */
UINT16 usRinTimeslot;
@@ -93,20 +93,19 @@ typedef struct _OCT6100_API_CHANNEL_VQE_
UINT8 fSoutAdaptiveNoiseReduction : 1;
UINT8 fDtmfToneRemoval : 1;
UINT8 fAcousticEcho : 1;
UINT8 byComfortNoiseMode : 2;
UINT8 byComfortNoiseMode : 1;
UINT8 fSoutNaturalListenerEnhancement : 1;
UINT8 fRoutNoiseReduction : 1;
UINT8 fEnableMusicProtection : 1;
UINT8 fIdleCodeDetection : 1;
UINT8 byAnrVoiceNoiseSegregation : 4;
UINT8 byAnrVoiceNoiseSegregation : 1;
UINT8 byDoubleTalkBehavior : 1;
UINT8 fSoutNoiseBleaching : 1;
UINT8 fSoutConferencingNoiseReduction : 1;
UINT8 byNonLinearityBehaviorA : 4;
UINT8 byNonLinearityBehaviorB : 4;
UINT8 bySoutAutomaticListenerEnhancementGainDb;
UINT8 bySoutNaturalListenerEnhancementGainDb;
UINT8 bySoutAutomaticListenerEnhancementGainDb : 1;
UINT8 byNonLinearityBehaviorA : 1;
UINT8 byNonLinearityBehaviorB : 1;
UINT8 bySoutNaturalListenerEnhancementGainDb : 1;
OCT_INT8 chRinAutomaticLevelControlTargetDb;
OCT_INT8 chSoutAutomaticLevelControlTargetDb;
@@ -135,15 +134,15 @@ typedef struct _OCT6100_API_CHANNEL_CODEC_
UINT8 byAdpcmNibblePosition : 1;
UINT8 fEnableSilenceSuppression : 1;
UINT8 byEncoderPort : 4;
UINT8 byDecoderPort : 4;
UINT8 byEncoderPort : 1;
UINT8 byEncodingRate : 1;
UINT8 byPhasingType : 2;
UINT8 byEncodingRate;
UINT8 byDecodingRate;
UINT8 byDecoderPort : 1;
UINT8 byDecodingRate : 1;
UINT16 byPhase;
UINT8 byPhase : 1;
UINT8 byPhasingType : 1;
} tOCT6100_API_CHANNEL_CODEC, *tPOCT6100_API_CHANNEL_CODEC;
typedef struct _OCT6100_API_CHANNEL_
@@ -164,7 +163,7 @@ typedef struct _OCT6100_API_CHANNEL_
UINT8 fEnableToneDisabler : 1;
/* Current echo operation mode. */
UINT8 byEchoOperationMode : 3;
UINT8 byEchoOperationMode : 1;
UINT8 byToneDisablerStatus : 1;
@@ -360,7 +359,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;
UINT8 byEntryOpenCnt : 1;
} tOCT6100_API_BIDIR_CHANNEL, *tPOCT6100_API_BIDIR_CHANNEL;

View File

@@ -1129,7 +1129,11 @@ 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)
{

View File

@@ -36,7 +36,6 @@
#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>

View File

@@ -35,16 +35,22 @@
#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 *
@@ -200,14 +206,23 @@ 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;

View File

@@ -2,7 +2,7 @@
* WCB410P Quad-BRI PCI Driver
* Written by Andrew Kohlsmith <akohlsmith@mixdown.ca>
*
* Copyright (C) 2009-2011 Digium, Inc.
* Copyright (C) 2009 Digium, Inc.
* All rights reserved.
*
*/
@@ -2303,9 +2303,6 @@ 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;
}

View File

@@ -763,9 +763,11 @@ 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);
@@ -2229,7 +2231,11 @@ 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)
{
@@ -2351,7 +2357,7 @@ static int __t4_findsync(struct t4 *wc)
while (p < 8) {
nonzero = 0;
for (x=0;cards[x];x++) {
for (i = 0; i < cards[x]->numspans; i++) {
for (i = 0; i < wc->numspans; i++) {
if (cards[x]->tspans[i]->syncpos) {
nonzero = 1;
if ((cards[x]->tspans[i]->syncpos == p) &&

View File

@@ -399,16 +399,22 @@ 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
}
@@ -493,7 +499,6 @@ 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)
{
@@ -501,15 +506,6 @@ 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)
@@ -673,11 +669,7 @@ 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,
@@ -699,14 +691,23 @@ 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
@@ -1614,20 +1615,6 @@ 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);
@@ -2172,13 +2159,12 @@ 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) &&
(G723_SID_BYTES != count)) {
if ((G723_5K_BYTES != count) && (G723_6K_BYTES != count)) {
DTE_DEBUG(DTE_DEBUG_GENERAL,
"Trying to transcode packet into G723 format " \
"that is %Zu bytes instead of the expected " \
"%d/%d/%d bytes.\n", count, G723_5K_BYTES,
G723_6K_BYTES, G723_SID_BYTES);
"%d/%d bytes.\n", count, G723_5K_BYTES,
G723_6K_BYTES);
return -EINVAL;
}
cpvt->timestamp += G723_SAMPLES;
@@ -2755,10 +2741,11 @@ 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);
@@ -2767,14 +2754,7 @@ _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) &&
@@ -2782,6 +2762,7 @@ wctc4xxp_stop_dma(struct wcdte *wc)
msleep(1);
}
#define MDIO_SHIFT_CLK 0x10000
#define MDIO_DATA_WRITE1 0x20000
#define MDIO_ENB 0x00000
@@ -3326,19 +3307,13 @@ 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");
reschedule_timer = 0;
break;
return;
}
/* ERROR: We've retried the command and
* haven't received the ACK or the response.

View File

@@ -921,8 +921,12 @@ 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 (4 == wc->desc->ports)
writechunk[EFRAME_SIZE + 2] = wc->tdm410leds;
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);
}
}
writechunk += (EFRAME_SIZE + EFRAME_GAP);
}
@@ -1817,8 +1821,7 @@ static void wctdm_fxs_off_hook(struct wctdm *wc, const int card)
SLIC_LF_ACTIVE_FWD;
break;
}
if ((fxs->lasttxhook & SLIC_LF_SETMASK) != SLIC_LF_OPEN)
wctdm_fxs_hooksig(wc, card, DAHDI_TXSIG_OFFHOOK);
wctdm_fxs_hooksig(wc, card, DAHDI_TXSIG_OFFHOOK);
dahdi_hooksig(wc->aspan->span.chans[card], DAHDI_RXSIG_OFFHOOK);
#ifdef DEBUG
@@ -1834,8 +1837,7 @@ 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);
if ((fxs->lasttxhook & SLIC_LF_SETMASK) != SLIC_LF_OPEN)
wctdm_fxs_hooksig(wc, card, DAHDI_TXSIG_ONHOOK);
wctdm_fxs_hooksig(wc, card, DAHDI_TXSIG_ONHOOK);
dahdi_hooksig(wc->aspan->span.chans[card], DAHDI_RXSIG_ONHOOK);
fxs->oldrxhook = 0;
}
@@ -4590,21 +4592,6 @@ 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;
@@ -4747,8 +4734,6 @@ __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;

View File

@@ -165,8 +165,7 @@ struct wctdm {
unsigned char rxident;
int flags[NUM_MODULES]; /* bitmap of board-specific + module-specific flags */
u8 ctlreg;
u8 tdm410leds;
unsigned char ctlreg; /* FIXME: something to do with VPM? */
int mods_per_board; /* maximum number of modules for this board */
int digi_mods; /* number of digital modules present */

View File

@@ -88,6 +88,7 @@ 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;
@@ -627,22 +628,12 @@ static void t1_setleds(struct t1 *wc, int leds)
submit_cmd(wc, cmd);
}
/**
* 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)
static inline int t1_getpins(struct t1 *wc, int inisr)
{
struct command *cmd;
unsigned long flags;
unsigned long ret;
*pins = 0;
cmd = get_free_cmd(wc);
BUG_ON(!cmd);
@@ -665,9 +656,9 @@ static int t1_getpins(struct t1 *wc, u8 *pins)
}
return ret;
}
*pins = cmd->data;
ret = cmd->data;
free_cmd(wc, cmd);
return 0;
return ret;
}
static void __t1xxp_set_clear(struct t1 *wc)
@@ -1648,7 +1639,6 @@ 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;
@@ -1659,12 +1649,10 @@ static int t1_hardware_post_init(struct t1 *wc)
else
wc->spantype = TYPE_T1;
} else {
u8 pins;
res = t1_getpins(wc, &pins);
if (res)
return res;
wc->spantype = (pins & 0x01) ? TYPE_T1 : TYPE_E1;
if (t1_getpins(wc,0) & 0x01) /* returns 1 for T1 mode */
wc->spantype = TYPE_T1;
else
wc->spantype = TYPE_E1;
}
debug_printk(wc, 1, "spantype: %s\n", 1 == wc->spantype ? "T1" : "E1");
@@ -2339,13 +2327,7 @@ static int __devinit te12xp_init_one(struct pci_dev *pdev, const struct pci_devi
free_wc(wc);
return -EIO;
}
res = t1_hardware_post_init(wc);
if (res) {
voicebus_release(&wc->vb);
free_wc(wc);
return res;
}
t1_hardware_post_init(wc);
for (x = 0; x < (wc->spantype == TYPE_E1 ? 31 : 24); x++) {
if (!(wc->chans[x] = kmalloc(sizeof(*wc->chans[x]), GFP_KERNEL))) {
@@ -2381,7 +2363,6 @@ 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);

View File

@@ -77,6 +77,8 @@
#define TYPE_T1 1
#define TYPE_E1 2
extern spinlock_t ifacelock;
struct command {
struct list_head node;
struct completion complete;

View File

@@ -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 && subtype != 4)
if(unit == 0)
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)

View File

@@ -68,7 +68,7 @@ struct counter {
static xbus_t *global_xbus;
static bool tx_ready = 1;
static DEFINE_SPINLOCK(tx_ready_lock);
static spinlock_t tx_ready_lock = SPIN_LOCK_UNLOCKED;
static struct xframe_queue txpool;
static unsigned int pcm_in_pool_count;
static bool disconnecting;

View File

@@ -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;
DEFINE_SPINLOCK(lock);
spinlock_t lock = SPIN_LOCK_UNLOCKED;
unsigned long flags;
unsigned char mask;
unsigned char value;

View File

@@ -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 DEFINE_SPINLOCK(xbuses_lock);
static spinlock_t xbuses_lock = SPIN_LOCK_UNLOCKED;
#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 && *(xbus->label)) {
if (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 (old Astribank?)\n");
XBUS_NOTICE(xbus, "MISSING BOARD LABEL!!!\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 DEFINE_SPINLOCK(serialize_dump_xframe);
static spinlock_t serialize_dump_xframe = SPIN_LOCK_UNLOCKED;
static void do_hexdump(const char msg[], byte *data, uint16_t len)
{

View File

@@ -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 DEFINE_SPINLOCK(ref_ticker_lock);
static DEFINE_SPINLOCK(elect_syncer_lock);
static spinlock_t ref_ticker_lock = SPIN_LOCK_UNLOCKED;
static spinlock_t elect_syncer_lock = SPIN_LOCK_UNLOCKED;
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;

View File

@@ -57,7 +57,6 @@ 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)
@@ -67,12 +66,6 @@ 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; \

View File

@@ -242,7 +242,7 @@ struct xusb {
};
static DEFINE_SPINLOCK(xusb_lock);
static spinlock_t xusb_lock = SPIN_LOCK_UNLOCKED;
static xusb_t *xusb_array[MAX_BUSES] = {};
static unsigned bus_count = 0;

View File

@@ -75,12 +75,6 @@ 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;
@@ -100,8 +94,7 @@ const xproto_table_t *xproto_get(xpd_type_t cardtype)
if(xtable) {
BUG_ON(!xtable->owner);
#ifdef CONFIG_MODULE_UNLOAD
DBG(GENERAL, MODULE_REFCOUNT_FORMAT, xtable->name,
module_refcount(xtable->owner));
DBG(GENERAL, "%s refcount was %d\n", 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);
@@ -115,8 +108,7 @@ void xproto_put(const xproto_table_t *xtable)
{
BUG_ON(!xtable);
#ifdef CONFIG_MODULE_UNLOAD
DBG(GENERAL, MODULE_REFCOUNT_FORMAT, xtable->name,
module_refcount(xtable->owner));
DBG(GENERAL, "%s refcount was %d\n", xtable->name, module_refcount(xtable->owner));
BUG_ON(module_refcount(xtable->owner) <= 0);
#endif
module_put(xtable->owner);

View File

@@ -43,7 +43,6 @@
#endif
#include <linux/fs.h>
#include <linux/kobject.h>
#include <linux/module.h>
#include <linux/ioctl.h>
#ifdef CONFIG_DAHDI_NET
@@ -70,10 +69,6 @@
#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
@@ -92,13 +87,7 @@
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
# 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_name(dev) (dev)->bus_id
#define dev_set_name(dev, format, ...) \
snprintf((dev)->bus_id, BUS_ID_SIZE, format, ## __VA_ARGS__);
#endif
@@ -1290,10 +1279,6 @@ 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