From f900e1f229bbd4e04229052b18a1dc6cacbb0e52 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Thu, 3 Mar 2011 12:42:31 -0600 Subject: dahdi: Move irq/irqmisses from dahdi_span into dahdi_device. These fields do not have anything to do with the span. Signed-off-by: Shaun Ruffell --- drivers/dahdi/dahdi-base.c | 12 ++++++------ drivers/dahdi/dahdi-sysfs.c | 4 ---- drivers/dahdi/tor2.c | 1 + drivers/dahdi/wcb4xxp/base.c | 2 +- drivers/dahdi/wcfxo.c | 2 +- drivers/dahdi/wct1xxp.c | 6 +++--- drivers/dahdi/wct4xxp/base.c | 6 +----- drivers/dahdi/wctdm.c | 4 +++- drivers/dahdi/wctdm24xxp/base.c | 5 ++--- drivers/dahdi/wcte11xp.c | 6 +++--- drivers/dahdi/wcte12xp/base.c | 5 ++--- drivers/dahdi/xpp/xpp_dahdi.c | 7 ------- 12 files changed, 23 insertions(+), 37 deletions(-) (limited to 'drivers') diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index a70deb3..e351217 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -863,8 +863,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"); @@ -4154,7 +4154,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; @@ -4164,7 +4164,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 = s->parent->irq; spaninfo.linecompat = s->linecompat; strlcpy(spaninfo.lboname, dahdi_lboname(s->lbo), sizeof(spaninfo.lboname)); @@ -4241,7 +4241,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; @@ -4251,7 +4251,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 = s->parent->irq; 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 02677dd..fbc02fc 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"); @@ -229,8 +227,6 @@ static struct device_attribute span_dev_attrs[] = { __ATTR_RO(desc), __ATTR_RO(spantype), __ATTR_RO(alarms), - __ATTR_RO(irq), - __ATTR_RO(irqmisses), __ATTR_RO(lbo), __ATTR_RO(syncsrc), __ATTR_NULL, diff --git a/drivers/dahdi/tor2.c b/drivers/dahdi/tor2.c index 32e8435..3de7f06 100644 --- a/drivers/dahdi/tor2.c +++ b/drivers/dahdi/tor2.c @@ -329,6 +329,7 @@ static int __devinit tor2_launch(struct tor2 *tor) tor->pci->bus->number, PCI_SLOT(tor->pci->devfn) + 1); + tor->ddev->irq = tor->pci->irq; if (!tor->ddev->location) return -ENOMEM; diff --git a/drivers/dahdi/wcb4xxp/base.c b/drivers/dahdi/wcb4xxp/base.c index 581c486..7e80400 100644 --- a/drivers/dahdi/wcb4xxp/base.c +++ b/drivers/dahdi/wcb4xxp/base.c @@ -2474,7 +2474,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; @@ -2935,6 +2934,7 @@ static int __devinit b4xx_probe(struct pci_dev *pdev, const struct pci_device_id b4->ddev->manufacturer = "Digium"; b4->ddev->devicetype = b4->variety; + b4->ddev->irq = b4->pdev->irq; b4->ddev->location = kasprintf(GFP_KERNEL, "PCI Bus %02d Slot %02d", b4->pdev->bus->number, PCI_SLOT(b4->pdev->devfn) + 1); diff --git a/drivers/dahdi/wcfxo.c b/drivers/dahdi/wcfxo.c index 948d299..fcfea9d 100644 --- a/drivers/dahdi/wcfxo.c +++ b/drivers/dahdi/wcfxo.c @@ -662,11 +662,11 @@ static int wcfxo_initialize(struct wcfxo *wc) wc->ddev->manufacturer = "Digium"; wc->ddev->devicetype = wc->variety; + wc->ddev->irq = wc->dev->irq; wc->chan->sigcap = DAHDI_SIG_FXSKS | DAHDI_SIG_FXSLS | DAHDI_SIG_SF; 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 373caa5..56e8b55 100644 --- a/drivers/dahdi/wct1xxp.c +++ b/drivers/dahdi/wct1xxp.c @@ -777,13 +777,13 @@ static int t1xxp_software_init(struct t1xxp *wc) snprintf(wc->span.desc, sizeof(wc->span.desc) - 1, "%s Card %d", wc->variety, wc->num); wc->ddev->manufacturer = "Digium"; wc->ddev->devicetype = wc->variety; + wc->ddev->irq = wc->dev->irq; wc->ddev->location = kasprintf(GFP_KERNEL, "PCI Bus %02d Slot %02d", wc->dev->bus->number, PCI_SLOT(wc->dev->devfn) + 1); 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) { @@ -915,10 +915,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;yspan.channels;x++) { diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c index b4a4206..5448455 100644 --- a/drivers/dahdi/wct4xxp/base.c +++ b/drivers/dahdi/wct4xxp/base.c @@ -2129,7 +2129,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; @@ -3920,13 +3919,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 143af0a..bd3c5b1 100644 --- a/drivers/dahdi/wctdm.c +++ b/drivers/dahdi/wctdm.c @@ -2393,11 +2393,13 @@ 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; wc->ddev = dahdi_create_device(); + if (!wc->ddev) + return -ENOMEM; + wc->ddev->irq = wc->dev->irq; list_add_tail(&wc->span.device_node, &wc->ddev->spans); if (dahdi_register_device(wc->ddev, &wc->dev->dev)) { printk(KERN_NOTICE "Unable to register span with DAHDI\n"); diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index e4587eb..babac2e 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -1388,7 +1388,7 @@ static inline void wctdm_receiveprep(struct wctdm *wc, const u8 *sframe) #endif _dahdi_receive(s); if (unlikely(irqmiss)) - ++s->irqmisses; + wc->ddev->irqmisses++; } } } @@ -4258,7 +4258,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; @@ -4323,7 +4322,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->mods[chanoffset + 0].chan->chan.sigcap = DAHDI_SIG_CLEAR; @@ -5497,6 +5495,7 @@ __wctdm_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) #endif wc->ddev = dahdi_create_device(); wc->ddev->manufacturer = "Digium"; + wc->ddev->irq = pdev->irq; wc->ddev->location = kasprintf(GFP_KERNEL, "PCI%s Bus %02d Slot %02d", (wc->desc->flags & FLAG_EXPRESS) ? " Express" : "", diff --git a/drivers/dahdi/wcte11xp.c b/drivers/dahdi/wcte11xp.c index bdf76c1..03d2f05 100644 --- a/drivers/dahdi/wcte11xp.c +++ b/drivers/dahdi/wcte11xp.c @@ -981,6 +981,7 @@ static int t1xxp_software_init(struct t1 *wc) t4_serial_setup(wc); wc->num = x; + wc->ddev->irq = wc->dev->irq; sprintf(wc->span.name, "WCT1/%d", wc->num); snprintf(wc->span.desc, sizeof(wc->span.desc) - 1, "%s Card %d", wc->variety, wc->num); wc->ddev->manufacturer = "Digium"; @@ -991,7 +992,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; @@ -1126,10 +1126,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;yspan.channels;x++) { diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c index 037fc9d..67100dc 100644 --- a/drivers/dahdi/wcte12xp/base.c +++ b/drivers/dahdi/wcte12xp/base.c @@ -1571,8 +1571,6 @@ static int t1_software_init(struct t1 *wc) if (!wc->ddev->location) return -ENOMEM; - wc->span.irq = pdev->irq; - if (wc->spantype == TYPE_E1) { wc->span.channels = 31; wc->span.spantype = "E1"; @@ -1991,7 +1989,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 " @@ -2285,6 +2283,7 @@ static int __devinit te12xp_init_one(struct pci_dev *pdev, const struct pci_devi INIT_LIST_HEAD(&wc->active_cmds); INIT_LIST_HEAD(&wc->pending_cmds); + wc->ddev->irq = pdev->irq; wc->variety = d->name; wc->txident = 1; diff --git a/drivers/dahdi/xpp/xpp_dahdi.c b/drivers/dahdi/xpp/xpp_dahdi.c index 99fb62d..4bd9287 100644 --- a/drivers/dahdi/xpp/xpp_dahdi.c +++ b/drivers/dahdi/xpp/xpp_dahdi.c @@ -1186,13 +1186,6 @@ int dahdi_register_xpd(xpd_t *xpd) */ phonedev->ddev->location = xbus->connector; - /* - * Who said a span and irq have 1-1 relationship? - * Also exporting this low-level detail isn't too wise. - * No irq's for you today! - */ - span->irq = 0; - snprintf(PHONEDEV(xpd).span.desc, MAX_SPANDESC, "Xorcom XPD #%02d/%1d%1d: %s", xbus->num, xpd->addr.unit, xpd->addr.subunit, xpd->type_name); XPD_DBG(GENERAL, xpd, "Registering span '%s'\n", PHONEDEV(xpd).span.desc); -- cgit v1.2.3