summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2012-03-13 20:09:12 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2012-03-13 20:09:12 +0000
commit00a4ff1bd81d8f3774792539cb50712231d72bfe (patch)
treef22e2a9c145d2b8d84a5e21cce25c7e0564636ad /drivers/dahdi/xpp
parent950b583f48e117ca3508ef973ad754e6e4b14808 (diff)
Remove support for kernels < 2.6.18
This patch removes support for kernel versions < 2.6.18, as those are not actively supported in any major Linux distribution (except RHEL4, which is in the "extended" support level of the product life cycle). This removes much of the more #ifdef-rich parts of the code. Signed-off-by: Oron Peled <oron.peled@xorcom.com> Acked-by: Acked-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10472 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp')
-rw-r--r--drivers/dahdi/xpp/card_bri.c2
-rw-r--r--drivers/dahdi/xpp/card_echo.c2
-rw-r--r--drivers/dahdi/xpp/card_fxo.c2
-rw-r--r--drivers/dahdi/xpp/card_fxs.c2
-rw-r--r--drivers/dahdi/xpp/card_pri.c2
-rw-r--r--drivers/dahdi/xpp/dahdi_debug.c5
-rw-r--r--drivers/dahdi/xpp/parport_debug.c5
-rw-r--r--drivers/dahdi/xpp/xbus-core.c5
-rw-r--r--drivers/dahdi/xpp/xbus-core.h13
-rw-r--r--drivers/dahdi/xpp/xbus-pcm.c5
-rw-r--r--drivers/dahdi/xpp/xbus-sysfs.c60
-rw-r--r--drivers/dahdi/xpp/xdefs.h10
-rw-r--r--drivers/dahdi/xpp/xpd.h19
-rw-r--r--drivers/dahdi/xpp/xpp_dahdi.c9
-rw-r--r--drivers/dahdi/xpp/xpp_usb.c73
15 files changed, 2 insertions, 212 deletions
diff --git a/drivers/dahdi/xpp/card_bri.c b/drivers/dahdi/xpp/card_bri.c
index 9dd9135..c7d4ff1 100644
--- a/drivers/dahdi/xpp/card_bri.c
+++ b/drivers/dahdi/xpp/card_bri.c
@@ -1743,9 +1743,7 @@ static struct xpd_driver bri_driver = {
.type = XPD_TYPE_BRI,
.driver = {
.name = "bri",
-#ifndef OLD_HOTPLUG_SUPPORT
.owner = THIS_MODULE,
-#endif
.probe = bri_xpd_probe,
.remove = bri_xpd_remove}
};
diff --git a/drivers/dahdi/xpp/card_echo.c b/drivers/dahdi/xpp/card_echo.c
index 3155656..91cb84e 100644
--- a/drivers/dahdi/xpp/card_echo.c
+++ b/drivers/dahdi/xpp/card_echo.c
@@ -329,9 +329,7 @@ static struct xpd_driver echo_driver = {
.type = XPD_TYPE_ECHO,
.driver = {
.name = "echo",
-#ifndef OLD_HOTPLUG_SUPPORT
.owner = THIS_MODULE,
-#endif
.probe = echo_xpd_probe,
.remove = echo_xpd_remove}
};
diff --git a/drivers/dahdi/xpp/card_fxo.c b/drivers/dahdi/xpp/card_fxo.c
index 9634829..5e83761 100644
--- a/drivers/dahdi/xpp/card_fxo.c
+++ b/drivers/dahdi/xpp/card_fxo.c
@@ -1481,9 +1481,7 @@ static struct xpd_driver fxo_driver = {
.type = XPD_TYPE_FXO,
.driver = {
.name = "fxo",
-#ifndef OLD_HOTPLUG_SUPPORT
.owner = THIS_MODULE,
-#endif
.probe = fxo_xpd_probe,
.remove = fxo_xpd_remove}
};
diff --git a/drivers/dahdi/xpp/card_fxs.c b/drivers/dahdi/xpp/card_fxs.c
index 98b0ec1..c9be904 100644
--- a/drivers/dahdi/xpp/card_fxs.c
+++ b/drivers/dahdi/xpp/card_fxs.c
@@ -1809,9 +1809,7 @@ static struct xpd_driver fxs_driver = {
.type = XPD_TYPE_FXS,
.driver = {
.name = "fxs",
-#ifndef OLD_HOTPLUG_SUPPORT
.owner = THIS_MODULE,
-#endif
.probe = fxs_xpd_probe,
.remove = fxs_xpd_remove}
};
diff --git a/drivers/dahdi/xpp/card_pri.c b/drivers/dahdi/xpp/card_pri.c
index 1aaedd5..8e37da9 100644
--- a/drivers/dahdi/xpp/card_pri.c
+++ b/drivers/dahdi/xpp/card_pri.c
@@ -2653,9 +2653,7 @@ static struct xpd_driver pri_driver = {
.type = XPD_TYPE_PRI,
.driver = {
.name = "pri",
-#ifndef OLD_HOTPLUG_SUPPORT
.owner = THIS_MODULE,
-#endif
.probe = pri_xpd_probe,
.remove = pri_xpd_remove}
};
diff --git a/drivers/dahdi/xpp/dahdi_debug.c b/drivers/dahdi/xpp/dahdi_debug.c
index 1fe4e65..ce93b16 100644
--- a/drivers/dahdi/xpp/dahdi_debug.c
+++ b/drivers/dahdi/xpp/dahdi_debug.c
@@ -20,11 +20,6 @@
*
*/
#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
-#warning "This module is tested only with 2.6 kernels"
-#endif
-
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/module.h>
diff --git a/drivers/dahdi/xpp/parport_debug.c b/drivers/dahdi/xpp/parport_debug.c
index bfb8ef3..6665992 100644
--- a/drivers/dahdi/xpp/parport_debug.c
+++ b/drivers/dahdi/xpp/parport_debug.c
@@ -20,11 +20,6 @@
*
*/
#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
-#warning "This module is tested only with 2.6 kernels"
-#endif
-
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/parport.h>
diff --git a/drivers/dahdi/xpp/xbus-core.c b/drivers/dahdi/xpp/xbus-core.c
index cd6effb..bab64e5 100644
--- a/drivers/dahdi/xpp/xbus-core.c
+++ b/drivers/dahdi/xpp/xbus-core.c
@@ -20,11 +20,6 @@
*
*/
#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
-#warning "This module is tested only with 2.6 kernels"
-#endif
-
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/errno.h>
diff --git a/drivers/dahdi/xpp/xbus-core.h b/drivers/dahdi/xpp/xbus-core.h
index 9bafb82..fbc0f94 100644
--- a/drivers/dahdi/xpp/xbus-core.h
+++ b/drivers/dahdi/xpp/xbus-core.h
@@ -354,19 +354,6 @@ void xbus_sysfs_transport_remove(xbus_t *xbus);
int xbus_sysfs_create(xbus_t *xbus);
void xbus_sysfs_remove(xbus_t *xbus);
-#ifdef OLD_HOTPLUG_SUPPORT_269
-/* Copy from new kernels lib/kobject_uevent.c */
-enum kobject_action {
- KOBJ_ADD,
- KOBJ_REMOVE,
- KOBJ_CHANGE,
- KOBJ_MOUNT,
- KOBJ_UMOUNT,
- KOBJ_OFFLINE,
- KOBJ_ONLINE,
-};
-#endif
-
void astribank_uevent_send(xbus_t *xbus, enum kobject_action act);
#endif /* XBUS_CORE_H */
diff --git a/drivers/dahdi/xpp/xbus-pcm.c b/drivers/dahdi/xpp/xbus-pcm.c
index 15ea9d2..32f04fa 100644
--- a/drivers/dahdi/xpp/xbus-pcm.c
+++ b/drivers/dahdi/xpp/xbus-pcm.c
@@ -20,11 +20,6 @@
*
*/
#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
-#warning "This module is tested only with 2.6 kernels"
-#endif
-
#include <linux/kernel.h>
#include <linux/module.h>
#include "xbus-pcm.h"
diff --git a/drivers/dahdi/xpp/xbus-sysfs.c b/drivers/dahdi/xpp/xbus-sysfs.c
index 936c6f7..ad58e15 100644
--- a/drivers/dahdi/xpp/xbus-sysfs.c
+++ b/drivers/dahdi/xpp/xbus-sysfs.c
@@ -20,11 +20,6 @@
*
*/
#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
-#warning "This module is tested only with 2.6 kernels"
-#endif
-
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/errno.h>
@@ -286,7 +281,6 @@ static DEVICE_ATTR_READER(driftinfo_show, dev, buf)
return len;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
#define xbus_attr(field, format_string) \
static ssize_t \
field##_show(struct device *dev, struct device_attribute *attr, char *buf) \
@@ -295,16 +289,6 @@ field##_show(struct device *dev, struct device_attribute *attr, char *buf) \
xbus = dev_to_xbus(dev); \
return sprintf(buf, format_string, xbus->field); \
}
-#else
-#define xbus_attr(field, format_string) \
-static ssize_t \
-field##_show(struct device *dev, char *buf) \
-{ \
- xbus_t *xbus; \
- xbus = dev_to_xbus(dev); \
- return sprintf(buf, format_string, xbus->field); \
-}
-#endif
xbus_attr(connector, "%s\n");
xbus_attr(label, "%s\n");
@@ -333,23 +317,6 @@ static int astribank_match(struct device *dev, struct device_driver *driver)
return 1;
}
-#ifdef OLD_HOTPLUG_SUPPORT
-static int astribank_hotplug(struct device *dev, char **envp, int envnum,
- char *buff, int bufsize)
-{
- xbus_t *xbus;
-
- if (!dev)
- return -ENODEV;
- xbus = dev_to_xbus(dev);
- envp[0] = buff;
- if (snprintf(buff, bufsize, "XBUS_NAME=%s", xbus->busname) >= bufsize)
- return -ENOMEM;
- envp[1] = NULL;
- return 0;
-}
-#else
-
#define XBUS_VAR_BLOCK \
do { \
XBUS_ADD_UEVENT_VAR("XPP_INIT_DIR=%s", initdir); \
@@ -407,8 +374,6 @@ static int astribank_uevent(struct device *dev, struct kobj_uevent_env *kenv)
#endif
-#endif /* OLD_HOTPLUG_SUPPORT */
-
void astribank_uevent_send(xbus_t *xbus, enum kobject_action act)
{
struct kobject *kobj;
@@ -416,26 +381,7 @@ void astribank_uevent_send(xbus_t *xbus, enum kobject_action act)
kobj = &xbus->astribank.kobj;
XBUS_DBG(DEVICES, xbus, "SYFS bus_id=%s action=%d\n",
dev_name(&xbus->astribank), act);
-
-#if defined(OLD_HOTPLUG_SUPPORT_269)
- {
- /* Copy from new kernels lib/kobject_uevent.c */
- static const char *str[] = {
- [KOBJ_ADD] "add",
- [KOBJ_REMOVE] "remove",
- [KOBJ_CHANGE] "change",
- [KOBJ_MOUNT] "mount",
- [KOBJ_UMOUNT] "umount",
- [KOBJ_OFFLINE] "offline",
- [KOBJ_ONLINE] "online"
- };
- kobject_hotplug(str[act], kobj);
- }
-#elif defined(OLD_HOTPLUG_SUPPORT)
- kobject_hotplug(kobj, act);
-#else
kobject_uevent(kobj, act);
-#endif
}
static void astribank_release(struct device *dev)
@@ -461,11 +407,7 @@ static void astribank_release(struct device *dev)
static struct bus_type toplevel_bus_type = {
.name = "astribanks",
.match = astribank_match,
-#ifdef OLD_HOTPLUG_SUPPORT
- .hotplug = astribank_hotplug,
-#else
.uevent = astribank_uevent,
-#endif
.dev_attrs = xbus_dev_attrs,
.drv_attrs = xpp_attrs,
};
@@ -493,9 +435,7 @@ static struct device_driver xpp_driver = {
.bus = &toplevel_bus_type,
.probe = astribank_probe,
.remove = astribank_remove,
-#ifndef OLD_HOTPLUG_SUPPORT
.owner = THIS_MODULE
-#endif
};
/*--------- Sysfs XPD handling ----*/
diff --git a/drivers/dahdi/xpp/xdefs.h b/drivers/dahdi/xpp/xdefs.h
index 8da10ea..054c30c 100644
--- a/drivers/dahdi/xpp/xdefs.h
+++ b/drivers/dahdi/xpp/xdefs.h
@@ -118,16 +118,6 @@ typedef char *charp;
kfree(p); \
} while (0);
-/*
- * Hotplug replaced with uevent in 2.6.16
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
-#define OLD_HOTPLUG_SUPPORT // for older kernels
-#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 10)
-#define OLD_HOTPLUG_SUPPORT_269 // for way older kernels
-#endif
-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
#define DEVICE_ATTR_READER(name, dev, buf) \
ssize_t name(struct device *dev, \
diff --git a/drivers/dahdi/xpp/xpd.h b/drivers/dahdi/xpp/xpd.h
index f5e6771..f341e18 100644
--- a/drivers/dahdi/xpp/xpd.h
+++ b/drivers/dahdi/xpp/xpd.h
@@ -42,13 +42,6 @@
#include <dahdi/kernel.h>
#ifdef __KERNEL__
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14)
-/* also added in RHEL kernels with the OpenInfiniband backport: */
-#if LINUX_VERSION_CODE != KERNEL_VERSION(2, 6, 9) || !defined(DEFINE_SPINLOCK)
-typedef unsigned gfp_t; /* Added in 2.6.14 */
-#endif
-#endif
-
/*
* FIXME: Kludge for 2.6.19
* bool is now defined as a proper boolean type (gcc _Bool)
@@ -64,23 +57,11 @@ typedef unsigned gfp_t; /* Added in 2.6.14 */
module_param(name, type, perm); \
MODULE_PARM_DESC(name, desc " [default " #init "]")
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 10)
-/*
- * Old 2.6 kernels had module_param_array() macro that receive the counter
- * by value.
- */
-#define DEF_ARRAY(type, name, count, init, desc) \
- unsigned int name ## _num_values; \
- type name[count] = { [0 ... ((count)-1)] = (init) }; \
- module_param_array(name, type, name ## _num_values, 0644); \
- MODULE_PARM_DESC(name, desc " ( 1-" __MODULE_STRING(count) ")")
-#else
#define DEF_ARRAY(type, name, count, init, desc) \
unsigned int name ## _num_values; \
type name[count] = {[0 ... ((count)-1)] = init}; \
module_param_array(name, type, &name ## _num_values, 0644); \
MODULE_PARM_DESC(name, desc " ( 1-" __MODULE_STRING(count) ")")
-#endif
#endif // __KERNEL__
#define CARD_DESC_MAGIC 0xca9dde5c
diff --git a/drivers/dahdi/xpp/xpp_dahdi.c b/drivers/dahdi/xpp/xpp_dahdi.c
index 7a0ab90..d2a5503 100644
--- a/drivers/dahdi/xpp/xpp_dahdi.c
+++ b/drivers/dahdi/xpp/xpp_dahdi.c
@@ -25,11 +25,6 @@
*
*/
#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
-#warning "This module is tested only with 2.6 kernels"
-#endif
-
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/errno.h>
@@ -79,11 +74,7 @@ static void phonedev_cleanup(xpd_t *xpd);
static int parport_xbuses[2] = { 0, 1 };
unsigned int parport_xbuses_num_values;
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 9)
module_param_array(parport_xbuses, int, &parport_xbuses_num_values, 0577);
-#else
-module_param_array(parport_xbuses, int, parport_xbuses_num_values, 0577);
-#endif
MODULE_PARM_DESC(parport_xbuses, "Id's of xbuses to sample (1-2)");
/*
diff --git a/drivers/dahdi/xpp/xpp_usb.c b/drivers/dahdi/xpp/xpp_usb.c
index af83b52..8a55963 100644
--- a/drivers/dahdi/xpp/xpp_usb.c
+++ b/drivers/dahdi/xpp/xpp_usb.c
@@ -68,11 +68,6 @@ static DEF_PARM(uint, drop_pcm_after, 6, 0644,
#define XUSB_INFO(xusb, fmt, ...) \
XUSB_PRINTK(INFO, xusb, fmt, ## __VA_ARGS__)
-/* FIXME: A flag that was deprecated at some point, and rather useless */
-/* anyway. Only used in the code or-ed to other flags */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
-#define URB_ASYNC_UNLINK 0
-#endif
/* Get a minor range for your devices from the usb maintainer */
#define USB_SKEL_MINOR_BASE 192
@@ -80,10 +75,6 @@ static DEF_PARM(uint, drop_pcm_after, 6, 0644,
#define PROC_USBXPP_SUMMARY "xpp_usb"
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
-#warning "This module is tested only with 2.6 kernels"
-#endif
-
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
#define usb_alloc_coherent(dev, size, mem_flags, dma) \
usb_buffer_alloc(dev, size, mem_flags, dma)
@@ -91,32 +82,6 @@ static DEF_PARM(uint, drop_pcm_after, 6, 0644,
usb_buffer_free(dev, size, addr, dma)
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12)
-#undef USB_FIELDS_MISSING
-#else
-#define USB_FIELDS_MISSING
-
-#define USB_MAX_STRING 128
-#define USB_GET_STRING(udev, field, buf) \
- do { \
- if ((udev)->descriptor.field) { \
- char tmp[USB_MAX_STRING]; \
- if (usb_string((udev), (udev)->descriptor.field, \
- tmp, sizeof(tmp)) > 0) \
- snprintf((buf), USB_MAX_STRING, "%s", tmp); \
- } \
- } while (0);
-#define USB_GET_IFACE_NAME(udev, iface, buf) \
- do { \
- if ((iface)->desc.iInterface) { \
- char tmp[USB_MAX_STRING]; \
- if (usb_string((udev), (iface)->desc.iInterface, \
- tmp, sizeof(tmp)) > 0) \
- snprintf((buf), USB_MAX_STRING, "%s", tmp); \
- } \
- } while (0);
-#endif
-
#ifdef DEBUG_PCM_TIMING
static cycles_t stamp_last_pcm_read;
static cycles_t accumulate_diff;
@@ -233,18 +198,10 @@ struct xusb {
atomic_t pcm_tx_drops;
atomic_t usb_sluggish_count;
-#ifdef USB_FIELDS_MISSING
- /* storage for missing strings in old kernels */
- char manufacturer[USB_MAX_STRING];
- char product[USB_MAX_STRING];
- char serial[USB_MAX_STRING];
- char interface_name[USB_MAX_STRING];
-#else
const char *manufacturer;
const char *product;
const char *serial;
const char *interface_name;
-#endif
};
@@ -299,7 +256,7 @@ static void uframe_recompute(struct uframe *uframe, enum xusb_dir dir)
BUG_ON(uframe->uframe_magic != UFRAME_MAGIC);
usb_fill_bulk_urb(urb, udev, pipe, uframe->transfer_buffer,
uframe->transfer_buffer_length, urb_cb, uframe);
- urb->transfer_flags = (URB_NO_TRANSFER_DMA_MAP | URB_ASYNC_UNLINK);
+ urb->transfer_flags = (URB_NO_TRANSFER_DMA_MAP);
}
static xframe_t *alloc_xframe(xbus_t *xbus, gfp_t gfp_flags)
@@ -537,9 +494,6 @@ MODULE_DEVICE_TABLE(usb, xusb_table);
* with the usb subsystem
*/
static struct usb_driver xusb_driver = {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
- .owner = THIS_MODULE,
-#endif
.name = "xpp_usb",
.probe = xusb_probe,
.disconnect = xusb_disconnect,
@@ -575,10 +529,6 @@ static const struct file_operations xusb_fops = {
static struct usb_class_driver xusb_class = {
.name = "usb/xpp_usb%d",
.fops = &xusb_fops,
-/* FIXME: The sysfs class interfase seems to have chaged around here */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 15)
- .mode = S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH,
-#endif
.minor_base = USB_SKEL_MINOR_BASE,
};
@@ -674,18 +624,6 @@ static int set_endpoints(xusb_t *xusb, struct usb_host_interface *iface_desc,
return 1;
}
-/*
- * The USB stack before 2.6.10 seems to be a bit shoddy. It seems that when
- * being called from the probe we may already have the lock to
- * udev (the Usb DEVice).
- * Thus we call the internal __usb_reset_device instead.
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 10)
-#define DO_USB_RESET_DEVICE(dev) __usb_reset_device(dev)
-#else
-#define DO_USB_RESET_DEVICE(dev) usb_reset_device(dev)
-#endif
-
/**
* xusb_probe
*
@@ -715,7 +653,7 @@ static int xusb_probe(struct usb_interface *interface,
iface_desc->desc.bInterfaceNumber, model_info->iface_num);
return -ENODEV;
}
- if ((retval = DO_USB_RESET_DEVICE(udev)) < 0) {
+ if ((retval = usb_reset_device(udev)) < 0) {
ERR("usb_reset_device failed: %d\n", retval);
goto probe_failed;
}
@@ -746,17 +684,10 @@ static int xusb_probe(struct usb_interface *interface,
retval = -ENODEV;
goto probe_failed;
}
-#ifndef USB_FIELDS_MISSING
xusb->serial = udev->serial;
xusb->manufacturer = udev->manufacturer;
xusb->product = udev->product;
xusb->interface_name = iface_desc->string;
-#else
- USB_GET_STRING(udev, iSerialNumber, xusb->serial);
- USB_GET_STRING(udev, iManufacturer, xusb->manufacturer);
- USB_GET_STRING(udev, iProduct, xusb->product);
- USB_GET_IFACE_NAME(udev, iface_desc, xusb->interface_name);
-#endif
INFO("XUSB: %s -- %s -- %s\n", xusb->manufacturer, xusb->product,
xusb->interface_name);