[svn-commits] fjoe: freebsd/trunk r10469 - in /freebsd/trunk: drivers/dahdi/ drivers/dahdi/...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Feb 26 14:49:10 CST 2012


Author: fjoe
Date: Sun Feb 26 14:49:03 2012
New Revision: 10469

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10469
Log:
Emulate Linux KAPI better: split emulation layer to separate includes.

Added:
    freebsd/trunk/freebsd/dahdi/dahdi-bsd.c   (with props)
    freebsd/trunk/include/asm/
    freebsd/trunk/include/asm/atomic.h   (with props)
    freebsd/trunk/include/asm/bug.h   (with props)
    freebsd/trunk/include/asm/byteorder.h   (with props)
    freebsd/trunk/include/linux/
    freebsd/trunk/include/linux/bitops.h   (with props)
    freebsd/trunk/include/linux/compiler.h   (with props)
    freebsd/trunk/include/linux/completion.h   (with props)
    freebsd/trunk/include/linux/ctype.h   (with props)
    freebsd/trunk/include/linux/delay.h   (with props)
    freebsd/trunk/include/linux/device.h   (with props)
    freebsd/trunk/include/linux/errno.h   (with props)
    freebsd/trunk/include/linux/fcntl.h   (with props)
    freebsd/trunk/include/linux/firmware.h   (with props)
    freebsd/trunk/include/linux/fs.h   (with props)
    freebsd/trunk/include/linux/gfp.h   (with props)
    freebsd/trunk/include/linux/if.h   (with props)
    freebsd/trunk/include/linux/if_ether.h   (with props)
    freebsd/trunk/include/linux/init.h   (with props)
    freebsd/trunk/include/linux/interrupt.h   (with props)
    freebsd/trunk/include/linux/io.h   (with props)
    freebsd/trunk/include/linux/ioctl.h   (with props)
    freebsd/trunk/include/linux/irqreturn.h   (with props)
    freebsd/trunk/include/linux/jiffies.h   (with props)
    freebsd/trunk/include/linux/kernel.h   (with props)
    freebsd/trunk/include/linux/kmod.h   (with props)
    freebsd/trunk/include/linux/list.h   (with props)
    freebsd/trunk/include/linux/mm.h   (with props)
    freebsd/trunk/include/linux/mod_devicetable.h   (with props)
    freebsd/trunk/include/linux/module.h   (with props)
    freebsd/trunk/include/linux/moduleparam.h   (with props)
    freebsd/trunk/include/linux/netdevice.h   (with props)
    freebsd/trunk/include/linux/pci.h   (with props)
    freebsd/trunk/include/linux/poison.h   (with props)
    freebsd/trunk/include/linux/poll.h   (with props)
    freebsd/trunk/include/linux/ppp_defs.h   (with props)
    freebsd/trunk/include/linux/prefetch.h   (with props)
    freebsd/trunk/include/linux/rwlock.h   (with props)
    freebsd/trunk/include/linux/rwlock_types.h   (with props)
    freebsd/trunk/include/linux/sched.h   (with props)
    freebsd/trunk/include/linux/semaphore.h   (with props)
    freebsd/trunk/include/linux/skbuff.h   (with props)
    freebsd/trunk/include/linux/slab.h   (with props)
    freebsd/trunk/include/linux/spinlock.h   (with props)
    freebsd/trunk/include/linux/spinlock_types.h   (with props)
    freebsd/trunk/include/linux/stat.h   (with props)
    freebsd/trunk/include/linux/stddef.h   (with props)
    freebsd/trunk/include/linux/string.h   (with props)
    freebsd/trunk/include/linux/termios.h   (with props)
    freebsd/trunk/include/linux/timer.h   (with props)
    freebsd/trunk/include/linux/tty.h   (with props)
    freebsd/trunk/include/linux/types.h   (with props)
    freebsd/trunk/include/linux/uaccess.h   (with props)
    freebsd/trunk/include/linux/uio.h   (with props)
    freebsd/trunk/include/linux/version.h   (with props)
    freebsd/trunk/include/linux/wait.h   (with props)
    freebsd/trunk/include/linux/workqueue.h   (with props)
Removed:
    freebsd/trunk/include/dahdi/compat/
Modified:
    freebsd/trunk/drivers/dahdi/adt_lec.c
    freebsd/trunk/drivers/dahdi/dahdi-base.c
    freebsd/trunk/drivers/dahdi/dahdi_dynamic.c
    freebsd/trunk/drivers/dahdi/dahdi_dynamic_eth.c
    freebsd/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c
    freebsd/trunk/drivers/dahdi/dahdi_dynamic_loc.c
    freebsd/trunk/drivers/dahdi/dahdi_echocan_jpah.c
    freebsd/trunk/drivers/dahdi/dahdi_echocan_kb1.c
    freebsd/trunk/drivers/dahdi/dahdi_echocan_mg2.c
    freebsd/trunk/drivers/dahdi/dahdi_echocan_oslec.c
    freebsd/trunk/drivers/dahdi/dahdi_echocan_sec.c
    freebsd/trunk/drivers/dahdi/dahdi_echocan_sec2.c
    freebsd/trunk/drivers/dahdi/dahdi_transcode.c
    freebsd/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
    freebsd/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c
    freebsd/trunk/drivers/dahdi/voicebus/GpakCust.c
    freebsd/trunk/drivers/dahdi/voicebus/GpakCust.h
    freebsd/trunk/drivers/dahdi/voicebus/voicebus.c
    freebsd/trunk/drivers/dahdi/voicebus/voicebus.h
    freebsd/trunk/drivers/dahdi/voicebus/voicebus_net.c
    freebsd/trunk/drivers/dahdi/vpmadt032_loader/dahdi_vpmadt032_loader.c
    freebsd/trunk/drivers/dahdi/wcb4xxp/base.c
    freebsd/trunk/drivers/dahdi/wcb4xxp/wcb4xxp.h
    freebsd/trunk/drivers/dahdi/wcfxo.c
    freebsd/trunk/drivers/dahdi/wct4xxp/base.c
    freebsd/trunk/drivers/dahdi/wct4xxp/vpm450m.c
    freebsd/trunk/drivers/dahdi/wct4xxp/vpm450m.h
    freebsd/trunk/drivers/dahdi/wct4xxp/wct4xxp.h
    freebsd/trunk/drivers/dahdi/wctc4xxp/base.c
    freebsd/trunk/drivers/dahdi/wctdm.c
    freebsd/trunk/drivers/dahdi/wctdm24xxp/base.c
    freebsd/trunk/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
    freebsd/trunk/drivers/dahdi/wctdm24xxp/xhfc.c
    freebsd/trunk/drivers/dahdi/wcte11xp.c
    freebsd/trunk/drivers/dahdi/wcte12xp/base.c
    freebsd/trunk/freebsd/Makefile.inc
    freebsd/trunk/freebsd/dahdi/Makefile
    freebsd/trunk/freebsd/dahdi/bsd-compat.c
    freebsd/trunk/freebsd/dahdi/ng_dahdi_iface.c
    freebsd/trunk/freebsd/dahdi_dynamic/Makefile
    freebsd/trunk/freebsd/dahdi_dynamic_eth/Makefile
    freebsd/trunk/freebsd/dahdi_dynamic_ethmf/Makefile
    freebsd/trunk/freebsd/dahdi_dynamic_loc/Makefile
    freebsd/trunk/freebsd/dahdi_transcode/Makefile
    freebsd/trunk/freebsd/ng_dahdi_netdev/Makefile
    freebsd/trunk/freebsd/ng_dahdi_netdev/ng_dahdi_netdev.c
    freebsd/trunk/freebsd/ng_dahdi_netdev/ng_dahdi_netdev.h
    freebsd/trunk/include/dahdi/kernel.h
    freebsd/trunk/include/dahdi/user.h

Modified: freebsd/trunk/drivers/dahdi/adt_lec.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/adt_lec.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/adt_lec.c (original)
+++ freebsd/trunk/drivers/dahdi/adt_lec.c Sun Feb 26 14:49:03 2012
@@ -25,11 +25,7 @@
 #ifndef _ADT_LEC_C
 #define _ADT_LEC_C
 
-#if defined(__FreeBSD__)
-#include <sys/ctype.h>
-#else /* !__FreeBSD__ */
 #include <linux/ctype.h>
-#endif /* !__FreeBSD__ */
 
 static inline void adt_lec_init_defaults(struct adt_lec_params *params, __u32 tap_length)
 {

Modified: freebsd/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi-base.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi-base.c Sun Feb 26 14:49:03 2012
@@ -34,30 +34,15 @@
  * this program for more details.
  */
 
-#if defined(__FreeBSD__)
-#include <sys/param.h>
-#include <sys/bus.h>
-#include <sys/conf.h>
-#include <sys/ctype.h>
-#include <sys/kernel.h>
-#include <sys/fcntl.h>
-#include <sys/ioccom.h>
-#include <sys/filio.h>
-#include <sys/libkern.h>
-#include <sys/malloc.h>
-#include <sys/module.h>
-#include <sys/poll.h>
-#include <net/ppp_defs.h>
-
-#include "version.h"
-
-#define MODULE_PARAM_PREFIX "dahdi"
-#define MODULE_PARAM_PARENT _dahdi
-#else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/module.h>
+#if defined(__FreeBSD__)
+#include <linux/slab.h>	/* linux/proc_fs.h */
+#include <sys/filio.h>
+#else
 #include <linux/proc_fs.h>
+#endif
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/version.h>
@@ -76,12 +61,6 @@
 #include <asm/atomic.h>
 
 #include <dahdi/version.h>
-
-#define FOP_READ_ARGS_DECL	struct file *file, char __user *usrbuf, size_t count, loff_t *ppos
-#define FOP_READ_ARGS		file, usrbuf, count, ppos
-#define FOP_WRITE_ARGS_DECL	struct file *file, const char __user *usrbuf, size_t count, loff_t *ppos
-#define FOP_WRITE_ARGS		file, usrbuf, count, ppos
-#endif /* !__FreeBSD__ */
 
 #define module_printk(level, fmt, args...) printk(level "%s: " fmt, THIS_MODULE->name, ## args)
 
@@ -139,45 +118,16 @@
 #if defined(__FreeBSD__)
 #include "ng_dahdi_iface.h"
 
-MALLOC_DEFINE(M_DAHDI, "dahdi", "DAHDI interface data structures");
-
 /*
- * FCS lookup table as calculated by genfcstab.
+ * ioctl argument is in kernel space in FreeBSD
  */
-u_short fcstab[256] = {
-	0x0000,	0x1189,	0x2312,	0x329b,	0x4624,	0x57ad,	0x6536,	0x74bf,
-	0x8c48,	0x9dc1,	0xaf5a,	0xbed3,	0xca6c,	0xdbe5,	0xe97e,	0xf8f7,
-	0x1081,	0x0108,	0x3393,	0x221a,	0x56a5,	0x472c,	0x75b7,	0x643e,
-	0x9cc9,	0x8d40,	0xbfdb,	0xae52,	0xdaed,	0xcb64,	0xf9ff,	0xe876,
-	0x2102,	0x308b,	0x0210,	0x1399,	0x6726,	0x76af,	0x4434,	0x55bd,
-	0xad4a,	0xbcc3,	0x8e58,	0x9fd1,	0xeb6e,	0xfae7,	0xc87c,	0xd9f5,
-	0x3183,	0x200a,	0x1291,	0x0318,	0x77a7,	0x662e,	0x54b5,	0x453c,
-	0xbdcb,	0xac42,	0x9ed9,	0x8f50,	0xfbef,	0xea66,	0xd8fd,	0xc974,
-	0x4204,	0x538d,	0x6116,	0x709f,	0x0420,	0x15a9,	0x2732,	0x36bb,
-	0xce4c,	0xdfc5,	0xed5e,	0xfcd7,	0x8868,	0x99e1,	0xab7a,	0xbaf3,
-	0x5285,	0x430c,	0x7197,	0x601e,	0x14a1,	0x0528,	0x37b3,	0x263a,
-	0xdecd,	0xcf44,	0xfddf,	0xec56,	0x98e9,	0x8960,	0xbbfb,	0xaa72,
-	0x6306,	0x728f,	0x4014,	0x519d,	0x2522,	0x34ab,	0x0630,	0x17b9,
-	0xef4e,	0xfec7,	0xcc5c,	0xddd5,	0xa96a,	0xb8e3,	0x8a78,	0x9bf1,
-	0x7387,	0x620e,	0x5095,	0x411c,	0x35a3,	0x242a,	0x16b1,	0x0738,
-	0xffcf,	0xee46,	0xdcdd,	0xcd54,	0xb9eb,	0xa862,	0x9af9,	0x8b70,
-	0x8408,	0x9581,	0xa71a,	0xb693,	0xc22c,	0xd3a5,	0xe13e,	0xf0b7,
-	0x0840,	0x19c9,	0x2b52,	0x3adb,	0x4e64,	0x5fed,	0x6d76,	0x7cff,
-	0x9489,	0x8500,	0xb79b,	0xa612,	0xd2ad,	0xc324,	0xf1bf,	0xe036,
-	0x18c1,	0x0948,	0x3bd3,	0x2a5a,	0x5ee5,	0x4f6c,	0x7df7,	0x6c7e,
-	0xa50a,	0xb483,	0x8618,	0x9791,	0xe32e,	0xf2a7,	0xc03c,	0xd1b5,
-	0x2942,	0x38cb,	0x0a50,	0x1bd9,	0x6f66,	0x7eef,	0x4c74,	0x5dfd,
-	0xb58b,	0xa402,	0x9699,	0x8710,	0xf3af,	0xe226,	0xd0bd,	0xc134,
-	0x39c3,	0x284a,	0x1ad1,	0x0b58,	0x7fe7,	0x6e6e,	0x5cf5,	0x4d7c,
-	0xc60c,	0xd785,	0xe51e,	0xf497,	0x8028,	0x91a1,	0xa33a,	0xb2b3,
-	0x4a44,	0x5bcd,	0x6956,	0x78df,	0x0c60,	0x1de9,	0x2f72,	0x3efb,
-	0xd68d,	0xc704,	0xf59f,	0xe416,	0x90a9,	0x8120,	0xb3bb,	0xa232,
-	0x5ac5,	0x4b4c,	0x79d7,	0x685e,	0x1ce1,	0x0d68,	0x3ff3,	0x2e7a,
-	0xe70e,	0xf687,	0xc41c,	0xd595,	0xa12a,	0xb0a3,	0x8238,	0x93b1,
-	0x6b46,	0x7acf,	0x4854,	0x59dd,	0x2d62,	0x3ceb,	0x0e70,	0x1ff9,
-	0xf78f,	0xe606,	0xd49d,	0xc514,	0xb1ab,	0xa022,	0x92b9,	0x8330,
-	0x7bc7,	0x6a4e,	0x58d5,	0x495c,	0x3de3,	0x2c6a,	0x1ef1,	0x0f78
-};
+#undef __copy_from_user
+#undef __copy_to_user
+#define __copy_from_user(to, from, n)	(bcopy((from), (to), (n)), 0)
+#define __copy_to_user(to, from, n)	(bcopy((from), (to), (n)), 0)
+
+#define MODULE_PARAM_PREFIX "dahdi"
+#define MODULE_PARAM_PARENT _dahdi
 
 static struct cdev *dev_ctl = NULL;
 
@@ -364,8 +314,12 @@
 	}
 	spin_unlock_irqrestore(&pseudo_free_list_lock, flags);
 }
-
 #else /* !__FreeBSD__ */
+#define FOP_READ_ARGS_DECL	struct file *file, char __user *usrbuf, size_t count, loff_t *ppos
+#define FOP_READ_ARGS		file, usrbuf, count, ppos
+#define FOP_WRITE_ARGS_DECL	struct file *file, const char __user *usrbuf, size_t count, loff_t *ppos
+#define FOP_WRITE_ARGS		file, usrbuf, count, ppos
+
 /* macro-oni for determining a unit (channel) number */
 #define	UNIT(file) MINOR(file->f_dentry->d_inode->i_rdev)
 
@@ -9403,7 +9357,7 @@
 
 #if defined(__FreeBSD__)
 /* Now declare the module to the system */
-DAHDI_DEV_MODULE(dahdi);
+LINUX_DEV_MODULE(dahdi);
 MODULE_VERSION(dahdi, 1);
 MODULE_DEPEND(dahdi, firmware, 1, 1, 1);
 

Modified: freebsd/trunk/drivers/dahdi/dahdi_dynamic.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_dynamic.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_dynamic.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_dynamic.c Sun Feb 26 14:49:03 2012
@@ -22,17 +22,6 @@
  * this program for more details.
  */
 
-#if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/conf.h>
-#include <sys/ioccom.h>
-#include <sys/lock.h>
-#include <sys/module.h>
-#include <sys/mutex.h>
-#include <sys/sysctl.h>
-#include <sys/systm.h>
-#else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/module.h>
@@ -43,7 +32,6 @@
 #include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/moduleparam.h>
-#endif /* !__FreeBSD__ */
 
 #include <dahdi/kernel.h>
 
@@ -1006,7 +994,7 @@
 #define MODULE_PARAM_PREFIX "dahdi.dynamic"
 #define MODULE_PARAM_PARENT _dahdi_dynamic
 
-DAHDI_DEV_MODULE(dahdi_dynamic);
+LINUX_DEV_MODULE(dahdi_dynamic);
 MODULE_VERSION(dahdi_dynamic, 1);
 MODULE_DEPEND(dahdi_dynamic, dahdi, 1, 1, 1);
 #endif /* __FreeBSD__ */

Modified: freebsd/trunk/drivers/dahdi/dahdi_dynamic_eth.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_dynamic_eth.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_dynamic_eth.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_dynamic_eth.c Sun Feb 26 14:49:03 2012
@@ -22,14 +22,6 @@
  * this program for more details.
  */
 
-#if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/conf.h>
-#include <sys/module.h>
-
-#include "ng_dahdi_netdev.h"
-#else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/module.h>
@@ -38,10 +30,15 @@
 #include <linux/slab.h>
 #include <linux/kmod.h>
 #include <linux/netdevice.h>
+#if !defined(__FreeBSD__)
 #include <linux/notifier.h>
-#endif /* !__FreeBSD__ */
+#endif
 
 #include <dahdi/kernel.h>
+
+#if defined(__FreeBSD__)
+#include "ng_dahdi_netdev.h"
+#endif
 
 #define ETH_P_DAHDI_DETH	0xd00d
 
@@ -500,7 +497,7 @@
 }
 
 #if defined(__FreeBSD__)
-DAHDI_DEV_MODULE(dahdi_dynamic_eth);
+LINUX_DEV_MODULE(dahdi_dynamic_eth);
 MODULE_VERSION(dahdi_dynamic_eth, 1);
 MODULE_DEPEND(dahdi_dynamic_eth, dahdi, 1, 1, 1);
 MODULE_DEPEND(dahdi_dynamic_eth, dahdi_dynamic, 1, 1, 1);

Modified: freebsd/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c Sun Feb 26 14:49:03 2012
@@ -23,14 +23,6 @@
  *
  */
 
-#if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/conf.h>
-#include <sys/module.h>
-
-#include "ng_dahdi_netdev.h"
-#else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/module.h>
@@ -42,15 +34,16 @@
 #include <linux/interrupt.h>
 #include <linux/moduleparam.h>
 #include <linux/netdevice.h>
+#if !defined(__FreeBSD__)
 #include <linux/notifier.h>
 #include <linux/crc32.h>
+#endif /* !__FreeBSD__ */
 
 /**
  * Undefine USE_PROC_FS, if you do not want the /proc/dahdi/dynamic-ethmf
  * support. Undefining this would give a slight performance increase.
  */
-#define USE_PROC_FS
-#endif /* !__FreeBSD__ */
+#undef USE_PROC_FS
 
 #ifdef USE_PROC_FS
 # include <linux/proc_fs.h>
@@ -63,6 +56,10 @@
 
 #include <dahdi/kernel.h>
 #include <dahdi/user.h>
+
+#if defined(__FreeBSD__)
+#include "ng_dahdi_netdev.h"
+#endif
 
 #define ETH_P_ZTDETH			0xd00d
 #define ETHMF_MAX_PER_SPAN_GROUP	8
@@ -954,7 +951,7 @@
 }
 
 #if defined(__FreeBSD__)
-DAHDI_DEV_MODULE(dahdi_dynamic_ethmf);
+LINUX_DEV_MODULE(dahdi_dynamic_ethmf);
 MODULE_VERSION(dahdi_dynamic_ethmf, 1);
 MODULE_DEPEND(dahdi_dynamic_ethmf, dahdi, 1, 1, 1);
 MODULE_DEPEND(dahdi_dynamic_ethmf, dahdi_dynamic, 1, 1, 1);

Modified: freebsd/trunk/drivers/dahdi/dahdi_dynamic_loc.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_dynamic_loc.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_dynamic_loc.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_dynamic_loc.c Sun Feb 26 14:49:03 2012
@@ -45,13 +45,6 @@
  * this program for more details.
  */
 
-#if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/conf.h>
-#include <sys/module.h>
-#include <sys/systm.h>
-#else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/module.h>
@@ -60,8 +53,9 @@
 #include <linux/slab.h>
 #include <linux/kmod.h>
 #include <linux/netdevice.h>
+#if !defined(__FreeBSD__)
 #include <linux/notifier.h>
-#endif /* !__FreeBSD__ */
+#endif
 
 #include <dahdi/kernel.h>
 
@@ -268,7 +262,7 @@
 }
 
 #if defined(__FreeBSD__)
-DAHDI_DEV_MODULE(dahdi_dynamic_loc);
+LINUX_DEV_MODULE(dahdi_dynamic_loc);
 MODULE_VERSION(dahdi_dynamic_loc, 1);
 MODULE_DEPEND(dahdi_dynamic_loc, dahdi, 1, 1, 1);
 MODULE_DEPEND(dahdi_dynamic_loc, dahdi_dynamic, 1, 1, 1);

Modified: freebsd/trunk/drivers/dahdi/dahdi_echocan_jpah.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_echocan_jpah.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_echocan_jpah.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_echocan_jpah.c Sun Feb 26 14:49:03 2012
@@ -26,14 +26,6 @@
  * this program for more details.
  */
 
-#if defined(__FreeBSD__)
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/conf.h>
-#include <sys/ctype.h>
-#include <sys/libkern.h>
-#include <sys/module.h>
-#else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
@@ -41,7 +33,6 @@
 #include <linux/init.h>
 #include <linux/ctype.h>
 #include <linux/moduleparam.h>
-#endif /* !__FreeBSD__ */
 
 #include <dahdi/kernel.h>
 
@@ -149,7 +140,7 @@
 #define MODULE_PARAM_PREFIX "dahdi.echocan.jpah"
 #define MODULE_PARAM_PARENT _dahdi_echocan_jpah
 
-DAHDI_DEV_MODULE(dahdi_echocan_jpah);
+LINUX_DEV_MODULE(dahdi_echocan_jpah);
 MODULE_VERSION(dahdi_echocan_jpah, 1);
 MODULE_DEPEND(dahdi_echocan_jpah, dahdi, 1, 1, 1);
 #endif

Modified: freebsd/trunk/drivers/dahdi/dahdi_echocan_kb1.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_echocan_kb1.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_echocan_kb1.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_echocan_kb1.c Sun Feb 26 14:49:03 2012
@@ -31,14 +31,6 @@
  * this program for more details.
  */
 
-#if defined(__FreeBSD__)
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/conf.h>
-#include <sys/ctype.h>
-#include <sys/libkern.h>
-#include <sys/module.h>
-#else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
@@ -46,7 +38,6 @@
 #include <linux/init.h>
 #include <linux/ctype.h>
 #include <linux/moduleparam.h>
-#endif /* !__FreeBSD__ */
 
 #include <dahdi/kernel.h>
 
@@ -747,7 +738,7 @@
 #define MODULE_PARAM_PREFIX "dahdi.echocan.kb1"
 #define MODULE_PARAM_PARENT _dahdi_echocan_kb1
 
-DAHDI_DEV_MODULE(dahdi_echocan_kb1);
+LINUX_DEV_MODULE(dahdi_echocan_kb1);
 MODULE_VERSION(dahdi_echocan_kb1, 1);
 MODULE_DEPEND(dahdi_echocan_kb1, dahdi, 1, 1, 1);
 #endif /* __FreeBSD__ */

Modified: freebsd/trunk/drivers/dahdi/dahdi_echocan_mg2.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_echocan_mg2.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_echocan_mg2.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_echocan_mg2.c Sun Feb 26 14:49:03 2012
@@ -31,14 +31,6 @@
  * this program for more details.
  */
 
-#if defined(__FreeBSD__)
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/conf.h>
-#include <sys/ctype.h>
-#include <sys/libkern.h>
-#include <sys/module.h>
-#else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
@@ -46,7 +38,6 @@
 #include <linux/init.h>
 #include <linux/ctype.h>
 #include <linux/moduleparam.h>
-#endif /* !__FreeBSD__ */
 
 #include <dahdi/kernel.h>
 
@@ -894,7 +885,7 @@
 #define MODULE_PARAM_PREFIX "dahdi.echocan.mg2"
 #define MODULE_PARAM_PARENT _dahdi_echocan_mg2
 
-DAHDI_DEV_MODULE(dahdi_echocan_mg2);
+LINUX_DEV_MODULE(dahdi_echocan_mg2);
 MODULE_VERSION(dahdi_echocan_mg2, 1);
 MODULE_DEPEND(dahdi_echocan_mg2, dahdi, 1, 1, 1);
 #endif /* __FreeBSD__ */

Modified: freebsd/trunk/drivers/dahdi/dahdi_echocan_oslec.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_echocan_oslec.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_echocan_oslec.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_echocan_oslec.c Sun Feb 26 14:49:03 2012
@@ -22,10 +22,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
  */
 
-#if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <sys/module.h>
-#else
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
@@ -33,7 +29,6 @@
 #include <linux/init.h>
 #include <linux/ctype.h>
 #include <linux/moduleparam.h>
-#endif /* !__FreeBSD__ */
 
 /* Fix this if OSLEC is elsewhere */
 #include "../staging/echo/oslec.h"

Modified: freebsd/trunk/drivers/dahdi/dahdi_echocan_sec.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_echocan_sec.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_echocan_sec.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_echocan_sec.c Sun Feb 26 14:49:03 2012
@@ -36,14 +36,6 @@
    Improve double talk detector (iterative!)
 */
 
-#if defined(__FreeBSD__)
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/conf.h>
-#include <sys/ctype.h>
-#include <sys/libkern.h>
-#include <sys/module.h>
-#else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
@@ -51,7 +43,6 @@
 #include <linux/init.h>
 #include <linux/ctype.h>
 #include <linux/moduleparam.h>
-#endif /* !__FreeBSD__ */
 
 #include <dahdi/kernel.h>
 
@@ -360,7 +351,7 @@
 #define MODULE_PARAM_PREFIX "dahdi.echocan.sec"
 #define MODULE_PARAM_PARENT _dahdi_echocan_sec
 
-DAHDI_DEV_MODULE(dahdi_echocan_sec);
+LINUX_DEV_MODULE(dahdi_echocan_sec);
 MODULE_VERSION(dahdi_echocan_sec, 1);
 MODULE_DEPEND(dahdi_echocan_sec, dahdi, 1, 1, 1);
 #endif /* __FreeBSD__ */

Modified: freebsd/trunk/drivers/dahdi/dahdi_echocan_sec2.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_echocan_sec2.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_echocan_sec2.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_echocan_sec2.c Sun Feb 26 14:49:03 2012
@@ -35,14 +35,6 @@
    Improve double talk detector (iterative!)
 */
 
-#if defined(__FreeBSD__)
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/conf.h>
-#include <sys/ctype.h>
-#include <sys/libkern.h>
-#include <sys/module.h>
-#else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
@@ -50,7 +42,6 @@
 #include <linux/init.h>
 #include <linux/ctype.h>
 #include <linux/moduleparam.h>
-#endif /* !__FreeBSD__ */
 
 #include <dahdi/kernel.h>
 
@@ -355,7 +346,7 @@
 #define MODULE_PARAM_PREFIX "dahdi.echocan.sec2"
 #define MODULE_PARAM_PARENT _dahdi_echocan_sec2
 
-DAHDI_DEV_MODULE(dahdi_echocan_sec2);
+LINUX_DEV_MODULE(dahdi_echocan_sec2);
 MODULE_VERSION(dahdi_echocan_sec2, 1);
 MODULE_DEPEND(dahdi_echocan_sec2, dahdi, 1, 1, 1);
 #endif /* __FreeBSD__ */

Modified: freebsd/trunk/drivers/dahdi/dahdi_transcode.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_transcode.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_transcode.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_transcode.c Sun Feb 26 14:49:03 2012
@@ -22,16 +22,6 @@
  * this program for more details.
  */
 
-#if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/conf.h>
-#include <sys/fcntl.h>
-#include <sys/ioccom.h>
-#include <sys/module.h>
-#include <sys/poll.h>
-#include <sys/filio.h>
-#else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/module.h>
@@ -41,11 +31,14 @@
 #include <linux/kmod.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
+#include <linux/mm.h>
+#if defined(__FreeBSD__)
+#include <sys/filio.h>
+#else
 #include <linux/vmalloc.h>
-#include <linux/mm.h>
 #include <linux/page-flags.h>
 #include <asm/io.h>
-#endif /* !__FreeBSD__ */
+#endif
 
 #include <dahdi/kernel.h>
 
@@ -517,7 +510,7 @@
 #define MODULE_PARAM_PREFIX "dahdi.transcode"
 #define MODULE_PARAM_PARENT _dahdi_transcode
 
-DAHDI_DEV_MODULE(dahdi_transcode);
+LINUX_DEV_MODULE(dahdi_transcode);
 MODULE_VERSION(dahdi_transcode, 1);
 MODULE_DEPEND(dahdi_transcode, dahdi, 1, 1, 1);
 #endif /* __FreeBSD__ */

Modified: freebsd/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c (original)
+++ freebsd/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c Sun Feb 26 14:49:03 2012
@@ -32,12 +32,7 @@
 
 /*****************************  INCLUDE FILES  *******************************/
 
-#if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <dahdi/compat/bsd.h>
-#else
 #include <linux/slab.h>
-#endif
 
 #include "octdef.h"
 

Modified: freebsd/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c (original)
+++ freebsd/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c Sun Feb 26 14:49:03 2012
@@ -33,12 +33,7 @@
 
 /*****************************  INCLUDE FILES  *******************************/
 
-#if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <dahdi/compat/bsd.h>
-#else
 #include <linux/slab.h>
-#endif
 
 #include "octdef.h"
 

Modified: freebsd/trunk/drivers/dahdi/voicebus/GpakCust.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/voicebus/GpakCust.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/voicebus/GpakCust.c (original)
+++ freebsd/trunk/drivers/dahdi/voicebus/GpakCust.c Sun Feb 26 14:49:03 2012
@@ -30,10 +30,6 @@
  * this program for more details.
  */
 
-#if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <sys/bus.h>
-#else /* !__FreeBSD__ */
 #include <linux/version.h>
 #include <linux/types.h>
 #include <linux/pci.h>
@@ -42,7 +38,6 @@
 #else
 #include <asm/semaphore.h>
 #endif
-#endif /* !__FreeBSD__ */
 
 #include <dahdi/kernel.h>
 #include <dahdi/user.h>

Modified: freebsd/trunk/drivers/dahdi/voicebus/GpakCust.h
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/voicebus/GpakCust.h?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/voicebus/GpakCust.h (original)
+++ freebsd/trunk/drivers/dahdi/voicebus/GpakCust.h Sun Feb 26 14:49:03 2012
@@ -36,14 +36,6 @@
 #ifndef _GPAKCUST_H  /* prevent multiple inclusion */
 #define _GPAKCUST_H
 
-#if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <sys/systm.h>
-
-#include <dahdi/compat/types.h>
-#include <dahdi/compat/list.h>
-#include <dahdi/compat/bsd.h>
-#else /* !__FreeBSD__ */
 #include <linux/device.h>
 #include <linux/completion.h>
 #include <linux/workqueue.h>
@@ -53,7 +45,6 @@
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25)
 #include <linux/semaphore.h>
 #endif
-#endif /* !__FreeBSD__ */
 
 #include "gpakenum.h"
 #include "adt_lec.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=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/voicebus/voicebus.c (original)
+++ freebsd/trunk/drivers/dahdi/voicebus/voicebus.c Sun Feb 26 14:49:03 2012
@@ -27,36 +27,17 @@
  * this program for more details.
  */
 
-#if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/bus.h>
-#include <sys/conf.h>
-#include <sys/libkern.h>
-#include <sys/limits.h>
-#include <sys/module.h>
-#include <sys/rman.h>
-
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-
-#include <machine/resource.h>
-
-#ifdef wmb
-#undef wmb
-#endif
-#define wmb()
-#else /* !__FreeBSD__ */
 #include <linux/version.h>
 #include <linux/slab.h>
 #include <linux/pci.h>
-#include <linux/ioport.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/timer.h>
 #include <linux/module.h>
 #include <linux/sched.h>
-#endif /* !__FreeBSD__ */
+#if !defined(__FreeBSD__)
+#include <linux/ioport.h>
+#endif
 
 #include <dahdi/kernel.h>
 #include "voicebus.h"
@@ -2330,7 +2311,7 @@
 }
 
 #if defined(__FreeBSD__)
-DAHDI_DEV_MODULE(dahdi_voicebus);
+LINUX_DEV_MODULE(dahdi_voicebus);
 MODULE_VERSION(dahdi_voicebus, 1);
 MODULE_DEPEND(dahdi_voicebus, dahdi, 1, 1, 1);
 #endif /* __FreeBSD__ */

Modified: freebsd/trunk/drivers/dahdi/voicebus/voicebus.h
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/voicebus/voicebus.h?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/voicebus/voicebus.h (original)
+++ freebsd/trunk/drivers/dahdi/voicebus/voicebus.h Sun Feb 26 14:49:03 2012
@@ -29,12 +29,7 @@
 #ifndef __VOICEBUS_H__
 #define __VOICEBUS_H__
 
-#if defined(__FreeBSD__)
-#include <machine/bus.h>
-#else
 #include <linux/interrupt.h>
-#endif /* __FreeBSD__ */
-
 
 #ifdef VOICEBUS_NET_DEBUG
 #include <linux/netdevice.h>
@@ -109,10 +104,8 @@
 #if defined(__FreeBSD__)
 	bus_dma_tag_t	dma_tag;
 	bus_dmamap_t	dma_map;
-	uint32_t	desc_dma;
-#else
+#endif
 	dma_addr_t	desc_dma;
-#endif
 	atomic_t 	count;
 	unsigned int	padding;
 };
@@ -168,10 +161,8 @@
 #if defined(__FreeBSD__)
 	bus_dma_tag_t		idle_vbb_dma_tag;
 	bus_dmamap_t		idle_vbb_dma_map;
-	uint32_t		idle_vbb_dma_addr;
-#else
+#endif
 	dma_addr_t		idle_vbb_dma_addr;
-#endif
 	const int		*debug;
 	struct tasklet_struct 	tasklet;
 	enum voicebus_mode	mode;

Modified: freebsd/trunk/drivers/dahdi/voicebus/voicebus_net.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/voicebus/voicebus_net.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/voicebus/voicebus_net.c (original)
+++ freebsd/trunk/drivers/dahdi/voicebus/voicebus_net.c Sun Feb 26 14:49:03 2012
@@ -24,11 +24,9 @@
  * this program for more details.
  */
 
-#if !defined(__FreeBSD__)
 #include <linux/version.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
-#endif /* !__FreeBSD__ */
 
 #include <dahdi/kernel.h>
 

Modified: freebsd/trunk/drivers/dahdi/vpmadt032_loader/dahdi_vpmadt032_loader.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/vpmadt032_loader/dahdi_vpmadt032_loader.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/vpmadt032_loader/dahdi_vpmadt032_loader.c (original)
+++ freebsd/trunk/drivers/dahdi/vpmadt032_loader/dahdi_vpmadt032_loader.c Sun Feb 26 14:49:03 2012
@@ -17,17 +17,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#if defined(__FreeBSD__)
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/conf.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-
-#include <dev/pci/pcivar.h>
-
-#include <machine/stdarg.h>
-#else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/module.h>
@@ -35,7 +24,6 @@
 #include <linux/ctype.h>
 #include <linux/moduleparam.h>
 #include <linux/pci.h>
-#endif /* !__FreeBSD__ */
 
 #include <dahdi/kernel.h>
 
@@ -189,7 +177,7 @@
 #define MODULE_PARAM_PREFIX "dahdi.vpmadt032_loader"
 #define MODULE_PARAM_PARENT _dahdi_vpmadt032_loader
 
-DAHDI_DEV_MODULE(dahdi_vpmadt032_loader);
+LINUX_DEV_MODULE(dahdi_vpmadt032_loader);
 MODULE_VERSION(dahdi_vpmadt032_loader, 1);
 MODULE_DEPEND(dahdi_vpmadt032_loader, dahdi, 1, 1, 1);
 MODULE_DEPEND(dahdi_vpmadt032_loader, dahdi_voicebus, 1, 1, 1);

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=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/wcb4xxp/base.c (original)
+++ freebsd/trunk/drivers/dahdi/wcb4xxp/base.c Sun Feb 26 14:49:03 2012
@@ -21,31 +21,15 @@
  */
 
 #if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <sys/bus.h>
-#include <sys/module.h>
-#include <sys/param.h>
-#include <sys/queue.h>
-#include <sys/rman.h>
-#include <sys/systm.h>
-
-#include <machine/bus.h>
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-
-#ifdef mb
-#undef mb
-#endif
-#define mb()
-
-#ifdef wmb
-#undef wmb
-#endif
-#define wmb()
-
 #define mmiowb()
 #else /* !__FreeBSD__ */
 #include <linux/autoconf.h>
+#include <linux/cdev.h>
+#include <linux/proc_fs.h>
+#include <asm/io.h>
+#include <asm/system.h>		/* cli(), *_flags */
+#include <asm/uaccess.h>	/* copy_*_user */
+#endif /* !__FreeBSD__ */
 #include <linux/init.h>
 
 #include <linux/kernel.h>	/* printk() */
@@ -54,20 +38,14 @@
 #include <linux/types.h>	/* size_t */
 #include <linux/fcntl.h>	/* O_ACCMODE */
 #include <linux/fs.h>
-#include <linux/cdev.h>
 #include <linux/pci.h>		/* for PCI structures */
 #include <linux/delay.h>
-#include <asm/io.h>
 #include <linux/spinlock.h>
 #include <linux/device.h>	/* dev_err() */
 #include <linux/interrupt.h>
-#include <asm/system.h>		/* cli(), *_flags */
-#include <asm/uaccess.h>	/* copy_*_user */
 #include <linux/workqueue.h>	/* work_struct */
 #include <linux/timer.h>	/* timer_struct */
 #include <linux/moduleparam.h>
-#include <linux/proc_fs.h>
-#endif /* !__FreeBSD__ */
 
 #include <dahdi/kernel.h>
 
@@ -3146,7 +3124,7 @@
 {
 	struct b4xxp *b4 = device_get_softc(dev);
 
-	if (dahdi_module_usecount(THIS_MODULE) > 0)
+	if (_linux_module_usecount(THIS_MODULE) > 0)
 		return (EBUSY);
 
 	/* unregister */
@@ -3173,7 +3151,7 @@
 
 static devclass_t b4xxp_devclass;
 
-DAHDI_DRIVER_MODULE(wcb4xxp, pci, b4xxp_pci_driver, b4xxp_devclass);
+LINUX_DRIVER_MODULE(wcb4xxp, pci, b4xxp_pci_driver, b4xxp_devclass);
 MODULE_DEPEND(wcb4xxp, pci, 1, 1, 1);
 MODULE_DEPEND(wcb4xxp, dahdi, 1, 1, 1);
 

Modified: freebsd/trunk/drivers/dahdi/wcb4xxp/wcb4xxp.h
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wcb4xxp/wcb4xxp.h?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/wcb4xxp/wcb4xxp.h (original)
+++ freebsd/trunk/drivers/dahdi/wcb4xxp/wcb4xxp.h Sun Feb 26 14:49:03 2012
@@ -6,9 +6,7 @@
 #ifndef _B4XX_H_
 #define _B4XX_H_
 
-#if !defined(__FreeBSD__)
 #include <linux/ioctl.h>
-#endif
 
 #define HFC_NR_FIFOS	32
 #define HFC_ZMIN	0x80			/* from datasheet */

Modified: freebsd/trunk/drivers/dahdi/wcfxo.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wcfxo.c?view=diff&rev=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/wcfxo.c (original)
+++ freebsd/trunk/drivers/dahdi/wcfxo.c Sun Feb 26 14:49:03 2012
@@ -23,29 +23,21 @@
  * this program for more details.
  */
 
-#if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <sys/bus.h>
-#include <sys/module.h>
-#include <sys/param.h>
-#include <sys/rman.h>
-
-#include <machine/bus.h>
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-
-#define set_current_state(x)
-#else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/usb.h>
 #include <linux/errno.h>
 #include <linux/pci.h>
+#include <linux/moduleparam.h>
+#if defined(__FreeBSD__)
+#include <linux/sched.h>	/* linux/usb.h */
+
+#define set_current_state(x)
+#else
+#include <linux/usb.h>
 #include <asm/io.h>
-#include <linux/moduleparam.h>
-#endif /* !__FreeBSD__ */
+#endif
 
 #include <dahdi/kernel.h>
 
@@ -195,18 +187,16 @@
 	int irq_rid;
 	void *irq_handle;
 
-	uint32_t readdma;
 	bus_dma_tag_t   read_dma_tag;
 	bus_dmamap_t    read_dma_map;
 
-	uint32_t writedma;
 	bus_dma_tag_t   write_dma_tag;
 	bus_dmamap_t    write_dma_map;
 #else /* !__FreeBSD__ */
 	unsigned long ioaddr;
+#endif /* !__FreeBSD__ */
 	dma_addr_t 	readdma;
 	dma_addr_t	writedma;
-#endif /* !__FreeBSD__ */
 	volatile int *writechunk;					/* Double-word aligned write memory */
 	volatile int *readchunk;					/* Double-word aligned read memory */
 #ifdef ZERO_BATT_RING
@@ -1299,7 +1289,7 @@
 {
 	struct wcfxo *wc = device_get_softc(dev);
 
-	if (dahdi_module_usecount(THIS_MODULE) > 0)
+	if (_linux_module_usecount(THIS_MODULE) > 0)
 		return (EBUSY);
 
 	/* Stop any DMA */
@@ -1336,7 +1326,7 @@
 
 static devclass_t wcfxo_devclass;
 
-DAHDI_DRIVER_MODULE(wcfxo, pci, wcfxo_pci_driver, wcfxo_devclass);
+LINUX_DRIVER_MODULE(wcfxo, pci, wcfxo_pci_driver, wcfxo_devclass);
 MODULE_DEPEND(wcfxo, pci, 1, 1, 1);
 MODULE_DEPEND(wcfxo, dahdi, 1, 1, 1);
 #else /* !__FreeBSD__ */

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=10469&r1=10468&r2=10469
==============================================================================
--- freebsd/trunk/drivers/dahdi/wct4xxp/base.c (original)
+++ freebsd/trunk/drivers/dahdi/wct4xxp/base.c Sun Feb 26 14:49:03 2012
@@ -28,18 +28,6 @@
  * this program for more details.
  */
 
-#if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <sys/bus.h>
-#include <sys/module.h>
-#include <sys/param.h>
-#include <sys/rman.h>
-#include <sys/systm.h>
-
-#include <machine/bus.h>
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-#else /* !__FreeBSD__ */
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/module.h>
@@ -48,18 +36,18 @@
 #include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
-#include <asm/io.h>
 #include <linux/version.h>
 #include <linux/delay.h>
 #include <linux/moduleparam.h>
-#endif /* !__FreeBSD__ */
+#if !defined(__FreeBSD__)
+#include <asm/io.h>
+#endif
 
 #include <dahdi/kernel.h>
 
 #include "wct4xxp.h"

[... 4228 lines stripped ...]



More information about the svn-commits mailing list