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
This commit is contained in:
Shaun Ruffell 2011-10-26 19:00:28 +00:00 committed by Tzafrir Cohen
parent a6824019fb
commit 8d23f878d4
11 changed files with 15 additions and 32 deletions

View File

@ -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); seq_printf(sfile, "\tE-bit error count: %d\n", s->count.ebit);
if (s->count.fas) if (s->count.fas)
seq_printf(sfile, "\tFAS error count: %d\n", s->count.fas); seq_printf(sfile, "\tFAS error count: %d\n", s->count.fas);
if (s->irqmisses) if (s->parent->irqmisses)
seq_printf(sfile, "\tIRQ misses: %d\n", s->irqmisses); seq_printf(sfile, "\tIRQ misses: %d\n", s->parent->irqmisses);
if (s->timingslips) if (s->timingslips)
seq_printf(sfile, "\tTiming slips: %d\n", s->timingslips); seq_printf(sfile, "\tTiming slips: %d\n", s->timingslips);
seq_printf(sfile, "\n"); 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.prbs = s->count.prbs;
spaninfo.errsec = s->count.errsec; 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.syncsrc = s->syncsrc; /* get active sync source */
spaninfo.totalchans = s->channels; spaninfo.totalchans = s->channels;
spaninfo.numchans = 0; spaninfo.numchans = 0;
@ -4256,7 +4256,7 @@ static int dahdi_ioctl_spanstat(struct file *file, unsigned long data)
} }
spaninfo.lbo = s->lbo; spaninfo.lbo = s->lbo;
spaninfo.lineconfig = s->lineconfig; spaninfo.lineconfig = s->lineconfig;
spaninfo.irq = s->irq; spaninfo.irq = 0;
spaninfo.linecompat = s->linecompat; spaninfo.linecompat = s->linecompat;
strlcpy(spaninfo.lboname, dahdi_lboname(s->lbo), strlcpy(spaninfo.lboname, dahdi_lboname(s->lbo),
sizeof(spaninfo.lboname)); 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.crc4count = s->count.crc4;
spaninfo_v1.ebitcount = s->count.ebit; spaninfo_v1.ebitcount = s->count.ebit;
spaninfo_v1.fascount = s->count.fas; spaninfo_v1.fascount = s->count.fas;
spaninfo_v1.irqmisses = s->irqmisses; spaninfo_v1.irqmisses = s->parent->irqmisses;
spaninfo_v1.syncsrc = s->syncsrc; spaninfo_v1.syncsrc = s->syncsrc;
spaninfo_v1.totalchans = s->channels; spaninfo_v1.totalchans = s->channels;
spaninfo_v1.numchans = 0; 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.lbo = s->lbo;
spaninfo_v1.lineconfig = s->lineconfig; spaninfo_v1.lineconfig = s->lineconfig;
spaninfo_v1.irq = s->irq; spaninfo_v1.irq = 0;
spaninfo_v1.linecompat = s->linecompat; spaninfo_v1.linecompat = s->linecompat;
strlcpy(spaninfo_v1.lboname, strlcpy(spaninfo_v1.lboname,
dahdi_lboname(s->lbo), dahdi_lboname(s->lbo),

View File

@ -219,8 +219,6 @@ span_attr(name, "%s\n");
span_attr(desc, "%s\n"); span_attr(desc, "%s\n");
span_attr(spantype, "%s\n"); span_attr(spantype, "%s\n");
span_attr(alarms, "0x%x\n"); span_attr(alarms, "0x%x\n");
span_attr(irq, "%d\n");
span_attr(irqmisses, "%d\n");
span_attr(lbo, "%d\n"); span_attr(lbo, "%d\n");
span_attr(syncsrc, "%d\n"); span_attr(syncsrc, "%d\n");
@ -254,8 +252,6 @@ static struct device_attribute span_dev_attrs[] = {
__ATTR_RO(spantype), __ATTR_RO(spantype),
__ATTR_RO(local_spanno), __ATTR_RO(local_spanno),
__ATTR_RO(alarms), __ATTR_RO(alarms),
__ATTR_RO(irq),
__ATTR_RO(irqmisses),
__ATTR_RO(lbo), __ATTR_RO(lbo),
__ATTR_RO(syncsrc), __ATTR_RO(syncsrc),
__ATTR_RO(is_digital), __ATTR_RO(is_digital),

View File

@ -2475,7 +2475,6 @@ static void init_spans(struct b4xxp *b4)
bspan = &b4->spans[i]; bspan = &b4->spans[i];
bspan->parent = b4; bspan->parent = b4;
bspan->span.irq = b4->pdev->irq;
bspan->span.spantype = (bspan->te_mode) ? "TE" : "NT"; bspan->span.spantype = (bspan->te_mode) ? "TE" : "NT";
bspan->span.offset = i; bspan->span.offset = i;
bspan->span.channels = WCB4XXP_CHANNELS_PER_SPAN; bspan->span.channels = WCB4XXP_CHANNELS_PER_SPAN;

View File

@ -666,7 +666,6 @@ static int wcfxo_initialize(struct wcfxo *wc)
wc->chan->chanpos = 1; wc->chan->chanpos = 1;
wc->span.chans = &wc->chan; wc->span.chans = &wc->chan;
wc->span.channels = 1; wc->span.channels = 1;
wc->span.irq = wc->dev->irq;
wc->span.flags = DAHDI_FLAG_RBS; wc->span.flags = DAHDI_FLAG_RBS;
wc->span.deflaw = DAHDI_LAW_MULAW; wc->span.deflaw = DAHDI_LAW_MULAW;
#ifdef ENABLE_TASKLETS #ifdef ENABLE_TASKLETS

View File

@ -786,7 +786,6 @@ static int t1xxp_software_init(struct t1xxp *wc)
if (!wc->ddev->location) if (!wc->ddev->location)
return -ENOMEM; return -ENOMEM;
wc->span.irq = wc->dev->irq;
wc->span.chans = wc->chans; wc->span.chans = wc->chans;
wc->span.flags = DAHDI_FLAG_RBS; wc->span.flags = DAHDI_FLAG_RBS;
if (wc->ise1) { if (wc->ise1) {
@ -918,10 +917,10 @@ static void t1xxp_receiveprep(struct t1xxp *wc, int ints)
if (((oldcan & 0xffff0000) >> 16) != CANARY) { if (((oldcan & 0xffff0000) >> 16) != CANARY) {
/* Check top part */ /* Check top part */
if (debug) printk(KERN_DEBUG "Expecting top %04x, got %04x\n", CANARY, (oldcan & 0xffff0000) >> 16); 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)) { } else if ((oldcan & 0xffff) != ((wc->canary - 1) & 0xffff)) {
if (debug) printk(KERN_DEBUG "Expecting bottom %d, got %d\n", wc->canary - 1, oldcan & 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 (y=0;y<DAHDI_CHUNKSIZE;y++) {
for (x=0;x<wc->span.channels;x++) { for (x=0;x<wc->span.channels;x++) {

View File

@ -1813,7 +1813,6 @@ static void init_spans(struct t4 *wc)
ts->span.spantype = "J1"; ts->span.spantype = "J1";
break; break;
} }
ts->span.irq = wc->dev->irq;
/* HDLC Specific init */ /* HDLC Specific init */
ts->sigchan = NULL; ts->sigchan = NULL;
@ -3569,13 +3568,10 @@ DAHDI_IRQ_HANDLER(t4_interrupt_gen2)
} }
if (needed_latency > wc->numbufs) { if (needed_latency > wc->numbufs) {
int x;
dev_info(&wc->dev->dev, "Need to increase " dev_info(&wc->dev->dev, "Need to increase "
"latency. Estimated latency should " "latency. Estimated latency should "
"be %d\n", needed_latency); "be %d\n", needed_latency);
for (x = 0; x < wc->numspans; x++) wc->ddev->irqmisses++;
wc->tspans[x]->span.irqmisses++;
wc->needed_latency = needed_latency; wc->needed_latency = needed_latency;
__t4_pci_out(wc, WC_DMACTRL, 0x00000000); __t4_pci_out(wc, WC_DMACTRL, 0x00000000);
set_bit(T4_CHANGE_LATENCY, &wc->checkflag); set_bit(T4_CHANGE_LATENCY, &wc->checkflag);

View File

@ -2398,7 +2398,6 @@ static int wctdm_initialize(struct wctdm *wc)
} }
wc->span.chans = wc->chans; wc->span.chans = wc->chans;
wc->span.channels = NUM_CARDS; wc->span.channels = NUM_CARDS;
wc->span.irq = wc->dev->irq;
wc->span.flags = DAHDI_FLAG_RBS; wc->span.flags = DAHDI_FLAG_RBS;
wc->span.ops = &wctdm_span_ops; wc->span.ops = &wctdm_span_ops;

View File

@ -1509,7 +1509,7 @@ static inline void wctdm_receiveprep(struct wctdm *wc, const u8 *sframe)
#endif #endif
_dahdi_receive(s); _dahdi_receive(s);
if (unlikely(irqmiss)) 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 digital_span, unsigned int card_position)
{ {
int x; int x;
struct pci_dev *pdev = wc->vb.pdev;
struct wctdm_chan *c; struct wctdm_chan *c;
struct wctdm_span *s; struct wctdm_span *s;
static int spancount; 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.channels = chancount;
s->span.irq = pdev->irq;
if (digital_span) { if (digital_span) {
wc->chans[chanoffset + 0]->chan.sigcap = DAHDI_SIG_CLEAR; wc->chans[chanoffset + 0]->chan.sigcap = DAHDI_SIG_CLEAR;

View File

@ -994,7 +994,6 @@ static int t1xxp_software_init(struct t1 *wc)
if (!wc->ddev->location) if (!wc->ddev->location)
return -ENOMEM; return -ENOMEM;
wc->span.irq = wc->dev->irq;
if (wc->spantype == TYPE_E1) { if (wc->spantype == TYPE_E1) {
if (unchannelized) if (unchannelized)
wc->span.channels = 32; wc->span.channels = 32;
@ -1129,10 +1128,10 @@ static void t1xxp_receiveprep(struct t1 *wc, int ints)
if (((oldcan & 0xffff0000) >> 16) != CANARY) { if (((oldcan & 0xffff0000) >> 16) != CANARY) {
/* Check top part */ /* Check top part */
if (debug) printk(KERN_DEBUG "Expecting top %04x, got %04x\n", CANARY, (oldcan & 0xffff0000) >> 16); 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)) { } else if ((oldcan & 0xffff) != ((wc->canary - 1) & 0xffff)) {
if (debug) printk(KERN_DEBUG "Expecting bottom %d, got %d\n", wc->canary - 1, oldcan & 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 (y=0;y<DAHDI_CHUNKSIZE;y++) {
for (x=0;x<wc->span.channels;x++) { for (x=0;x<wc->span.channels;x++) {

View File

@ -1835,8 +1835,6 @@ static int t1_software_init(struct t1 *wc, enum linemode type)
if (!wc->ddev->location) if (!wc->ddev->location)
return -ENOMEM; return -ENOMEM;
wc->span.irq = pdev->irq;
if (type == E1) { if (type == E1) {
wc->span.channels = 31; wc->span.channels = 31;
wc->span.spantype = "E1"; 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->rxident = eframe[EFRAME_SIZE + 1];
wc->statreg = eframe[EFRAME_SIZE + 2]; wc->statreg = eframe[EFRAME_SIZE + 2];
if (wc->rxident != expected) { if (wc->rxident != expected) {
wc->span.irqmisses++; wc->ddev->irqmisses++;
_resend_cmds(wc); _resend_cmds(wc);
if (unlikely(debug)) { if (unlikely(debug)) {
t1_info(wc, "oops: rxident=%d " t1_info(wc, "oops: rxident=%d "

View File

@ -904,6 +904,7 @@ struct dahdi_span_ops {
* a hardware_id). This should not change if the device is * a hardware_id). This should not change if the device is
* relocated to a different location (e.g: different PCI slot) * relocated to a different location (e.g: different PCI slot)
* @devicetype: What type of device this is. * @devicetype: What type of device this is.
* @irqmisses: Count of "interrupt misses" for this device.
* *
*/ */
struct dahdi_device { struct dahdi_device {
@ -913,6 +914,7 @@ struct dahdi_device {
const char *hardware_id; const char *hardware_id;
const char *devicetype; const char *devicetype;
struct device dev; struct device dev;
unsigned int irqmisses;
}; };
struct dahdi_span { struct dahdi_span {
@ -924,7 +926,6 @@ struct dahdi_span {
int alarms; /*!< Pending alarms on span */ int alarms; /*!< Pending alarms on span */
unsigned long flags; unsigned long flags;
u8 cannot_provide_timing:1; u8 cannot_provide_timing:1;
int irq; /*!< IRQ for this span's hardware */
int lbo; /*!< Span Line-Buildout */ int lbo; /*!< Span Line-Buildout */
int lineconfig; /*!< Span line configuration */ int lineconfig; /*!< Span line configuration */
int linecompat; /*!< Span line compatibility (0 for int linecompat; /*!< Span line compatibility (0 for
@ -938,7 +939,6 @@ struct dahdi_span {
int maintstat; /*!< Maintenance state */ int maintstat; /*!< Maintenance state */
int mainttimer; /*!< Maintenance timer */ int mainttimer; /*!< Maintenance timer */
int irqmisses; /*!< Interrupt misses */
int timingslips; /*!< Clock slips */ int timingslips; /*!< Clock slips */
struct dahdi_chan **chans; /*!< Member channel structures */ struct dahdi_chan **chans; /*!< Member channel structures */