diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dahdi/dahdi-base.c | 186 | ||||
-rw-r--r-- | drivers/dahdi/dahdi_dummy.c | 222 | ||||
-rw-r--r-- | drivers/dahdi/dahdi_dummy.h | 152 | ||||
-rw-r--r-- | drivers/dahdi/dahdi_dynamic.c | 18 | ||||
-rw-r--r-- | drivers/dahdi/dahdi_dynamic_eth.c | 8 | ||||
-rw-r--r-- | drivers/dahdi/dahdi_dynamic_loc.c | 8 | ||||
-rw-r--r-- | drivers/dahdi/dahdi_transcode.c | 10 | ||||
-rw-r--r-- | drivers/dahdi/pciradio.c | 42 | ||||
-rw-r--r-- | drivers/dahdi/tor2.c | 27 | ||||
-rw-r--r-- | drivers/dahdi/wcfxo.c | 39 | ||||
-rw-r--r-- | drivers/dahdi/wct1xxp.c | 25 | ||||
-rw-r--r-- | drivers/dahdi/wct4xxp/base.c | 61 | ||||
-rw-r--r-- | drivers/dahdi/wctdm.c | 58 | ||||
-rw-r--r-- | drivers/dahdi/wctdm24xxp/base.c | 49 | ||||
-rw-r--r-- | drivers/dahdi/wcte11xp.c | 36 | ||||
-rw-r--r-- | drivers/dahdi/wcte12xp/base.c | 31 | ||||
-rw-r--r-- | drivers/dahdi/wcte12xp/wcte12xp.h | 2 |
17 files changed, 30 insertions, 944 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index ce6ebd7..bfa5a8d 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -47,6 +47,7 @@ #include <linux/version.h> #include <linux/ctype.h> #include <linux/kmod.h> +#include <linux/moduleparam.h> #ifdef CONFIG_DAHDI_NET #include <linux/netdevice.h> @@ -82,10 +83,6 @@ #include <dahdi/kernel.h> #include <dahdi/user.h> -#ifdef LINUX26 -#include <linux/moduleparam.h> -#endif - /* Get helper arithmetic */ #include "arith.h" #if defined(CONFIG_DAHDI_MMX) || defined(ECHO_CAN_FP) @@ -94,11 +91,7 @@ #define hdlc_to_ztchan(h) (((struct dahdi_hdlc *)(h))->chan) #define dev_to_ztchan(h) (((struct dahdi_hdlc *)(dev_to_hdlc(h)->priv))->chan) -#ifdef LINUX26 #define ztchan_to_dev(h) ((h)->hdlcnetdev->netdev) -#else -#define ztchan_to_dev(h) (&((h)->hdlcnetdev->netdev.netdev)) -#endif /* macro-oni for determining a unit (channel) number */ #define UNIT(file) MINOR(file->f_dentry->d_inode->i_rdev) @@ -175,50 +168,8 @@ static struct class_simple *dahdi_class = NULL; #endif /* CONFIG_DAHDI_UDEV */ - -/* There is a table like this in the PPP driver, too */ - static int deftaps = 64; -#if !defined(LINUX26) -static -__u16 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 -}; -#endif - static int debug; /* states for transmit signalling */ @@ -309,34 +260,7 @@ static struct dahdi_dialparams global_dialparams = { static int dahdi_chan_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data, int unit); #if defined(CONFIG_DAHDI_MMX) || defined(ECHO_CAN_FP) -/* XXX kernel_fpu_begin() is NOT exported properly (in 2.4), so we have to make - a local version. Somebody fix this! XXX */ - -#ifndef LINUX26 -static inline void __save_init_fpu( struct task_struct *tsk ) -{ - if ( cpu_has_fxsr ) { - asm volatile( "fxsave %0 ; fnclex" - : "=m" (tsk->thread.i387.fxsave) ); - } else { - asm volatile( "fnsave %0 ; fwait" - : "=m" (tsk->thread.i387.fsave) ); - } - tsk->flags &= ~PF_USEDFPU; -} - -static inline void dahdi_kernel_fpu_begin(void) -{ - struct task_struct *tsk = current; - if (tsk->flags & PF_USEDFPU) { - __save_init_fpu(tsk); - return; - } - clts(); -} -#else #define dahdi_kernel_fpu_begin kernel_fpu_begin -#endif /* LINUX26 */ #endif static struct dahdi_timer { @@ -1368,15 +1292,9 @@ char *dahdi_lboname(int x) #ifdef NEW_HDLC_INTERFACE static int dahdi_net_open(struct net_device *dev) { -#ifdef LINUX26 int res = hdlc_open(dev); struct dahdi_chan *ms = dev_to_ztchan(dev); -#else - hdlc_device *hdlc = dev_to_hdlc(dev); - struct dahdi_chan *ms = hdlc_to_ztchan(hdlc); - int res = hdlc_open(hdlc); -#endif - + /* if (!dev->hard_start_xmit) return res; is this really necessary? --byg */ if (res) /* this is necessary to avoid kernel panic when UNSPEC link encap, proven --byg */ return res; @@ -1411,16 +1329,12 @@ static int dahdi_net_open(hdlc_device *hdlc) netif_start_queue(ztchan_to_dev(ms)); -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#endif #ifdef CONFIG_DAHDI_DEBUG printk("ZAPNET: Opened channel %d name %s\n", ms->channo, ms->name); #endif return 0; } -#ifdef LINUX26 static int dahdi_register_hdlc_device(struct net_device *dev, const char *dev_name) { int result; @@ -1438,17 +1352,12 @@ static int dahdi_register_hdlc_device(struct net_device *dev, const char *dev_na #endif return 0; } -#endif #ifdef NEW_HDLC_INTERFACE static int dahdi_net_stop(struct net_device *dev) { -#ifdef LINUX26 hdlc_device *h = dev_to_hdlc(dev); struct dahdi_hdlc *hdlc = h->priv; -#else - hdlc_device *hdlc = dev_to_hdlc(dev); -#endif #else static void dahdi_net_close(hdlc_device *hdlc) @@ -1476,16 +1385,7 @@ static void dahdi_net_close(hdlc_device *hdlc) /* Not much to do here. Just deallocate the buffers */ netif_stop_queue(ztchan_to_dev(ms)); dahdi_reallocbufs(ms, 0, 0); -#ifdef LINUX26 hdlc_close(dev); -#else -#ifndef CONFIG_OLD_HDLC_API - hdlc_close(hdlc); -#endif -#endif -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#endif #ifdef NEW_HDLC_INTERFACE return 0; #else @@ -1497,13 +1397,8 @@ static void dahdi_net_close(hdlc_device *hdlc) /* kernel 2.4.20+ has introduced attach function, dunno what to do, just copy sources from dscc4 to be sure and ready for further mastering, NOOP right now (i.e. really a stub) --byg */ -#ifdef LINUX26 static int dahdi_net_attach(struct net_device *dev, unsigned short encoding, unsigned short parity) -#else -static int dahdi_net_attach(hdlc_device *hdlc, unsigned short encoding, - unsigned short parity) -#endif { /* struct net_device *dev = hdlc_to_dev(hdlc); struct dscc4_dev_priv *dpriv = dscc4_priv(dev); @@ -1543,13 +1438,8 @@ static int dahdi_xmit(struct sk_buff *skb, struct net_device *dev) { /* FIXME: this construction seems to be not very optimal for me but I could find nothing better at the moment (Friday, 10PM :( ) --byg */ /* struct dahdi_chan *ss = hdlc_to_ztchan(list_entry(dev, struct dahdi_hdlc, netdev.netdev));*/ -#ifdef LINUX26 struct dahdi_chan *ss = dev_to_ztchan(dev); struct net_device_stats *stats = hdlc_stats(dev); -#else - struct dahdi_chan *ss = (list_entry(dev, struct dahdi_hdlc, netdev.netdev)->chan); - struct net_device_stats *stats = &ss->hdlcnetdev->netdev.stats; -#endif #else static int dahdi_xmit(hdlc_device *hdlc, struct sk_buff *skb) @@ -1741,12 +1631,8 @@ static void dahdi_chan_unreg(struct dahdi_chan *chan) unsigned long flags; #ifdef CONFIG_DAHDI_NET if (chan->flags & DAHDI_FLAG_NETDEV) { -#ifdef LINUX26 unregister_hdlc_device(chan->hdlcnetdev->netdev); free_netdev(chan->hdlcnetdev->netdev); -#else - unregister_hdlc_device(&chan->hdlcnetdev->netdev); -#endif kfree(chan->hdlcnetdev); chan->hdlcnetdev = NULL; } @@ -2000,36 +1886,24 @@ static ssize_t dahdi_chan_write(struct file *file, const char *usrbuf, size_t co static int dahdi_ctl_open(struct inode *inode, struct file *file) { /* Nothing to do, really */ -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#endif return 0; } static int dahdi_chan_open(struct inode *inode, struct file *file) { /* Nothing to do here for now either */ -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#endif return 0; } static int dahdi_ctl_release(struct inode *inode, struct file *file) { /* Nothing to do */ -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#endif return 0; } static int dahdi_chan_release(struct inode *inode, struct file *file) { /* Nothing to do for now */ -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#endif return 0; } @@ -2359,9 +2233,6 @@ static int dahdi_timing_open(struct inode *inode, struct file *file) memset(t, 0, sizeof(struct dahdi_timer)); init_waitqueue_head(&t->sel); file->private_data = t; -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#endif spin_lock_irqsave(&zaptimerlock, flags); t->next = zaptimers; zaptimers = t; @@ -2396,9 +2267,6 @@ static int dahdi_timer_release(struct inode *inode, struct file *file) return 0; } kfree(t); -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#endif } return 0; } @@ -2431,10 +2299,6 @@ static int dahdi_specchan_open(struct inode *inode, struct file *file, int unit, } if (!res) { chans[unit]->file = file; -#ifndef LINUX26 - if (inc) - MOD_INC_USE_COUNT; -#endif spin_unlock_irqrestore(&chans[unit]->lock, flags); } else { spin_unlock_irqrestore(&chans[unit]->lock, flags); @@ -2465,9 +2329,6 @@ static int dahdi_specchan_release(struct inode *node, struct file *file, int uni clear_bit(DAHDI_FLAGBIT_OPEN, &chans[unit]->flags); } else res = -ENXIO; -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#endif return res; } @@ -3665,14 +3526,10 @@ static int dahdi_ctl_ioctl(struct inode *inode, struct file *file, unsigned int printk(KERN_WARNING "Can't switch HDLC net mode on channel %s, since current interface is up\n", chans[ch.chan]->name); return -EBUSY; } -#ifdef LINUX26 spin_unlock_irqrestore(&chans[ch.chan]->lock, flags); unregister_hdlc_device(chans[ch.chan]->hdlcnetdev->netdev); spin_lock_irqsave(&chans[ch.chan]->lock, flags); free_netdev(chans[ch.chan]->hdlcnetdev->netdev); -#else - unregister_hdlc_device(&chans[ch.chan]->hdlcnetdev->netdev); -#endif kfree(chans[ch.chan]->hdlcnetdev); chans[ch.chan]->hdlcnetdev = NULL; chans[ch.chan]->flags &= ~DAHDI_FLAG_NETDEV; @@ -3766,7 +3623,6 @@ static int dahdi_ctl_ioctl(struct inode *inode, struct file *file, unsigned int if (chans[ch.chan]->hdlcnetdev) { /* struct hdlc_device *hdlc = chans[ch.chan]->hdlcnetdev; struct net_device *d = hdlc_to_dev(hdlc); mmm...get it right later --byg */ -#ifdef LINUX26 chans[ch.chan]->hdlcnetdev->netdev = alloc_hdlcdev(chans[ch.chan]->hdlcnetdev); if (chans[ch.chan]->hdlcnetdev->netdev) { chans[ch.chan]->hdlcnetdev->chan = chans[ch.chan]; @@ -3788,27 +3644,6 @@ static int dahdi_ctl_ioctl(struct inode *inode, struct file *file, unsigned int printk("Unable to allocate hdlc: *shrug*\n"); res = -1; } -#else /* LINUX26 */ - chans[ch.chan]->hdlcnetdev->chan = chans[ch.chan]; -#ifndef HDLC_MAINTAINERS_ARE_MORE_STUPID_THAN_I_THOUGHT - chans[ch.chan]->hdlcnetdev->netdev.ioctl = dahdi_net_ioctl; -#endif - chans[ch.chan]->hdlcnetdev->netdev.netdev.do_ioctl = dahdi_net_ioctl; -#ifdef NEW_HDLC_INTERFACE - chans[ch.chan]->hdlcnetdev->netdev.netdev.open = dahdi_net_open; - chans[ch.chan]->hdlcnetdev->netdev.netdev.stop = dahdi_net_stop; - chans[ch.chan]->hdlcnetdev->netdev.xmit = dahdi_xmit; - chans[ch.chan]->hdlcnetdev->netdev.attach = dahdi_net_attach; -#else - chans[ch.chan]->hdlcnetdev->netdev.open = dahdi_net_open; - chans[ch.chan]->hdlcnetdev->netdev.close = dahdi_net_close; - chans[ch.chan]->hdlcnetdev->netdev.set_mode = NULL; - chans[ch.chan]->hdlcnetdev->netdev.xmit = dahdi_xmit; -#endif /* NEW_HDLC_INTERFACE */ - chans[ch.chan]->hdlcnetdev->netdev.netdev.irq = chans[ch.chan]->span->irq; - chans[ch.chan]->hdlcnetdev->netdev.netdev.tx_queue_len = 50; - res = register_hdlc_device(&chans[ch.chan]->hdlcnetdev->netdev); -#endif /* LINUX26 */ if (!res) chans[ch.chan]->flags |= DAHDI_FLAG_NETDEV; } else { @@ -6710,11 +6545,7 @@ static inline void __putbuf_chunk(struct dahdi_chan *ss, unsigned char *rxb, int skb_put(skb, ms->readn[ms->inreadbuf]); #ifdef CONFIG_DAHDI_NET if (ms->flags & DAHDI_FLAG_NETDEV) { -#ifdef LINUX26 struct net_device_stats *stats = hdlc_stats(ms->hdlcnetdev->netdev); -#else /* LINUX26 */ - struct net_device_stats *stats = &ms->hdlcnetdev->netdev.stats; -#endif /* LINUX26 */ stats->rx_packets++; stats->rx_bytes += ms->readn[ms->inreadbuf]; } @@ -6723,11 +6554,7 @@ static inline void __putbuf_chunk(struct dahdi_chan *ss, unsigned char *rxb, int } else { #ifdef CONFIG_DAHDI_NET if (ms->flags & DAHDI_FLAG_NETDEV) { -#ifdef LINUX26 struct net_device_stats *stats = hdlc_stats(ms->hdlcnetdev->netdev); -#else /* LINUX26 */ - struct net_device_stats *stats = &ms->hdlcnetdev->netdev.stats; -#endif /* LINUX26 */ stats->rx_dropped++; } #endif @@ -6816,11 +6643,7 @@ out in the later versions, and is put back now. */ #ifdef CONFIG_DAHDI_NET if (ms->flags & DAHDI_FLAG_NETDEV) { -#ifdef LINUX26 struct net_device_stats *stats = hdlc_stats(ms->hdlcnetdev->netdev); -#else /* LINUX26 */ - struct net_device_stats *stats = &ms->hdlcnetdev->netdev.stats; -#endif /* LINUX26 */ stats->rx_errors++; if (abort == DAHDI_EVENT_OVERRUN) stats->rx_over_errors++; @@ -7524,13 +7347,8 @@ MODULE_LICENSE("GPL"); MODULE_VERSION(DAHDI_VERSION); #endif -#ifdef LINUX26 module_param(debug, int, 0644); module_param(deftaps, int, 0644); -#else -MODULE_PARM(debug, "i"); -MODULE_PARM(deftaps, "i"); -#endif static struct file_operations dahdi_fops = { owner: THIS_MODULE, diff --git a/drivers/dahdi/dahdi_dummy.c b/drivers/dahdi/dahdi_dummy.c index da6e687..7272fd8 100644 --- a/drivers/dahdi/dahdi_dummy.c +++ b/drivers/dahdi/dahdi_dummy.c @@ -74,24 +74,17 @@ #include <linux/module.h> #include <linux/init.h> #include <linux/errno.h> +#include <linux/moduleparam.h> #include <dahdi/kernel.h> #include <dahdi/user.h> -#ifndef LINUX26 -#include <linux/usb.h> -#include <linux/pci.h> -#include <asm/io.h> -#endif -#ifdef LINUX26 #ifdef USE_HIGHRESTIMER #include <linux/hrtimer.h> #endif #ifdef USE_RTC #include <linux/rtc.h> #endif -#include <linux/moduleparam.h> -#endif #include <linux/version.h> #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,19) @@ -101,130 +94,17 @@ struct ztdummy { struct dahdi_span span; struct dahdi_chan chan; -#ifdef LINUX26 unsigned int counter; #ifdef USE_RTC spinlock_t rtclock; rtc_task_t rtc_task; #endif -#endif -}; - - -#ifndef LINUX26 -/* Uhci definitions and structures - from file usb-uhci.h */ -#define TD_CTRL_IOC (1 << 24) /* Interrupt on Complete */ -#define USBSTS 2 - -typedef enum { - TD_TYPE, QH_TYPE -} uhci_desc_type_t; - -typedef struct { - __u32 link; - __u32 status; - __u32 info; - __u32 buffer; -} uhci_td_t, *puhci_td_t; - - -typedef struct { - __u32 head; - __u32 element; /* Queue element pointer */ -} uhci_qh_t, *puhci_qh_t; - -typedef struct { - union { - uhci_td_t td; - uhci_qh_t qh; - } hw; - uhci_desc_type_t type; - dma_addr_t dma_addr; - struct list_head horizontal; - struct list_head vertical; - struct list_head desc_list; - int last_used; -} uhci_desc_t, *puhci_desc_t; - -typedef struct { - struct list_head desc_list; // list pointer to all corresponding TDs/QHs associated with this request - dma_addr_t setup_packet_dma; - dma_addr_t transfer_buffer_dma; - unsigned long started; -#ifdef USB2420 - struct urb *next_queued_urb; // next queued urb for this EP - struct urb *prev_queued_urb; -#else - urb_t *next_queued_urb; - urb_t *prev_queued_urb; -#endif - uhci_desc_t *bottom_qh; - uhci_desc_t *next_qh; // next helper QH - char use_loop; - char flags; -} urb_priv_t, *purb_priv_t; - -struct virt_root_hub { - int devnum; /* Address of Root Hub endpoint */ - void *urb; - void *int_addr; - int send; - int interval; - int numports; - int c_p_r[8]; - struct timer_list rh_int_timer; }; -typedef struct uhci { - int irq; - unsigned int io_addr; - unsigned int io_size; - unsigned int maxports; - int running; - - int apm_state; - - struct uhci *next; // chain of uhci device contexts - - struct list_head urb_list; // list of all pending urbs - - spinlock_t urb_list_lock; // lock to keep consistency - - int unlink_urb_done; - atomic_t avoid_bulk; - - struct usb_bus *bus; // our bus - - __u32 *framelist; - dma_addr_t framelist_dma; - uhci_desc_t **iso_td; - uhci_desc_t *int_chain[8]; - uhci_desc_t *ls_control_chain; - uhci_desc_t *control_chain; - uhci_desc_t *bulk_chain; - uhci_desc_t *chain_end; - uhci_desc_t *td1ms; - uhci_desc_t *td32ms; - struct list_head free_desc; - spinlock_t qh_lock; - spinlock_t td_lock; - struct virt_root_hub rh; //private data of the virtual root hub - int loop_usage; // URBs using bandwidth reclamation - - struct list_head urb_unlinked; // list of all unlinked urbs - long timeout_check; - int timeout_urbs; - struct pci_dev *uhci_pci; - struct pci_pool *desc_pool; - long last_error_time; // last error output in uhci_interrupt() -} uhci_t, *puhci_t; -#endif - static struct ztdummy *ztd; static int debug = 0; -#ifdef LINUX26 #ifdef USE_HIGHRESTIMER #define CLOCK_SRC "HRtimer" struct hrtimer zaptimer; @@ -240,28 +120,6 @@ static void ztd_tasklet(unsigned long data); /* 2.6 kernel timer stuff */ static struct timer_list timer; #endif -#else -#if LINUX_VERSION_CODE < VERSION_CODE(2,4,5) -# error "This kernel is too old: not supported by this file" -#endif -#define CLOCK_SRC "UHCI" -/* Old UCHI stuff */ -static uhci_desc_t *td; -static uhci_t *s; -static int monitor = 0; - -/* exported kernel symbols */ -extern int insert_td (uhci_t *s, uhci_desc_t *qh, uhci_desc_t* new, int flags); -extern int alloc_td (uhci_t *s, uhci_desc_t ** new, int flags); -extern int insert_td_horizontal (uhci_t *s, uhci_desc_t *td, uhci_desc_t* new); -extern int unlink_td (uhci_t *s, uhci_desc_t *element, int phys_unlink); -extern void fill_td (uhci_desc_t *td, int status, int info, __u32 buffer); -extern void uhci_interrupt (int irq, void *__uhci, struct pt_regs *regs); -extern int delete_desc (uhci_t *s, uhci_desc_t *element); -extern uhci_t **uhci_devices; - -#endif - #define DAHDI_RATE 1000 /* DAHDI ticks per second */ #define DAHDI_TIME (1000000 / DAHDI_RATE) /* DAHDI tick time in us */ @@ -272,7 +130,6 @@ extern uhci_t **uhci_devices; #define DEBUG_TICKS (1 << 1) -#ifdef LINUX26 #ifdef USE_RTC static void update_rtc_rate(struct ztdummy *ztd) { @@ -362,27 +219,6 @@ static void ztdummy_timer(unsigned long param) } } #endif -#else -static void ztdummy_interrupt(int irq, void *dev_id, struct pt_regs *regs) -{ - unsigned short status; - unsigned int io_addr = s->io_addr; - - status = inw (io_addr + USBSTS); - if (status != 0) { /* interrupt from our USB port */ - static int check_int = 0; - dahdi_receive(&ztd->span); - dahdi_transmit(&ztd->span); - /* TODO: What's the relation between monitor and - * DEBUG_TICKS */ - if (monitor && check_int) { - check_int = 1; - printk(KERN_NOTICE "ztdummy: interrupt triggered \n"); - } - } - return; -} -#endif static int ztdummy_initialize(struct ztdummy *ztd) { @@ -406,28 +242,9 @@ static int ztdummy_initialize(struct ztdummy *ztd) int init_module(void) { -#ifdef LINUX26 #ifdef USE_RTC int err; #endif -#else - int irq; -#ifdef DEFINE_SPINLOCK - DEFINE_SPINLOCK(mylock); -#else - spinlock_t mylock = SPIN_LOCK_UNLOCKED; -#endif - - if (uhci_devices==NULL) { - printk (KERN_ERR "ztdummy: Uhci_devices pointer error.\n"); - return -ENODEV; - } - s=*uhci_devices; /* uhci device */ - if (s==NULL) { - printk (KERN_ERR "ztdummy: No uhci_device found.\n"); - return -ENODEV; - } -#endif ztd = kmalloc(sizeof(struct ztdummy), GFP_KERNEL); if (ztd == NULL) { @@ -443,7 +260,6 @@ int init_module(void) return -ENODEV; } -#ifdef LINUX26 ztd->counter = 0; #ifdef USE_RTC ztd->rtclock = SPIN_LOCK_UNLOCKED; @@ -479,27 +295,6 @@ int init_module(void) timer.expires = jiffies + 1; add_timer(&timer); #endif -#else - irq=s->irq; - spin_lock_irq(&mylock); - free_irq(s->irq, s); /* remove uhci_interrupt temporaly */ - if (request_irq (irq, ztdummy_interrupt, DAHDI_IRQ_SHARED, "ztdummy", ztd)) { - spin_unlock_irq(&mylock); - err("Our request_irq %d failed!",irq); - kfree(ztd); - return -EIO; - } /* we add our handler first, to assure, that our handler gets called first */ - if (request_irq (irq, uhci_interrupt, DAHDI_IRQ_SHARED, s->uhci_pci->driver->name, s)) { - spin_unlock_irq(&mylock); - err("Original request_irq %d failed!",irq); - } - spin_unlock_irq(&mylock); - - /* add td to usb host controller interrupt queue */ - alloc_td(s, &td, 0); - fill_td(td, TD_CTRL_IOC, 0, 0); - insert_td_horizontal(s, s->int_chain[0], td); /* use int_chain[0] to get 1ms interrupts */ -#endif if (debug) printk(KERN_DEBUG "ztdummy: init() finished\n"); @@ -509,7 +304,6 @@ int init_module(void) void cleanup_module(void) { -#ifdef LINUX26 #ifdef USE_RTC if (taskletpending) { tasklet_disable(&ztd_tlet); @@ -523,33 +317,19 @@ void cleanup_module(void) #else del_timer(&timer); #endif -#else - free_irq(s->irq, ztd); /* disable interrupts */ -#endif dahdi_unregister(&ztd->span); kfree(ztd); -#ifndef LINUX26 - unlink_td(s, td, 1); - delete_desc(s, td); -#endif if (debug) printk("ztdummy: cleanup() finished\n"); } -#ifdef LINUX26 module_param(debug, int, 0600); #ifdef USE_RTC module_param(rtc_rate, int, 0600); #endif -#else -MODULE_PARM(debug, "i"); -#endif -#ifndef LINUX26 -MODULE_PARM(monitor, "i"); -#endif MODULE_DESCRIPTION("Dummy DAHDI Driver"); MODULE_AUTHOR("Robert Pleh <robert.pleh@hermes.si>"); #ifdef MODULE_LICENSE diff --git a/drivers/dahdi/dahdi_dummy.h b/drivers/dahdi/dahdi_dummy.h deleted file mode 100644 index 0fb8175..0000000 --- a/drivers/dahdi/dahdi_dummy.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Dummy DAHDI Driver for DAHDI Telephony interface - * - * Written by Robert Pleh <robert.pleh@hermes.si> - * - * Copyright (C) 2002, Hermes Softlab - * - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * -*/ - -#include <linux/version.h> -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,19) -#define USB2420 -#endif - -struct ztdummy { - struct dahdi_span span; - struct dahdi_chan chan; -#ifdef LINUX26 - unsigned int counter; -#ifdef USE_RTC - spinlock_t rtclock; - rtc_task_t rtc_task; -#endif -#endif -}; - - -#ifndef LINUX26 -/* Uhci definitions and structures - from file usb-uhci.h */ -#define TD_CTRL_IOC (1 << 24) /* Interrupt on Complete */ -#define USBSTS 2 - -typedef enum { - TD_TYPE, QH_TYPE -} uhci_desc_type_t; - -typedef struct { - __u32 link; - __u32 status; - __u32 info; - __u32 buffer; -} uhci_td_t, *puhci_td_t; - - -typedef struct { - __u32 head; - __u32 element; /* Queue element pointer */ -} uhci_qh_t, *puhci_qh_t; - -typedef struct { - union { - uhci_td_t td; - uhci_qh_t qh; - } hw; - uhci_desc_type_t type; - dma_addr_t dma_addr; - struct list_head horizontal; - struct list_head vertical; - struct list_head desc_list; - int last_used; -} uhci_desc_t, *puhci_desc_t; - -typedef struct { - struct list_head desc_list; // list pointer to all corresponding TDs/QHs associated with this request - dma_addr_t setup_packet_dma; - dma_addr_t transfer_buffer_dma; - unsigned long started; -#ifdef USB2420 - struct urb *next_queued_urb; // next queued urb for this EP - struct urb *prev_queued_urb; -#else - urb_t *next_queued_urb; - urb_t *prev_queued_urb; -#endif - uhci_desc_t *bottom_qh; - uhci_desc_t *next_qh; // next helper QH - char use_loop; - char flags; -} urb_priv_t, *purb_priv_t; - -struct virt_root_hub { - int devnum; /* Address of Root Hub endpoint */ - void *urb; - void *int_addr; - int send; - int interval; - int numports; - int c_p_r[8]; - struct timer_list rh_int_timer; -}; - -typedef struct uhci { - int irq; - unsigned int io_addr; - unsigned int io_size; - unsigned int maxports; - int running; - - int apm_state; - - struct uhci *next; // chain of uhci device contexts - - struct list_head urb_list; // list of all pending urbs - - spinlock_t urb_list_lock; // lock to keep consistency - - int unlink_urb_done; - atomic_t avoid_bulk; - - struct usb_bus *bus; // our bus - - __u32 *framelist; - dma_addr_t framelist_dma; - uhci_desc_t **iso_td; - uhci_desc_t *int_chain[8]; - uhci_desc_t *ls_control_chain; - uhci_desc_t *control_chain; - uhci_desc_t *bulk_chain; - uhci_desc_t *chain_end; - uhci_desc_t *td1ms; - uhci_desc_t *td32ms; - struct list_head free_desc; - spinlock_t qh_lock; - spinlock_t td_lock; - struct virt_root_hub rh; //private data of the virtual root hub - int loop_usage; // URBs using bandwidth reclamation - - struct list_head urb_unlinked; // list of all unlinked urbs - long timeout_check; - int timeout_urbs; - struct pci_dev *uhci_pci; - struct pci_pool *desc_pool; - long last_error_time; // last error output in uhci_interrupt() -} uhci_t, *puhci_t; -#endif diff --git a/drivers/dahdi/dahdi_dynamic.c b/drivers/dahdi/dahdi_dynamic.c index c379918..3e913d1 100644 --- a/drivers/dahdi/dahdi_dynamic.c +++ b/drivers/dahdi/dahdi_dynamic.c @@ -33,14 +33,11 @@ #include <linux/sched.h> #include <linux/interrupt.h> #include <linux/vmalloc.h> +#include <linux/moduleparam.h> #include <dahdi/kernel.h> #include <dahdi/user.h> -#ifdef LINUX26 -#include <linux/moduleparam.h> -#endif - /* * Tasklets provide better system interactive response at the cost of the * possibility of losing a frame of data at very infrequent intervals. If @@ -515,12 +512,8 @@ static int ztd_open(struct dahdi_chan *chan) return -ENODEV; z->usecount++; } -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#else if(!try_module_get(THIS_MODULE)) printk("TDMoX: Unable to increment module use count\n"); -#endif return 0; } @@ -537,11 +530,7 @@ static int ztd_close(struct dahdi_chan *chan) z->usecount--; if (z->dead && !z->usecount) dynamic_destroy(z); -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#else module_put(THIS_MODULE); -#endif return 0; } @@ -851,11 +840,8 @@ void ztdynamic_cleanup(void) printk("DAHDI Dynamic Span support unloaded\n"); } -#ifdef LINUX26 module_param(debug, int, 0600); -#else -MODULE_PARM(debug, "i"); -#endif + MODULE_DESCRIPTION("DAHDI Dynamic Span Support"); MODULE_AUTHOR("Mark Spencer <markster@digium.com>"); #ifdef MODULE_LICENSE diff --git a/drivers/dahdi/dahdi_dynamic_eth.c b/drivers/dahdi/dahdi_dynamic_eth.c index da91907..a797d84 100644 --- a/drivers/dahdi/dahdi_dynamic_eth.c +++ b/drivers/dahdi/dahdi_dynamic_eth.c @@ -288,11 +288,7 @@ static void ztdeth_destroy(void *pvt) if (cur == z) { /* Successfully removed */ printk("TDMoE: Removed interface for %s\n", z->span->name); kfree(z); -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#else module_put(THIS_MODULE); -#endif } } @@ -394,12 +390,8 @@ static void *ztdeth_create(struct dahdi_span *span, char *addr) z->next = zdevs; zdevs = z; spin_unlock_irqrestore(&zlock, flags); -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#else if(!try_module_get(THIS_MODULE)) printk("TDMoE: Unable to increment module use count\n"); -#endif } return z; } diff --git a/drivers/dahdi/dahdi_dynamic_loc.c b/drivers/dahdi/dahdi_dynamic_loc.c index f16d68f..7ed9d7e 100644 --- a/drivers/dahdi/dahdi_dynamic_loc.c +++ b/drivers/dahdi/dahdi_dynamic_loc.c @@ -154,11 +154,7 @@ static int digit2int(char d) spin_unlock_irqrestore(&zlock, flags); if (cur == z) { printk("TDMoL: Removed interface for %s, key %d id %d\n", z->span->name, z->key, z->id); -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#else module_put(THIS_MODULE); -#endif kfree(z); } } @@ -223,12 +219,8 @@ static int digit2int(char d) z->next = zdevs; zdevs = z; spin_unlock_irqrestore(&zlock, flags); -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#else if(!try_module_get(THIS_MODULE)) printk("TDMoL: Unable to increment module use count\n"); -#endif printk("TDMoL: Added new interface for %s, key %d id %d\n", span->name, z->key, z->id); } diff --git a/drivers/dahdi/dahdi_transcode.c b/drivers/dahdi/dahdi_transcode.c index 4788f74..d47beda 100644 --- a/drivers/dahdi/dahdi_transcode.c +++ b/drivers/dahdi/dahdi_transcode.c @@ -35,11 +35,8 @@ #include <linux/vmalloc.h> #include <linux/mm.h> #include <linux/page-flags.h> -#include <asm/io.h> - -#ifdef LINUX26 #include <linux/moduleparam.h> -#endif +#include <asm/io.h> #include <dahdi/kernel.h> #include <dahdi/user.h> @@ -472,11 +469,8 @@ void zttranscode_cleanup(void) printk("DAHDI Transcoder support unloaded\n"); } -#ifdef LINUX26 module_param(debug, int, S_IRUGO | S_IWUSR); -#else -MODULE_PARM(debug, "i"); -#endif + MODULE_DESCRIPTION("DAHDI Transcoder Support"); MODULE_AUTHOR("Mark Spencer <markster@digium.com>"); #ifdef MODULE_LICENSE diff --git a/drivers/dahdi/pciradio.c b/drivers/dahdi/pciradio.c index 081551e..1f90af3 100644 --- a/drivers/dahdi/pciradio.c +++ b/drivers/dahdi/pciradio.c @@ -50,17 +50,13 @@ With driver: 303826 (1.5 %) #include <linux/errno.h> #include <linux/pci.h> #include <linux/interrupt.h> +#include <linux/moduleparam.h> #include <asm/io.h> #include <asm/delay.h> - #include <dahdi/kernel.h> #include <dahdi/user.h> -#ifdef LINUX26 -#include <linux/moduleparam.h> -#endif - #define RAD_MAX_IFACES 128 #define NUM_CODES 15 @@ -732,11 +728,7 @@ static void pciradio_reset_serial(struct pciradio *rad); static void pciradio_restart_dma(struct pciradio *rad); #ifdef LEAVE_THIS_COMMENTED_OUT -#ifdef LINUX26 static irqreturn_t pciradio_interrupt(int irq, void *dev_id, struct pt_regs *regs) -#else -static void pciradio_interrupt(int irq, void *dev_id, struct pt_regs *regs) -#endif #endif DAHDI_IRQ_HANDLER(pciradio_interrupt) @@ -749,30 +741,18 @@ DAHDI_IRQ_HANDLER(pciradio_interrupt) outb(ints, rad->ioaddr + RAD_INTSTAT); if (!ints) -#ifdef LINUX26 return IRQ_NONE; -#else - return; -#endif if (ints & 0x10) { /* Stop DMA, wait for watchdog */ printk("RADIO PCI Master abort\n"); pciradio_stop_dma(rad); -#ifdef LINUX26 return IRQ_RETVAL(1); -#else - return; -#endif } if (ints & 0x20) { printk("RADIO PCI Target abort\n"); -#ifdef LINUX26 return IRQ_RETVAL(1); -#else - return; -#endif } if (ints & 0x0f) { @@ -975,10 +955,8 @@ DAHDI_IRQ_HANDLER(pciradio_interrupt) /* output LED's */ __pciradio_setcreg(rad, 9, i); } -#ifdef LINUX26 + return IRQ_RETVAL(1); -#endif - } static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long data) @@ -1443,9 +1421,6 @@ static int pciradio_open(struct dahdi_chan *chan) if (rad->dead) return -ENODEV; rad->usecount++; -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#endif return 0; } @@ -1460,9 +1435,6 @@ static int pciradio_close(struct dahdi_chan *chan) { struct pciradio *rad = chan->pvt; rad->usecount--; -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#endif /* If we're dead, release us now */ if (!rad->usecount && rad->dead) pciradio_release(rad); @@ -1891,11 +1863,7 @@ MODULE_DEVICE_TABLE(pci, pciradio_pci_tbl); static struct pci_driver pciradio_driver = { name: "pciradio", probe: pciradio_init_one, -#ifdef LINUX26 remove: __devexit_p(pciradio_remove_one), -#else - remove: pciradio_remove_one, -#endif suspend: NULL, resume: NULL, id_table: pciradio_pci_tbl, @@ -1916,13 +1884,9 @@ static void __exit pciradio_cleanup(void) pci_unregister_driver(&pciradio_driver); } -#ifdef LINUX26 module_param(debug, int, 0600); -#else -MODULE_PARM(debug, "i"); -#endif -MODULE_DESCRIPTION("DAHDI Telephony PCI Radio Card DAHDI Driver"); +MODULE_DESCRIPTION("DAHDI Telephony PCI Radio Card Driver"); MODULE_AUTHOR("Jim Dixon <jim@lambdatel.com>"); #ifdef MODULE_LICENSE diff --git a/drivers/dahdi/tor2.c b/drivers/dahdi/tor2.c index cfd8147..473d8f8 100644 --- a/drivers/dahdi/tor2.c +++ b/drivers/dahdi/tor2.c @@ -32,12 +32,10 @@ #include <linux/init.h> #include <linux/sched.h> #include <linux/interrupt.h> +#include <linux/moduleparam.h> #include <dahdi/kernel.h> #include <dahdi/user.h> -#ifdef LINUX26 -#include <linux/moduleparam.h> -#endif #define NEED_PCI_IDS #include "tor2-hw.h" #include "tor2fw.h" @@ -251,17 +249,11 @@ static int tor2_chanconfig(struct dahdi_chan *chan, int sigtype) static int tor2_open(struct dahdi_chan *chan) { -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#endif return 0; } static int tor2_close(struct dahdi_chan *chan) { -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#endif return 0; } @@ -629,11 +621,7 @@ static void __devexit tor2_remove(struct pci_dev *pdev) static struct pci_driver tor2_driver = { name: "tormenta2", probe: tor2_probe, -#ifdef LINUX26 remove: __devexit_p(tor2_remove), -#else - remove: tor2_remove, -#endif id_table: tor2_pci_ids, }; @@ -1192,11 +1180,7 @@ DAHDI_IRQ_HANDLER(tor2_intr) /* make sure its a real interrupt for us */ if (!(tor->mem8[STATREG] & INTACTIVE)) /* if not, just return */ { -#ifdef LINUX26 return IRQ_NONE; -#else - return; -#endif } if (tor->cardtype == TYPE_E1) @@ -1484,9 +1468,7 @@ DAHDI_IRQ_HANDLER(tor2_intr) else /* clear OUTBIT and enable interrupts */ tor->mem8[CTLREG] = INTENA | tor->master; -#ifdef LINUX26 return IRQ_RETVAL(1); -#endif } @@ -1505,17 +1487,10 @@ MODULE_DESCRIPTION("Tormenta 2 PCI Quad T1 or E1 DAHDI Driver"); MODULE_LICENSE("GPL"); #endif -#ifdef LINUX26 module_param(debug, int, 0600); module_param(loopback, int, 0600); module_param(timingcable, int, 0600); module_param(japan, int, 0600); -#else -MODULE_PARM(debug, "i"); -MODULE_PARM(loopback, "i"); -MODULE_PARM(timingcable, "i"); -MODULE_PARM(japan, "i"); -#endif MODULE_DEVICE_TABLE(pci, tor2_pci_ids); diff --git a/drivers/dahdi/wcfxo.c b/drivers/dahdi/wcfxo.c index ca10f73..3b54f52 100644 --- a/drivers/dahdi/wcfxo.c +++ b/drivers/dahdi/wcfxo.c @@ -32,14 +32,11 @@ #include <linux/errno.h> #include <linux/pci.h> #include <asm/io.h> +#include <linux/moduleparam.h> #include <dahdi/kernel.h> #include <dahdi/user.h> -#ifdef LINUX26 -#include <linux/moduleparam.h> -#endif - /* Uncomment to enable tasklet handling in the FXO driver. Not recommended in general, but may improve interactive performance */ @@ -445,11 +442,7 @@ DAHDI_IRQ_HANDLER(wcfxo_interrupt) if (!ints) -#ifdef LINUX26 return IRQ_NONE; -#else - return; -#endif outb(ints, wc->ioaddr + WC_INTSTAT); @@ -474,20 +467,12 @@ DAHDI_IRQ_HANDLER(wcfxo_interrupt) printk("FXO PCI Master abort\n"); /* Stop DMA andlet the watchdog start it again */ wcfxo_stop_dma(wc); -#ifdef LINUX26 return IRQ_RETVAL(1); -#else - return; -#endif } if (ints & 0x20) { printk("PCI Target abort\n"); -#ifdef LINUX26 return IRQ_RETVAL(1); -#else - return; -#endif } if (1 /* !(wc->report % 0xf) */) { /* Check for BATTERY from register and debounce for 8 ms */ @@ -561,9 +546,8 @@ DAHDI_IRQ_HANDLER(wcfxo_interrupt) #endif } -#ifdef LINUX26 + return IRQ_RETVAL(1); -#endif } static int wcfxo_setreg(struct wcfxo *wc, unsigned char reg, unsigned char value) @@ -587,9 +571,6 @@ static int wcfxo_open(struct dahdi_chan *chan) if (wc->dead) return -ENODEV; wc->usecount++; -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#endif return 0; } @@ -604,9 +585,6 @@ static int wcfxo_close(struct dahdi_chan *chan) { struct wcfxo *wc = chan->pvt; wc->usecount--; -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#endif /* If we're dead, release us now */ if (!wc->usecount && wc->dead) wcfxo_release(wc); @@ -1050,11 +1028,7 @@ MODULE_DEVICE_TABLE (pci, wcfxo_pci_tbl); static struct pci_driver wcfxo_driver = { name: "wcfxo", probe: wcfxo_init_one, -#ifdef LINUX26 remove: __devexit_p(wcfxo_remove_one), -#else - remove: wcfxo_remove_one, -#endif id_table: wcfxo_pci_tbl, }; @@ -1079,19 +1053,12 @@ static void __exit wcfxo_cleanup(void) pci_unregister_driver(&wcfxo_driver); } -#ifdef LINUX26 module_param(debug, int, 0644); module_param(quiet, int, 0444); module_param(boost, int, 0444); module_param(monitor, int, 0444); module_param(opermode, int, 0444); -#else -MODULE_PARM(debug, "i"); -MODULE_PARM(quiet, "i"); -MODULE_PARM(boost, "i"); -MODULE_PARM(monitor, "i"); -MODULE_PARM(opermode, "i"); -#endif + MODULE_DESCRIPTION("Wildcard X100P DAHDI Driver"); MODULE_AUTHOR("Mark Spencer <markster@digium.com>"); #ifdef MODULE_LICENSE diff --git a/drivers/dahdi/wct1xxp.c b/drivers/dahdi/wct1xxp.c index 36be131..51c3924 100644 --- a/drivers/dahdi/wct1xxp.c +++ b/drivers/dahdi/wct1xxp.c @@ -32,12 +32,10 @@ #include <linux/errno.h> #include <linux/pci.h> #include <linux/spinlock.h> +#include <linux/moduleparam.h> #include <dahdi/kernel.h> #include <dahdi/user.h> -#ifdef LINUX26 -#include <linux/moduleparam.h> -#endif #define WC_MAX_CARDS 32 @@ -211,9 +209,6 @@ static int t1xxp_open(struct dahdi_chan *chan) if (wc->dead) return -ENODEV; wc->usecount++; -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#endif return 0; } @@ -286,9 +281,6 @@ static int t1xxp_close(struct dahdi_chan *chan) { struct t1xxp *wc = chan->pvt; wc->usecount--; -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#endif /* If we're dead, release us now */ if (!wc->usecount && wc->dead) t1xxp_release(wc); @@ -1159,11 +1151,7 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt) ints = inb(wc->ioaddr + WC_INTSTAT); if (!ints) -#ifdef LINUX26 return IRQ_NONE; -#else - return; -#endif outb(ints, wc->ioaddr + WC_INTSTAT); @@ -1211,9 +1199,7 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt) if (ints & 0x20) printk("PCI Target abort\n"); -#ifdef LINUX26 return IRQ_RETVAL(1); -#endif } static int t1xxp_hardware_init(struct t1xxp *wc) @@ -1397,11 +1383,7 @@ MODULE_DEVICE_TABLE(pci,t1xxp_pci_tbl); static struct pci_driver t1xxp_driver = { name: "t1xxp", probe: t1xxp_init_one, -#ifdef LINUX26 remove: __devexit_p(t1xxp_remove_one), -#else - remove: t1xxp_remove_one, -#endif suspend: NULL, resume: NULL, id_table: t1xxp_pci_tbl, @@ -1421,11 +1403,8 @@ static void __exit t1xxp_cleanup(void) pci_unregister_driver(&t1xxp_driver); } -#ifdef LINUX26 module_param(debug, int, 0600); -#else -MODULE_PARM(debug, "i"); -#endif + MODULE_DESCRIPTION("Wildcard T100P/E100P DAHDI Driver"); MODULE_AUTHOR("Mark Spencer <markster@digium.com>"); #ifdef MODULE_LICENSE diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c index 0665327..22b4417 100644 --- a/drivers/dahdi/wct4xxp/base.c +++ b/drivers/dahdi/wct4xxp/base.c @@ -37,19 +37,16 @@ #include <asm/io.h> #include <linux/version.h> #include <linux/delay.h> +#include <linux/moduleparam.h> #include <dahdi/kernel.h> #include <dahdi/user.h> -#ifdef LINUX26 -#include <linux/moduleparam.h> -#endif - #include "wct4xxp.h" #include "vpm450m.h" /* Work queues are a way to better distribute load on SMP systems */ -#if defined(LINUX26) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) /* * Work queues can significantly improve performance and scalability * on multi-processor machines, but requires bypassing some kernel @@ -1521,22 +1518,15 @@ static int t4_chanconfig(struct dahdi_chan *chan, int sigtype) static int t4_open(struct dahdi_chan *chan) { -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#else try_module_get(THIS_MODULE); -#endif return 0; } static int t4_close(struct dahdi_chan *chan) { -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#else module_put(THIS_MODULE); -#endif + return 0; } @@ -2812,21 +2802,13 @@ DAHDI_IRQ_HANDLER(t4_interrupt) /* Ignore if it's not for us */ if (!status) -#ifdef LINUX26 return IRQ_NONE; -#else - return; -#endif __t4_pci_out(wc, WC_INTR, 0); if (!wc->spansstarted) { printk("Not prepped yet!\n"); -#ifdef LINUX26 return IRQ_NONE; -#else - return; -#endif } wc->intcount++; @@ -2876,9 +2858,8 @@ DAHDI_IRQ_HANDLER(t4_interrupt) __t4_set_timing_source_auto(wc); spin_unlock_irqrestore(&wc->reglock, flags); -#ifdef LINUX26 + return IRQ_RETVAL(1); -#endif } #endif @@ -2924,11 +2905,7 @@ DAHDI_IRQ_HANDLER(t4_interrupt_gen2) /* Ignore if it's not for us */ if (!(status & 0x7)) { -#ifdef LINUX26 return IRQ_NONE; -#else - return; -#endif } #ifdef ENABLE_WORKQUEUES @@ -2937,11 +2914,7 @@ DAHDI_IRQ_HANDLER(t4_interrupt_gen2) if (unlikely(!wc->spansstarted)) { printk("Not prepped yet!\n"); -#ifdef LINUX26 return IRQ_NONE; -#else - return; -#endif } wc->intcount++; @@ -3024,9 +2997,8 @@ DAHDI_IRQ_HANDLER(t4_interrupt_gen2) #ifndef ENABLE_WORKQUEUES __t4_pci_out(wc, WC_INTR, 0); #endif -#ifdef LINUX26 + return IRQ_RETVAL(1); -#endif } #ifdef SUPPORT_GEN1 @@ -3821,11 +3793,7 @@ static struct pci_device_id t4_pci_tbl[] __devinitdata = static struct pci_driver t4_driver = { name: "wct4xxp", probe: t4_init_one, -#ifdef LINUX26 remove: __devexit_p(t4_remove_one), -#else - remove: t4_remove_one, -#endif suspend: NULL, resume: NULL, id_table: t4_pci_tbl, @@ -3854,7 +3822,6 @@ MODULE_ALIAS("wct2xxp"); #ifdef MODULE_LICENSE MODULE_LICENSE("GPL"); #endif -#ifdef LINUX26 module_param(pedanticpci, int, 0600); module_param(debug, int, 0600); module_param(loopback, int, 0600); @@ -3870,24 +3837,6 @@ module_param(vpmdtmfsupport, int, 0600); module_param(vpmspans, int, 0600); module_param(dtmfthreshold, int, 0600); #endif -#else -MODULE_PARM(pedanticpci, "i"); -MODULE_PARM(debug, "i"); -MODULE_PARM(loopback, "i"); -MODULE_PARM(noburst, "i"); -MODULE_PARM(hardhdlcmode, "i"); -MODULE_PARM(timingcable, "i"); -MODULE_PARM(t1e1override, "i"); -MODULE_PARM(alarmdebounce, "i"); -MODULE_PARM(j1mode, "i"); -MODULE_PARM(sigmode, "i"); -#ifdef VPM_SUPPORT -MODULE_PARM(vpmsupport, "i"); -MODULE_PARM(vpmdtmfsupport, "i"); -MODULE_PARM(vpmspans, "i"); -MODULE_PARM(dtmfthreshold, "i"); -#endif -#endif MODULE_DEVICE_TABLE(pci, t4_pci_tbl); diff --git a/drivers/dahdi/wctdm.c b/drivers/dahdi/wctdm.c index 601ae8a..07389ad 100644 --- a/drivers/dahdi/wctdm.c +++ b/drivers/dahdi/wctdm.c @@ -31,6 +31,7 @@ #include <linux/errno.h> #include <linux/pci.h> #include <linux/interrupt.h> +#include <linux/moduleparam.h> #include <asm/io.h> #include "proslic.h" #include "wctdm.h" @@ -114,10 +115,6 @@ static alpha indirect_regs[] = #include "fxo_modes.h" -#ifdef LINUX26 -#include <linux/moduleparam.h> -#endif - #define NUM_FXO_REGS 60 #define WC_MAX_IFACES 128 @@ -1013,11 +1010,7 @@ DAHDI_IRQ_HANDLER(wctdm_interrupt) ints = inb(wc->ioaddr + WC_INTSTAT); if (!ints) -#ifdef LINUX26 return IRQ_NONE; -#else - return; -#endif outb(ints, wc->ioaddr + WC_INTSTAT); @@ -1025,20 +1018,12 @@ DAHDI_IRQ_HANDLER(wctdm_interrupt) /* Stop DMA, wait for watchdog */ printk("TDM PCI Master abort\n"); wctdm_stop_dma(wc); -#ifdef LINUX26 return IRQ_RETVAL(1); -#else - return; -#endif } if (ints & 0x20) { printk("PCI Target abort\n"); -#ifdef LINUX26 return IRQ_RETVAL(1); -#else - return; -#endif } for (x=0;x<4;x++) { @@ -1119,10 +1104,8 @@ DAHDI_IRQ_HANDLER(wctdm_interrupt) wctdm_receiveprep(wc, ints); wctdm_transmitprep(wc, ints); } -#ifdef LINUX26 + return IRQ_RETVAL(1); -#endif - } static int wctdm_voicedaa_insane(struct wctdm *wc, int card) @@ -1934,11 +1917,7 @@ static int wctdm_open(struct dahdi_chan *chan) if (wc->dead) return -ENODEV; wc->usecount++; -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#else try_module_get(THIS_MODULE); -#endif return 0; } @@ -1953,11 +1932,7 @@ static int wctdm_close(struct dahdi_chan *chan) { struct wctdm *wc = chan->pvt; wc->usecount--; -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#else module_put(THIS_MODULE); -#endif if (wc->modtype[chan->chanpos - 1] == MOD_TYPE_FXS) { if (reversepolarity) wc->mod[chan->chanpos - 1].fxs.idletxhookstate = 5; @@ -2444,11 +2419,7 @@ MODULE_DEVICE_TABLE(pci, wctdm_pci_tbl); static struct pci_driver wctdm_driver = { name: "wctdm", probe: wctdm_init_one, -#ifdef LINUX26 remove: __devexit_p(wctdm_remove_one), -#else - remove: wctdm_remove_one, -#endif suspend: NULL, resume: NULL, id_table: wctdm_pci_tbl, @@ -2503,7 +2474,6 @@ static void __exit wctdm_cleanup(void) pci_unregister_driver(&wctdm_driver); } -#ifdef LINUX26 module_param(debug, int, 0600); module_param(loopcurrent, int, 0600); module_param(reversepolarity, int, 0600); @@ -2525,29 +2495,7 @@ module_param(fxotxgain, int, 0600); module_param(fxorxgain, int, 0600); module_param(fxstxgain, int, 0600); module_param(fxsrxgain, int, 0600); -#else -MODULE_PARM(debug, "i"); -MODULE_PARM(loopcurrent, "i"); -MODULE_PARM(reversepolarity, "i"); -MODULE_PARM(robust, "i"); -MODULE_PARM(opermode, "s"); -MODULE_PARM(timingonly, "i"); -MODULE_PARM(lowpower, "i"); -MODULE_PARM(boostringer, "i"); -MODULE_PARM(fastringer, "i"); -MODULE_PARM(fxshonormode, "i"); -MODULE_PARM(battdebounce, "i"); -MODULE_PARM(battalarm, "i"); -MODULE_PARM(battthresh, "i"); -MODULE_PARM(ringdebounce, "i"); -MODULE_PARM(fwringdetect, "i"); -MODULE_PARM(alawoverride, "i"); -MODULE_PARM(fastpickup, "i"); -MODULE_PARM(fxotxgain, "i"); -MODULE_PARM(fxorxgain, "i"); -MODULE_PARM(fxstxgain, "i"); -MODULE_PARM(fxsrxgain, "i"); -#endif + MODULE_DESCRIPTION("Wildcard TDM400P DAHDI Driver"); MODULE_AUTHOR("Mark Spencer <markster@digium.com>"); #if defined(MODULE_ALIAS) diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 9acf6f1..2b94201 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -44,11 +44,8 @@ Tx Gain - W/Pre-Emphasis: -23.99 to 0.00 db #include <linux/interrupt.h> #include <linux/workqueue.h> #include <linux/delay.h> -#include <asm/semaphore.h> - -#ifdef LINUX26 #include <linux/moduleparam.h> -#endif +#include <asm/semaphore.h> #include <dahdi/kernel.h> #include <dahdi/user.h> @@ -2606,11 +2603,7 @@ static int wctdm_open(struct dahdi_chan *chan) if (wc->dead) return -ENODEV; wc->usecount++; -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#else try_module_get(THIS_MODULE); -#endif return 0; } @@ -2626,11 +2619,7 @@ static int wctdm_close(struct dahdi_chan *chan) int x; signed char reg; wc->usecount--; -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#else module_put(THIS_MODULE); -#endif for (x=0;x<wc->cards;x++) { if (wc->modtype[x] == MOD_TYPE_FXS) wc->mods[x].fxs.idletxhookstate = 1; @@ -3933,11 +3922,7 @@ MODULE_DEVICE_TABLE(pci, wctdm_pci_tbl); static struct pci_driver wctdm_driver = { name: "wctdm24xxp", probe: wctdm_init_one, -#ifdef LINUX26 remove: __devexit_p(wctdm_remove_one), -#else - remove: wctdm_remove_one, -#endif suspend: NULL, resume: NULL, id_table: wctdm_pci_tbl, @@ -3992,7 +3977,6 @@ static void __exit wctdm_cleanup(void) pci_unregister_driver(&wctdm_driver); } -#ifdef LINUX26 module_param(debug, int, 0600); module_param(fxovoltage, int, 0600); module_param(loopcurrent, int, 0600); @@ -4022,36 +4006,7 @@ module_param(vpmnlptype, int, 0600); module_param(vpmnlpthresh, int, 0600); module_param(vpmnlpmaxsupp, int, 0600); #endif -#else -MODULE_PARM(debug, "i"); -MODULE_PARM(fxovoltage, "i"); -MODULE_PARM(loopcurrent, "i"); -MODULE_PARM(robust, "i"); -MODULE_PARM(opermode, "s"); -MODULE_PARM(lowpower, "i"); -MODULE_PARM(boostringer, "i"); -MODULE_PARM(fastringer, "i"); -MODULE_PARM(fxshonormode, "i"); -MODULE_PARM(battdebounce, "i"); -MODULE_PARM(battalarm, "i"); -MODULE_PARM(battthresh, "i"); -MODULE_PARM(alawoverride, "i"); -MODULE_PARM(nativebridge, "i"); -MODULE_PARM(fxotxgain, "i"); -MODULE_PARM(fxorxgain, "i"); -MODULE_PARM(fxstxgain, "i"); -MODULE_PARM(fxsrxgain, "i"); -MODULE_PARM(ringdebounce, "i"); -MODULE_PARM(fwringdetect, "i"); -#ifdef VPM_SUPPORT -MODULE_PARM(vpmsupport, "i"); -MODULE_PARM(vpmdtmfsupport, "i"); -MODULE_PARM(dtmfthreshold, "i"); -MODULE_PARM(vpmnlptype, "i"); -MODULE_PARM(vpmnlpthresh, "i"); -MODULE_PARM(vpmnlpmaxsupp, "i"); -#endif -#endif + MODULE_DESCRIPTION("Wildcard TDM2400P/TDM800P DAHDI Driver"); MODULE_AUTHOR("Mark Spencer <markster@digium.com>"); #if defined(MODULE_ALIAS) diff --git a/drivers/dahdi/wcte11xp.c b/drivers/dahdi/wcte11xp.c index ef2c6be..824e8e1 100644 --- a/drivers/dahdi/wcte11xp.c +++ b/drivers/dahdi/wcte11xp.c @@ -32,14 +32,11 @@ #include <linux/errno.h> #include <linux/pci.h> #include <linux/spinlock.h> +#include <linux/moduleparam.h> #include <dahdi/kernel.h> #include <dahdi/user.h> -#ifdef LINUX26 -#include <linux/moduleparam.h> -#endif - /* XXX: fix this */ #include "wct4xxp/wct4xxp.h" /* For certain definitions */ @@ -235,11 +232,8 @@ static int t1xxp_open(struct dahdi_chan *chan) if (wc->dead) return -ENODEV; wc->usecount++; -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#else try_module_get(THIS_MODULE); -#endif + return 0; } @@ -356,12 +350,9 @@ static void t1xxp_release(struct t1 *wc) static int t1xxp_close(struct dahdi_chan *chan) { struct t1 *wc = chan->pvt; + wc->usecount--; -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#else module_put(THIS_MODULE); -#endif /* If we're dead, release us now */ if (!wc->usecount && wc->dead) t1xxp_release(wc); @@ -1333,11 +1324,7 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt) ints = inb(wc->ioaddr + WC_INTSTAT); if (!ints) -#ifdef LINUX26 return IRQ_NONE; -#else - return; -#endif outb(ints, wc->ioaddr + WC_INTSTAT); @@ -1386,9 +1373,7 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt) if (ints & 0x20) printk("PCI Target abort\n"); -#ifdef LINUX26 return IRQ_RETVAL(1); -#endif } static int t1xxp_hardware_init(struct t1 *wc) @@ -1596,11 +1581,7 @@ MODULE_DEVICE_TABLE(pci,t1xxp_pci_tbl); static struct pci_driver t1xxp_driver = { name: "wcte11xp", probe: t1xxp_init_one, -#ifdef LINUX26 remove: __devexit_p(t1xxp_remove_one), -#else - remove: t1xxp_remove_one, -#endif suspend: NULL, resume: NULL, id_table: t1xxp_pci_tbl, @@ -1620,7 +1601,6 @@ static void __exit t1xxp_cleanup(void) pci_unregister_driver(&t1xxp_driver); } -#ifdef LINUX26 module_param(alarmdebounce, int, 0600); module_param(loopback, int, 0600); module_param(t1e1override, int, 0600); @@ -1628,15 +1608,7 @@ module_param(unchannelized, int, 0600); module_param(clockextra, int, 0600); module_param(debug, int, 0600); module_param(j1mode, int, 0600); -#else -MODULE_PARM(alarmdebounce, "i"); -MODULE_PARM(loopback, "i"); -MODULE_PARM(t1e1override, "i"); -MODULE_PARM(unchannelized, "i"); -MODULE_PARM(clockextra, "i"); -MODULE_PARM(debug, "i"); -MODULE_PARM(j1mode, "i"); -#endif + MODULE_DESCRIPTION("Wildcard TE110P DAHDI Driver"); MODULE_AUTHOR("Mark Spencer <markster@digium.com>"); #ifdef MODULE_LICENSE diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c index 20f2da5..e98cc35 100644 --- a/drivers/dahdi/wcte12xp/base.c +++ b/drivers/dahdi/wcte12xp/base.c @@ -35,10 +35,7 @@ #include <linux/errno.h> #include <linux/pci.h> #include <linux/proc_fs.h> - -#ifdef LINUX26 #include <linux/moduleparam.h> -#endif #include <dahdi/kernel.h> #include <dahdi/user.h> @@ -981,11 +978,7 @@ static int t1xxp_open(struct dahdi_chan *chan) return -ENODEV; wc->usecount++; -#ifndef LINUX26 - MOD_INC_USE_COUNT; -#else try_module_get(THIS_MODULE); -#endif return 0; } @@ -996,11 +989,7 @@ static int t1xxp_close(struct dahdi_chan *chan) wc->usecount--; -#ifndef LINUX26 - MOD_DEC_USE_COUNT; -#else module_put(THIS_MODULE); -#endif /* If we're dead, release us now */ if (!wc->usecount && wc->dead) @@ -1703,11 +1692,7 @@ MODULE_DEVICE_TABLE(pci, te12xp_pci_tbl); struct pci_driver te12xp_driver = { name: "wcte12xp", probe: te12xp_init_one, -#ifdef LINUX26 remove: __devexit_p(te12xp_remove_one), -#else - remove: te12xp_remove_one, -#endif suspend: NULL, resume: NULL, id_table: te12xp_pci_tbl, @@ -1728,7 +1713,6 @@ static void __exit te12xp_cleanup(void) pci_unregister_driver(&te12xp_driver); } -#ifdef LINUX26 module_param(debug, int, S_IRUGO | S_IWUSR); module_param(loopback, int, S_IRUGO | S_IWUSR); module_param(t1e1override, int, S_IRUGO | S_IWUSR); @@ -1740,21 +1724,6 @@ module_param(vpmsupport, int, S_IRUGO | S_IWUSR); module_param(vpmdtmfsupport, int, S_IRUGO | S_IWUSR); module_param(vpmtsisupport, int, S_IRUGO | S_IWUSR); #endif -#else -MODULE_PARM(debug, "i"); -MODULE_PARM(loopback, "i"); -MODULE_PARM(t1e1override, "i"); -MODULE_PARM(j1mode, "i"); -MODULE_PARM(alarmdebounce, "i"); -#ifdef VPM_SUPPORT -MODULE_PARM(vpmsupport, "i"); -MODULE_PARM(vpmdtmfsupport, "i"); -MODULE_PARM(vpmtsisupport, "i"); -MODULE_PARM(vpmnlptype, "i"); -MODULE_PARM(vpmnlpthresh, "i"); -MODULE_PARM(vpmnlpmaxsupp, "i"); -#endif -#endif #ifdef MODULE_LICENSE MODULE_LICENSE("GPL"); diff --git a/drivers/dahdi/wcte12xp/wcte12xp.h b/drivers/dahdi/wcte12xp/wcte12xp.h index 4de98d6..2ba4609 100644 --- a/drivers/dahdi/wcte12xp/wcte12xp.h +++ b/drivers/dahdi/wcte12xp/wcte12xp.h @@ -31,10 +31,8 @@ #ifndef _WCTE12XP_H #define _WCTE12XP_H -#ifdef LINUX26 /* Comment to disable VPM support */ #define VPM_SUPPORT 1 -#endif #define WC_MAX_IFACES 8 |