[dahdi-commits] fjoe: freebsd/trunk r8738 - in /freebsd/trunk: drivers/dahdi/ drivers/dahdi/v...
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Tue Jun 1 12:46:02 CDT 2010
Author: fjoe
Date: Tue Jun 1 12:46:00 2010
New Revision: 8738
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8738
Log:
Define IRQ_NONE, IRQ_HANDLED and IRQ_RETVAL to reduce the number of
#ifdef __FreeBSD__.
Modified:
freebsd/trunk/drivers/dahdi/voicebus/voicebus.c
freebsd/trunk/drivers/dahdi/wcb4xxp/base.c
freebsd/trunk/drivers/dahdi/wcfxo.c
freebsd/trunk/drivers/dahdi/wct4xxp/base.c
freebsd/trunk/drivers/dahdi/wctdm.c
freebsd/trunk/drivers/dahdi/wcte11xp.c
freebsd/trunk/include/dahdi/compat/bsd.h
Modified: freebsd/trunk/drivers/dahdi/voicebus/voicebus.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/voicebus/voicebus.c?view=diff&rev=8738&r1=8737&r2=8738
==============================================================================
--- freebsd/trunk/drivers/dahdi/voicebus/voicebus.c (original)
+++ freebsd/trunk/drivers/dahdi/voicebus/voicebus.c Tue Jun 1 12:46:00 2010
@@ -1634,11 +1634,7 @@
int_status &= 0x7fff;
if (!int_status)
-#if defined(__FreeBSD__)
- return FILTER_STRAY;
-#else
return IRQ_NONE;
-#endif
if (unlikely((int_status &
(TX_UNAVAILABLE_INTERRUPT|RX_UNAVAILABLE_INTERRUPT)) &&
Modified: freebsd/trunk/drivers/dahdi/wcb4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wcb4xxp/base.c?view=diff&rev=8738&r1=8737&r2=8738
==============================================================================
--- freebsd/trunk/drivers/dahdi/wcb4xxp/base.c (original)
+++ freebsd/trunk/drivers/dahdi/wcb4xxp/base.c Tue Jun 1 12:46:00 2010
@@ -2488,11 +2488,7 @@
/* Make sure it's really for us */
status = __pci_in8(b4, R_STATUS);
if (!(status & HFC_INTS))
-#if defined(__FreeBSD__)
- return (FILTER_STRAY);
-#else
return IRQ_NONE;
-#endif
/*
* since the interrupt is for us, read in the FIFO and misc IRQ status registers.
@@ -2541,11 +2537,7 @@
#endif
b4xxp_bottom_half((unsigned long)b4);
-#if defined(__FreeBSD__)
- return (FILTER_HANDLED);
-#else
return IRQ_RETVAL(1);
-#endif
}
Modified: freebsd/trunk/drivers/dahdi/wcfxo.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wcfxo.c?view=diff&rev=8738&r1=8737&r2=8738
==============================================================================
--- freebsd/trunk/drivers/dahdi/wcfxo.c (original)
+++ freebsd/trunk/drivers/dahdi/wcfxo.c Tue Jun 1 12:46:00 2010
@@ -521,11 +521,7 @@
if (!ints)
-#if defined(__FreeBSD__)
- return FILTER_STRAY;
-#else
return IRQ_NONE;
-#endif
wcfxo_outb(wc, WC_INTSTAT, ints);
@@ -550,20 +546,12 @@
printk(KERN_INFO "FXO PCI Master abort\n");
/* Stop DMA andlet the watchdog start it again */
wcfxo_stop_dma(wc);
-#if defined(__FreeBSD__)
- return FILTER_HANDLED;
-#else
return IRQ_RETVAL(1);
-#endif
}
if (ints & 0x20) {
printk(KERN_INFO "PCI Target abort\n");
-#if defined(__FreeBSD__)
- return FILTER_HANDLED;
-#else
return IRQ_RETVAL(1);
-#endif
}
if (1 /* !(wc->report % 0xf) */) {
/* Check for BATTERY from register and debounce for 8 ms */
@@ -638,11 +626,7 @@
}
-#if defined(__FreeBSD__)
- return FILTER_HANDLED;
-#else
return IRQ_RETVAL(1);
-#endif
}
static int wcfxo_setreg(struct wcfxo *wc, unsigned char reg, unsigned char value)
Modified: freebsd/trunk/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wct4xxp/base.c?view=diff&rev=8738&r1=8737&r2=8738
==============================================================================
--- freebsd/trunk/drivers/dahdi/wct4xxp/base.c (original)
+++ freebsd/trunk/drivers/dahdi/wct4xxp/base.c Tue Jun 1 12:46:00 2010
@@ -3303,23 +3303,14 @@
}
/* Ignore if it's not for us */
- if (!status) {
-#if defined(__FreeBSD__)
- return FILTER_STRAY;
-#else
+ if (!status)
return IRQ_NONE;
-#endif
- }
__t4_pci_out(wc, WC_INTR, 0);
if (!wc->spansstarted) {
printk(KERN_NOTICE "Not prepped yet!\n");
-#if defined(__FreeBSD__)
- return FILTER_STRAY;
-#else
return IRQ_NONE;
-#endif
}
wc->intcount++;
@@ -3370,11 +3361,7 @@
spin_unlock_irqrestore(&wc->reglock, flags);
-#if defined(__FreeBSD__)
- return (FILTER_HANDLED);
-#else
return IRQ_RETVAL(1);
-#endif
}
#endif
@@ -3579,11 +3566,7 @@
spin_lock(&wc->reglock);
__t4_set_sclk_src(wc, WC_SELF, 0, 0);
spin_unlock(&wc->reglock);
-#if defined(__FreeBSD__)
- return (FILTER_HANDLED);
-#else
return IRQ_RETVAL(1);
-#endif
}
/* Make sure it's really for us */
@@ -3591,11 +3574,7 @@
/* Ignore if it's not for us */
if (!(status & 0x7)) {
-#if defined(__FreeBSD__)
- return (FILTER_STRAY);
-#else
return IRQ_NONE;
-#endif
}
#ifdef ENABLE_WORKQUEUES
@@ -3604,11 +3583,7 @@
if (unlikely(!wc->spansstarted)) {
printk(KERN_INFO "Not prepped yet!\n");
-#if defined(__FreeBSD__)
- return (FILTER_STRAY);
-#else
return IRQ_NONE;
-#endif
}
wc->intcount++;
Modified: freebsd/trunk/drivers/dahdi/wctdm.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wctdm.c?view=diff&rev=8738&r1=8737&r2=8738
==============================================================================
--- freebsd/trunk/drivers/dahdi/wctdm.c (original)
+++ freebsd/trunk/drivers/dahdi/wctdm.c Tue Jun 1 12:46:00 2010
@@ -1168,11 +1168,7 @@
ints = wctdm_inb(wc, WC_INTSTAT);
if (!ints)
-#if defined(__FreeBSD__)
- return FILTER_STRAY;
-#else
return IRQ_NONE;
-#endif
wctdm_outb(wc, WC_INTSTAT, ints);
@@ -1180,20 +1176,12 @@
/* Stop DMA, wait for watchdog */
printk(KERN_INFO "TDM PCI Master abort\n");
wctdm_stop_dma(wc);
-#if defined(__FreeBSD__)
- return FILTER_HANDLED;
-#else
return IRQ_RETVAL(1);
-#endif
}
if (ints & 0x20) {
printk(KERN_INFO "PCI Target abort\n");
-#if defined(__FreeBSD__)
- return FILTER_HANDLED;
-#else
return IRQ_RETVAL(1);
-#endif
}
for (x=0;x<4;x++) {
@@ -1293,11 +1281,7 @@
wctdm_transmitprep(wc, ints);
}
-#if defined(__FreeBSD__)
- return FILTER_HANDLED;
-#else
return IRQ_RETVAL(1);
-#endif
}
static int wctdm_voicedaa_insane(struct wctdm *wc, int card)
Modified: freebsd/trunk/drivers/dahdi/wcte11xp.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wcte11xp.c?view=diff&rev=8738&r1=8737&r2=8738
==============================================================================
--- freebsd/trunk/drivers/dahdi/wcte11xp.c (original)
+++ freebsd/trunk/drivers/dahdi/wcte11xp.c Tue Jun 1 12:46:00 2010
@@ -1397,11 +1397,7 @@
ints = t1xxp_inb(wc, WC_INTSTAT);
if (!ints)
-#if defined(__FreeBSD__)
- return FILTER_STRAY;
-#else
return IRQ_NONE;
-#endif
t1xxp_outb(wc, WC_INTSTAT, ints);
@@ -1450,11 +1446,7 @@
if (ints & 0x20)
printk(KERN_NOTICE "PCI Target abort\n");
-#if defined(__FreeBSD__)
- return FILTER_HANDLED;
-#else
return IRQ_RETVAL(1);
-#endif
}
static int t1xxp_hardware_init(struct t1 *wc)
Modified: freebsd/trunk/include/dahdi/compat/bsd.h
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/include/dahdi/compat/bsd.h?view=diff&rev=8738&r1=8737&r2=8738
==============================================================================
--- freebsd/trunk/include/dahdi/compat/bsd.h (original)
+++ freebsd/trunk/include/dahdi/compat/bsd.h Tue Jun 1 12:46:00 2010
@@ -455,6 +455,10 @@
extern u_short fcstab[256];
+#define IRQ_NONE FILTER_STRAY
+#define IRQ_HANDLED FILTER_HANDLED
+#define IRQ_RETVAL(x) ((x) ? FILTER_HANDLED : FILTER_STRAY)
+
/*
* DMA API
*/
More information about the dahdi-commits
mailing list