summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-10-26 19:00:28 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-10-26 19:00:28 +0000
commit835a0a722df18f4db9ccf5daf7bd54266d14e4a7 (patch)
treed657ae1054c91c3127088a14499582fad841c6af
parent581df51b0dfcf3148dad593cb13705fd6896d5ed (diff)
dahdi: Remove dahdi_span.irq and move dahdi_span.irqmisses into dahdi_device.
'irqmisses' is more a function of the device and there are better ways to get to IRQ for a device than storing it in any DAHDI structures. Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10276 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/dahdi-base.c12
-rw-r--r--drivers/dahdi/dahdi-sysfs.c4
-rw-r--r--drivers/dahdi/wcb4xxp/base.c1
-rw-r--r--drivers/dahdi/wcfxo.c1
-rw-r--r--drivers/dahdi/wct1xxp.c5
-rw-r--r--drivers/dahdi/wct4xxp/base.c6
-rw-r--r--drivers/dahdi/wctdm.c1
-rw-r--r--drivers/dahdi/wctdm24xxp/base.c4
-rw-r--r--drivers/dahdi/wcte11xp.c5
-rw-r--r--drivers/dahdi/wcte12xp/base.c4
-rw-r--r--include/dahdi/kernel.h4
11 files changed, 15 insertions, 32 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 6886195..041645c 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -845,8 +845,8 @@ static int dahdi_seq_show(struct seq_file *sfile, void *v)
seq_printf(sfile, "\tE-bit error count: %d\n", s->count.ebit);
if (s->count.fas)
seq_printf(sfile, "\tFAS error count: %d\n", s->count.fas);
- if (s->irqmisses)
- seq_printf(sfile, "\tIRQ misses: %d\n", s->irqmisses);
+ if (s->parent->irqmisses)
+ seq_printf(sfile, "\tIRQ misses: %d\n", s->parent->irqmisses);
if (s->timingslips)
seq_printf(sfile, "\tTiming slips: %d\n", s->timingslips);
seq_printf(sfile, "\n");
@@ -4246,7 +4246,7 @@ static int dahdi_ioctl_spanstat(struct file *file, unsigned long data)
spaninfo.prbs = s->count.prbs;
spaninfo.errsec = s->count.errsec;
- spaninfo.irqmisses = s->irqmisses; /* get IRQ miss count */
+ spaninfo.irqmisses = s->parent->irqmisses; /* get IRQ miss count */
spaninfo.syncsrc = s->syncsrc; /* get active sync source */
spaninfo.totalchans = s->channels;
spaninfo.numchans = 0;
@@ -4256,7 +4256,7 @@ static int dahdi_ioctl_spanstat(struct file *file, unsigned long data)
}
spaninfo.lbo = s->lbo;
spaninfo.lineconfig = s->lineconfig;
- spaninfo.irq = s->irq;
+ spaninfo.irq = 0;
spaninfo.linecompat = s->linecompat;
strlcpy(spaninfo.lboname, dahdi_lboname(s->lbo),
sizeof(spaninfo.lboname));
@@ -4333,7 +4333,7 @@ static int dahdi_ioctl_spanstat_v1(struct file *file, unsigned long data)
spaninfo_v1.crc4count = s->count.crc4;
spaninfo_v1.ebitcount = s->count.ebit;
spaninfo_v1.fascount = s->count.fas;
- spaninfo_v1.irqmisses = s->irqmisses;
+ spaninfo_v1.irqmisses = s->parent->irqmisses;
spaninfo_v1.syncsrc = s->syncsrc;
spaninfo_v1.totalchans = s->channels;
spaninfo_v1.numchans = 0;
@@ -4343,7 +4343,7 @@ static int dahdi_ioctl_spanstat_v1(struct file *file, unsigned long data)
}
spaninfo_v1.lbo = s->lbo;
spaninfo_v1.lineconfig = s->lineconfig;
- spaninfo_v1.irq = s->irq;
+ spaninfo_v1.irq = 0;
spaninfo_v1.linecompat = s->linecompat;
strlcpy(spaninfo_v1.lboname,
dahdi_lboname(s->lbo),
diff --git a/drivers/dahdi/dahdi-sysfs.c b/drivers/dahdi/dahdi-sysfs.c
index 16d19ef..20c83dd 100644
--- a/drivers/dahdi/dahdi-sysfs.c
+++ b/drivers/dahdi/dahdi-sysfs.c
@@ -219,8 +219,6 @@ span_attr(name, "%s\n");
span_attr(desc, "%s\n");
span_attr(spantype, "%s\n");
span_attr(alarms, "0x%x\n");
-span_attr(irq, "%d\n");
-span_attr(irqmisses, "%d\n");
span_attr(lbo, "%d\n");
span_attr(syncsrc, "%d\n");
@@ -254,8 +252,6 @@ static struct device_attribute span_dev_attrs[] = {
__ATTR_RO(spantype),
__ATTR_RO(local_spanno),
__ATTR_RO(alarms),
- __ATTR_RO(irq),
- __ATTR_RO(irqmisses),
__ATTR_RO(lbo),
__ATTR_RO(syncsrc),
__ATTR_RO(is_digital),
diff --git a/drivers/dahdi/wcb4xxp/base.c b/drivers/dahdi/wcb4xxp/base.c
index 72744f8..2255add 100644
--- a/drivers/dahdi/wcb4xxp/base.c
+++ b/drivers/dahdi/wcb4xxp/base.c
@@ -2475,7 +2475,6 @@ static void init_spans(struct b4xxp *b4)
bspan = &b4->spans[i];
bspan->parent = b4;
- bspan->span.irq = b4->pdev->irq;
bspan->span.spantype = (bspan->te_mode) ? "TE" : "NT";
bspan->span.offset = i;
bspan->span.channels = WCB4XXP_CHANNELS_PER_SPAN;
diff --git a/drivers/dahdi/wcfxo.c b/drivers/dahdi/wcfxo.c
index 948d299..b22586b 100644
--- a/drivers/dahdi/wcfxo.c
+++ b/drivers/dahdi/wcfxo.c
@@ -666,7 +666,6 @@ static int wcfxo_initialize(struct wcfxo *wc)
wc->chan->chanpos = 1;
wc->span.chans = &wc->chan;
wc->span.channels = 1;
- wc->span.irq = wc->dev->irq;
wc->span.flags = DAHDI_FLAG_RBS;
wc->span.deflaw = DAHDI_LAW_MULAW;
#ifdef ENABLE_TASKLETS
diff --git a/drivers/dahdi/wct1xxp.c b/drivers/dahdi/wct1xxp.c
index 686d0a7..1fe22e4 100644
--- a/drivers/dahdi/wct1xxp.c
+++ b/drivers/dahdi/wct1xxp.c
@@ -786,7 +786,6 @@ static int t1xxp_software_init(struct t1xxp *wc)
if (!wc->ddev->location)
return -ENOMEM;
- wc->span.irq = wc->dev->irq;
wc->span.chans = wc->chans;
wc->span.flags = DAHDI_FLAG_RBS;
if (wc->ise1) {
@@ -918,10 +917,10 @@ static void t1xxp_receiveprep(struct t1xxp *wc, int ints)
if (((oldcan & 0xffff0000) >> 16) != CANARY) {
/* Check top part */
if (debug) printk(KERN_DEBUG "Expecting top %04x, got %04x\n", CANARY, (oldcan & 0xffff0000) >> 16);
- wc->span.irqmisses++;
+ wc->ddev->irqmisses++;
} else if ((oldcan & 0xffff) != ((wc->canary - 1) & 0xffff)) {
if (debug) printk(KERN_DEBUG "Expecting bottom %d, got %d\n", wc->canary - 1, oldcan & 0xffff);
- wc->span.irqmisses++;
+ wc->ddev->irqmisses++;
}
for (y=0;y<DAHDI_CHUNKSIZE;y++) {
for (x=0;x<wc->span.channels;x++) {
diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c
index 4bdea1f..a58fd99 100644
--- a/drivers/dahdi/wct4xxp/base.c
+++ b/drivers/dahdi/wct4xxp/base.c
@@ -1813,7 +1813,6 @@ static void init_spans(struct t4 *wc)
ts->span.spantype = "J1";
break;
}
- ts->span.irq = wc->dev->irq;
/* HDLC Specific init */
ts->sigchan = NULL;
@@ -3569,13 +3568,10 @@ DAHDI_IRQ_HANDLER(t4_interrupt_gen2)
}
if (needed_latency > wc->numbufs) {
- int x;
-
dev_info(&wc->dev->dev, "Need to increase "
"latency. Estimated latency should "
"be %d\n", needed_latency);
- for (x = 0; x < wc->numspans; x++)
- wc->tspans[x]->span.irqmisses++;
+ wc->ddev->irqmisses++;
wc->needed_latency = needed_latency;
__t4_pci_out(wc, WC_DMACTRL, 0x00000000);
set_bit(T4_CHANGE_LATENCY, &wc->checkflag);
diff --git a/drivers/dahdi/wctdm.c b/drivers/dahdi/wctdm.c
index 5b13fee..021cfd9 100644
--- a/drivers/dahdi/wctdm.c
+++ b/drivers/dahdi/wctdm.c
@@ -2398,7 +2398,6 @@ static int wctdm_initialize(struct wctdm *wc)
}
wc->span.chans = wc->chans;
wc->span.channels = NUM_CARDS;
- wc->span.irq = wc->dev->irq;
wc->span.flags = DAHDI_FLAG_RBS;
wc->span.ops = &wctdm_span_ops;
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index aabee02..b3515f5 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -1509,7 +1509,7 @@ static inline void wctdm_receiveprep(struct wctdm *wc, const u8 *sframe)
#endif
_dahdi_receive(s);
if (unlikely(irqmiss))
- ++s->irqmisses;
+ wc->ddev->irqmisses++;
}
}
}
@@ -4479,7 +4479,6 @@ wctdm_init_span(struct wctdm *wc, int spanno, int chanoffset, int chancount,
int digital_span, unsigned int card_position)
{
int x;
- struct pci_dev *pdev = wc->vb.pdev;
struct wctdm_chan *c;
struct wctdm_span *s;
static int spancount;
@@ -4543,7 +4542,6 @@ wctdm_init_span(struct wctdm *wc, int spanno, int chanoffset, int chancount,
}
s->span.channels = chancount;
- s->span.irq = pdev->irq;
if (digital_span) {
wc->chans[chanoffset + 0]->chan.sigcap = DAHDI_SIG_CLEAR;
diff --git a/drivers/dahdi/wcte11xp.c b/drivers/dahdi/wcte11xp.c
index b2eab8d..05a9f95 100644
--- a/drivers/dahdi/wcte11xp.c
+++ b/drivers/dahdi/wcte11xp.c
@@ -994,7 +994,6 @@ static int t1xxp_software_init(struct t1 *wc)
if (!wc->ddev->location)
return -ENOMEM;
- wc->span.irq = wc->dev->irq;
if (wc->spantype == TYPE_E1) {
if (unchannelized)
wc->span.channels = 32;
@@ -1129,10 +1128,10 @@ static void t1xxp_receiveprep(struct t1 *wc, int ints)
if (((oldcan & 0xffff0000) >> 16) != CANARY) {
/* Check top part */
if (debug) printk(KERN_DEBUG "Expecting top %04x, got %04x\n", CANARY, (oldcan & 0xffff0000) >> 16);
- wc->span.irqmisses++;
+ wc->ddev->irqmisses++;
} else if ((oldcan & 0xffff) != ((wc->canary - 1) & 0xffff)) {
if (debug) printk(KERN_DEBUG "Expecting bottom %d, got %d\n", wc->canary - 1, oldcan & 0xffff);
- wc->span.irqmisses++;
+ wc->ddev->irqmisses++;
}
for (y=0;y<DAHDI_CHUNKSIZE;y++) {
for (x=0;x<wc->span.channels;x++) {
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c
index bfd6190..53c4f7a 100644
--- a/drivers/dahdi/wcte12xp/base.c
+++ b/drivers/dahdi/wcte12xp/base.c
@@ -1835,8 +1835,6 @@ static int t1_software_init(struct t1 *wc, enum linemode type)
if (!wc->ddev->location)
return -ENOMEM;
- wc->span.irq = pdev->irq;
-
if (type == E1) {
wc->span.channels = 31;
wc->span.spantype = "E1";
@@ -2293,7 +2291,7 @@ static inline void t1_receiveprep(struct t1 *wc, const u8* sframe)
wc->rxident = eframe[EFRAME_SIZE + 1];
wc->statreg = eframe[EFRAME_SIZE + 2];
if (wc->rxident != expected) {
- wc->span.irqmisses++;
+ wc->ddev->irqmisses++;
_resend_cmds(wc);
if (unlikely(debug)) {
t1_info(wc, "oops: rxident=%d "
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index bb32126..b4df850 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -904,6 +904,7 @@ struct dahdi_span_ops {
* a hardware_id). This should not change if the device is
* relocated to a different location (e.g: different PCI slot)
* @devicetype: What type of device this is.
+ * @irqmisses: Count of "interrupt misses" for this device.
*
*/
struct dahdi_device {
@@ -913,6 +914,7 @@ struct dahdi_device {
const char *hardware_id;
const char *devicetype;
struct device dev;
+ unsigned int irqmisses;
};
struct dahdi_span {
@@ -924,7 +926,6 @@ struct dahdi_span {
int alarms; /*!< Pending alarms on span */
unsigned long flags;
u8 cannot_provide_timing:1;
- int irq; /*!< IRQ for this span's hardware */
int lbo; /*!< Span Line-Buildout */
int lineconfig; /*!< Span line configuration */
int linecompat; /*!< Span line compatibility (0 for
@@ -938,7 +939,6 @@ struct dahdi_span {
int maintstat; /*!< Maintenance state */
int mainttimer; /*!< Maintenance timer */
- int irqmisses; /*!< Interrupt misses */
int timingslips; /*!< Clock slips */
struct dahdi_chan **chans; /*!< Member channel structures */