xpp: style - add space after comma
* Applied via: sed -i -e '/"/!s/,\([^ \t]\)/, \1/g' "$@" Signed-off-by: Oron Peled <oron.peled@xorcom.com> Acked-By: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10426 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
committed by
Tzafrir Cohen
parent
6caa62da4a
commit
f84d579847
@@ -78,7 +78,7 @@ enum fxo_leds {
|
||||
/* Shortcuts */
|
||||
#define DAA_WRITE 1
|
||||
#define DAA_READ 0
|
||||
#define DAA_DIRECT_REQUEST(xbus,xpd,port,writing,reg,dL) \
|
||||
#define DAA_DIRECT_REQUEST(xbus, xpd, port, writing, reg, dL) \
|
||||
xpp_register_request((xbus), (xpd), (port), (writing), (reg), 0, 0, (dL), 0, 0, 0)
|
||||
|
||||
/*---------------- FXO Protocol Commands ----------------------------------*/
|
||||
@@ -157,11 +157,11 @@ struct FXO_priv_data {
|
||||
* LED counter values:
|
||||
* n>1 : BLINK every n'th tick
|
||||
*/
|
||||
#define LED_COUNTER(priv,pos,color) ((priv)->led_counter[color][pos])
|
||||
#define IS_BLINKING(priv,pos,color) (LED_COUNTER(priv,pos,color) > 0)
|
||||
#define MARK_BLINK(priv,pos,color,t) ((priv)->led_counter[color][pos] = (t))
|
||||
#define MARK_OFF(priv,pos,color) do { BIT_CLR((priv)->ledcontrol[color],(pos)); MARK_BLINK((priv),(pos),(color),0); } while (0)
|
||||
#define MARK_ON(priv,pos,color) do { BIT_SET((priv)->ledcontrol[color],(pos)); MARK_BLINK((priv),(pos),(color),0); } while (0)
|
||||
#define LED_COUNTER(priv, pos, color) ((priv)->led_counter[color][pos])
|
||||
#define IS_BLINKING(priv, pos, color) (LED_COUNTER(priv, pos, color) > 0)
|
||||
#define MARK_BLINK(priv, pos, color, t) ((priv)->led_counter[color][pos] = (t))
|
||||
#define MARK_OFF(priv, pos, color) do { BIT_CLR((priv)->ledcontrol[color], (pos)); MARK_BLINK((priv), (pos), (color), 0); } while (0)
|
||||
#define MARK_ON(priv, pos, color) do { BIT_SET((priv)->ledcontrol[color], (pos)); MARK_BLINK((priv), (pos), (color), 0); } while (0)
|
||||
|
||||
#define LED_BLINK_RING (1000/8) /* in ticks */
|
||||
|
||||
@@ -781,7 +781,7 @@ static const char echotune_regs[sizeof(struct wctdm_echo_coefs)] = {30, 45, 46,
|
||||
|
||||
static int FXO_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
int i,ret;
|
||||
int i, ret;
|
||||
unsigned char echotune_data[ARRAY_SIZE(echotune_regs)];
|
||||
|
||||
BUG_ON(!xpd);
|
||||
@@ -1187,8 +1187,8 @@ static int proc_fxo_info_read(char *page, char **start, off_t off, int count, in
|
||||
for_each_line(xpd, i) {
|
||||
if (!IS_SET(PHONEDEV(xpd).digital_outputs, i) && !IS_SET(PHONEDEV(xpd).digital_inputs, i))
|
||||
len += sprintf(page + len, " %d%d ",
|
||||
IS_BLINKING(priv,i,LED_GREEN),
|
||||
IS_BLINKING(priv,i,LED_RED));
|
||||
IS_BLINKING(priv, i, LED_GREEN),
|
||||
IS_BLINKING(priv, i, LED_RED));
|
||||
}
|
||||
len += sprintf(page + len, "\nBattery-Data:");
|
||||
len += sprintf(page + len, "\n\t%-17s: ", "voltage");
|
||||
|
||||
@@ -68,9 +68,9 @@ enum fxs_leds {
|
||||
/* Shortcuts */
|
||||
#define SLIC_WRITE 1
|
||||
#define SLIC_READ 0
|
||||
#define SLIC_DIRECT_REQUEST(xbus,xpd,port,writing,reg,dL) \
|
||||
#define SLIC_DIRECT_REQUEST(xbus, xpd, port, writing, reg, dL) \
|
||||
xpp_register_request((xbus), (xpd), (port), (writing), (reg), 0, 0, (dL), 0, 0, 0)
|
||||
#define SLIC_INDIRECT_REQUEST(xbus,xpd,port,writing,reg,dL,dH) \
|
||||
#define SLIC_INDIRECT_REQUEST(xbus, xpd, port, writing, reg, dL, dH) \
|
||||
xpp_register_request((xbus), (xpd), (port), (writing), 0x1E, 1, (reg), (dL), 1, (dH), 0)
|
||||
|
||||
#define VALID_PORT(port) (((port) >= 0 && (port) <= 7) || (port) == PORT_BROADCAST)
|
||||
@@ -148,11 +148,11 @@ struct FXS_priv_data {
|
||||
* LED counter values:
|
||||
* n>1 : BLINK every n'th tick
|
||||
*/
|
||||
#define LED_COUNTER(priv,pos,color) ((priv)->led_counter[color][pos])
|
||||
#define IS_BLINKING(priv,pos,color) (LED_COUNTER(priv,pos,color) > 0)
|
||||
#define MARK_BLINK(priv,pos,color,t) ((priv)->led_counter[color][pos] = (t))
|
||||
#define MARK_OFF(priv,pos,color) do { BIT_CLR((priv)->ledcontrol[color],(pos)); MARK_BLINK((priv),(pos),(color),0); } while (0)
|
||||
#define MARK_ON(priv,pos,color) do { BIT_SET((priv)->ledcontrol[color],(pos)); MARK_BLINK((priv),(pos),(color),0); } while (0)
|
||||
#define LED_COUNTER(priv, pos, color) ((priv)->led_counter[color][pos])
|
||||
#define IS_BLINKING(priv, pos, color) (LED_COUNTER(priv, pos, color) > 0)
|
||||
#define MARK_BLINK(priv, pos, color, t) ((priv)->led_counter[color][pos] = (t))
|
||||
#define MARK_OFF(priv, pos, color) do { BIT_CLR((priv)->ledcontrol[color], (pos)); MARK_BLINK((priv), (pos), (color), 0); } while (0)
|
||||
#define MARK_ON(priv, pos, color) do { BIT_SET((priv)->ledcontrol[color], (pos)); MARK_BLINK((priv), (pos), (color), 0); } while (0)
|
||||
|
||||
#define LED_BLINK_RING (1000/8) /* in ticks */
|
||||
|
||||
|
||||
@@ -331,7 +331,7 @@ struct PRI_priv_data {
|
||||
#define NO_DCHAN (0)
|
||||
#define DCHAN(p) ((p)->chanconfig_dchan)
|
||||
#define VALID_DCHAN(p) (DCHAN(p) != NO_DCHAN)
|
||||
#define SET_DCHAN(p,d) do { DCHAN(p) = (d); } while (0);
|
||||
#define SET_DCHAN(p, d) do { DCHAN(p) = (d); } while (0);
|
||||
|
||||
byte cas_rs_e[NUM_CAS_RS_E];
|
||||
byte cas_ts_e[NUM_CAS_RS_E];
|
||||
@@ -786,7 +786,7 @@ static int set_localloop(xpd_t *xpd, bool localloop)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define VALID_CONFIG(bit,flg,str) [bit] = { .flags = flg, .name = str }
|
||||
#define VALID_CONFIG(bit, flg, str) [bit] = { .flags = flg, .name = str }
|
||||
|
||||
static const struct {
|
||||
const char *name;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include <linux/version.h>
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
|
||||
# warning "This module is tested only with 2.6 kernels"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -516,7 +516,7 @@ static int __init xpp_mmap_init(void)
|
||||
xframe_cache = kmem_cache_create("xframe_cache",
|
||||
sizeof(xframe_t) + XFRAME_DATASIZE,
|
||||
0, 0,
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)
|
||||
NULL,
|
||||
#endif
|
||||
NULL);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include <linux/version.h>
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
|
||||
# warning "This module is tested only with 2.6 kernels"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include <linux/version.h>
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
|
||||
# warning "This module is tested only with 2.6 kernels"
|
||||
#endif
|
||||
|
||||
@@ -314,8 +314,8 @@ void dump_xframe(const char msg[], const xbus_t *xbus, const xframe_t *xframe, i
|
||||
do_print = 0;
|
||||
if (debug == DBG_ANY)
|
||||
do_print = 1;
|
||||
else if (XPACKET_OP(pack) != XPROTO_NAME(GLOBAL,PCM_READ) &&
|
||||
XPACKET_OP(pack) != XPROTO_NAME(GLOBAL,PCM_WRITE))
|
||||
else if (XPACKET_OP(pack) != XPROTO_NAME(GLOBAL, PCM_READ) &&
|
||||
XPACKET_OP(pack) != XPROTO_NAME(GLOBAL, PCM_WRITE))
|
||||
do_print = 1;
|
||||
else if (debug & DBG_PCM) {
|
||||
static int rate_limit;
|
||||
@@ -550,7 +550,7 @@ xpd_t *xpd_byaddr(const xbus_t *xbus, uint unit, uint subunit)
|
||||
{
|
||||
if (unit > MAX_UNIT || subunit > MAX_SUBUNIT)
|
||||
return NULL;
|
||||
return xbus->xpds[XPD_IDX(unit,subunit)];
|
||||
return xbus->xpds[XPD_IDX(unit, subunit)];
|
||||
}
|
||||
|
||||
int xbus_xpd_bind(xbus_t *xbus, xpd_t *xpd, int unit, int subunit)
|
||||
@@ -559,7 +559,7 @@ int xbus_xpd_bind(xbus_t *xbus, xpd_t *xpd, int unit, int subunit)
|
||||
unsigned long flags;
|
||||
|
||||
BUG_ON(!xbus);
|
||||
xpd_num = XPD_IDX(unit,subunit);
|
||||
xpd_num = XPD_IDX(unit, subunit);
|
||||
XBUS_DBG(DEVICES, xbus, "XPD #%d\n", xpd_num);
|
||||
spin_lock_irqsave(&xbus->lock, flags);
|
||||
if (!VALID_XPD_NUM(xpd_num)) {
|
||||
@@ -1014,7 +1014,7 @@ void xbus_unregister_dahdi_device(xbus_t *xbus)
|
||||
* it returns only when all XPD's on the bus are detected and
|
||||
* initialized.
|
||||
*/
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
|
||||
static void xbus_populate(struct work_struct *work)
|
||||
{
|
||||
struct xbus_workqueue *worker = container_of(work, struct xbus_workqueue, xpds_init_work);
|
||||
@@ -1101,7 +1101,7 @@ int xbus_process_worker(xbus_t *xbus)
|
||||
}
|
||||
XBUS_DBG(DEVICES, xbus, "\n");
|
||||
/* Initialize the work. (adapt to kernel API changes). */
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
|
||||
INIT_WORK(&worker->xpds_init_work, xbus_populate);
|
||||
#else
|
||||
INIT_WORK(&worker->xpds_init_work, xbus_populate, worker);
|
||||
|
||||
@@ -140,7 +140,7 @@ struct xbus_workqueue {
|
||||
|
||||
/*
|
||||
* Allocate/Free an xframe from pools of empty xframes.
|
||||
* Calls to {get,put}_xframe are wrapped in
|
||||
* Calls to {get, put}_xframe are wrapped in
|
||||
* the macros bellow, so we take/return it
|
||||
* to the correct pool.
|
||||
*/
|
||||
@@ -316,7 +316,7 @@ xpacket_t *xframe_next_packet(xframe_t *xframe, int len);
|
||||
/*
|
||||
* Map: unit+subunit <--> index in xbus->xpds[]
|
||||
*/
|
||||
#define XPD_IDX(unit,subunit) ((unit) * MAX_SUBUNIT + (subunit))
|
||||
#define XPD_IDX(unit, subunit) ((unit) * MAX_SUBUNIT + (subunit))
|
||||
#define XBUS_UNIT(idx) ((idx) / MAX_SUBUNIT)
|
||||
#define XBUS_SUBUNIT(idx) ((idx) % MAX_SUBUNIT)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include <linux/version.h>
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
|
||||
# warning "This module is tested only with 2.6 kernels"
|
||||
#endif
|
||||
|
||||
@@ -166,7 +166,7 @@ static void sample_tick(xbus_t *xbus, int sample)
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define sample_tick(x,y)
|
||||
#define sample_tick(x, y)
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -981,7 +981,7 @@ static int copy_pcm_tospan(xbus_t *xbus, xframe_t *xframe)
|
||||
pack = (xpacket_t *)p;
|
||||
len = XPACKET_LEN(pack);
|
||||
/* Sanity checks */
|
||||
if (unlikely(XPACKET_OP(pack) != XPROTO_NAME(GLOBAL,PCM_READ))) {
|
||||
if (unlikely(XPACKET_OP(pack) != XPROTO_NAME(GLOBAL, PCM_READ))) {
|
||||
static int rate_limit;
|
||||
|
||||
if ((rate_limit++ % 1003) == 0) {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include <linux/version.h>
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
|
||||
# warning "This module is tested only with 2.6 kernels"
|
||||
#endif
|
||||
|
||||
@@ -267,7 +267,7 @@ static DEVICE_ATTR_READER(driftinfo_show, dev, buf)
|
||||
return len;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
|
||||
#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) \
|
||||
@@ -339,7 +339,7 @@ static int astribank_hotplug(struct device *dev, char **envp, int envnum, char *
|
||||
XBUS_ADD_UEVENT_VAR("XBUS_NAME=%s", xbus->busname); \
|
||||
} while (0)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
|
||||
#define XBUS_ADD_UEVENT_VAR(fmt, val...) \
|
||||
do { \
|
||||
int err = add_uevent_var(envp, num_envp, &i, \
|
||||
|
||||
@@ -56,9 +56,9 @@ struct list_head { struct list_head *next; struct list_head *prev; };
|
||||
#ifndef BIT /* added in 2.6.24 */
|
||||
#define BIT(i) (1UL << (i))
|
||||
#endif
|
||||
#define BIT_SET(x,i) ((x) |= BIT(i))
|
||||
#define BIT_CLR(x,i) ((x) &= ~BIT(i))
|
||||
#define IS_SET(x,i) (((x) & BIT(i)) != 0)
|
||||
#define BIT_SET(x, i) ((x) |= BIT(i))
|
||||
#define BIT_CLR(x, i) ((x) &= ~BIT(i))
|
||||
#define IS_SET(x, i) (((x) & BIT(i)) != 0)
|
||||
#define BITMASK(i) (((u64)1 << (i)) - 1)
|
||||
|
||||
#define MAX_PROC_WRITE 100 /* Largest buffer we allow writing our /proc files */
|
||||
@@ -102,7 +102,7 @@ typedef unsigned char byte;
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/* Kernel versions... */
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
|
||||
#define KMEM_CACHE_T kmem_cache_t
|
||||
#else
|
||||
#define KMEM_CACHE_T struct kmem_cache
|
||||
@@ -117,38 +117,38 @@ typedef unsigned char byte;
|
||||
/*
|
||||
* Hotplug replaced with uevent in 2.6.16
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(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)
|
||||
#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) \
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
|
||||
#define DEVICE_ATTR_READER(name, dev, buf) \
|
||||
ssize_t name(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
#define DEVICE_ATTR_WRITER(name,dev,buf, count) \
|
||||
#define DEVICE_ATTR_WRITER(name, dev, buf, count) \
|
||||
ssize_t name(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
|
||||
#else
|
||||
#define DEVICE_ATTR_READER(name,dev,buf) \
|
||||
#define DEVICE_ATTR_READER(name, dev, buf) \
|
||||
ssize_t name(struct device *dev, char *buf)
|
||||
#define DEVICE_ATTR_WRITER(name,dev,buf, count) \
|
||||
#define DEVICE_ATTR_WRITER(name, dev, buf, count) \
|
||||
ssize_t name(struct device *dev, const char *buf, size_t count)
|
||||
#endif
|
||||
#define DRIVER_ATTR_READER(name,drv,buf) \
|
||||
#define DRIVER_ATTR_READER(name, drv, buf) \
|
||||
ssize_t name(struct device_driver *drv, char * buf)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
|
||||
#define SET_PROC_DIRENTRY_OWNER(p) do { (p)->owner = THIS_MODULE; } while (0);
|
||||
#else
|
||||
#define SET_PROC_DIRENTRY_OWNER(p) do { } while (0);
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
|
||||
/* Also don't define this for later RHEL >= 5.2 . hex_asc is from the
|
||||
* same linux-2.6-net-infrastructure-updates-to-mac80211-iwl4965.patch
|
||||
* as is the bool typedef. */
|
||||
#if LINUX_VERSION_CODE != KERNEL_VERSION(2,6,18) || ! defined(hex_asc)
|
||||
#if LINUX_VERSION_CODE != KERNEL_VERSION(2, 6, 18) || ! defined(hex_asc)
|
||||
typedef int bool;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <linux/device.h>
|
||||
#include <linux/version.h>
|
||||
#include <asm/atomic.h>
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
|
||||
#include <linux/semaphore.h>
|
||||
#else
|
||||
#include <asm/semaphore.h>
|
||||
@@ -42,9 +42,9 @@
|
||||
#include <dahdi/kernel.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
|
||||
#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)
|
||||
#if LINUX_VERSION_CODE != KERNEL_VERSION(2, 6, 9) || !defined(DEFINE_SPINLOCK)
|
||||
typedef unsigned gfp_t; /* Added in 2.6.14 */
|
||||
#endif
|
||||
#endif
|
||||
@@ -54,28 +54,28 @@ typedef unsigned gfp_t; /* Added in 2.6.14 */
|
||||
* bool is now defined as a proper boolean type (gcc _Bool)
|
||||
* but the command line parsing framework handles it as int.
|
||||
*/
|
||||
#define DEF_PARM_BOOL(name,init,perm,desc) \
|
||||
#define DEF_PARM_BOOL(name, init, perm, desc) \
|
||||
int name = init; \
|
||||
module_param(name, bool, perm); \
|
||||
MODULE_PARM_DESC(name, desc " [default " #init "]")
|
||||
|
||||
#define DEF_PARM(type,name,init,perm,desc) \
|
||||
#define DEF_PARM(type, name, init, perm, desc) \
|
||||
type name = init; \
|
||||
module_param(name, type, perm); \
|
||||
MODULE_PARM_DESC(name, desc " [default " #init "]")
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
|
||||
#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) \
|
||||
#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) \
|
||||
#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); \
|
||||
@@ -148,7 +148,7 @@ struct phonedev {
|
||||
const struct phoneops *phoneops; /* Card level operations */
|
||||
struct dahdi_span span;
|
||||
struct dahdi_chan *chans[32];
|
||||
#define XPD_CHAN(xpd,chan) (PHONEDEV(xpd).chans[(chan)])
|
||||
#define XPD_CHAN(xpd, chan) (PHONEDEV(xpd).chans[(chan)])
|
||||
struct dahdi_echocan_state *ec[32];
|
||||
|
||||
int channels;
|
||||
@@ -228,7 +228,7 @@ struct xpd {
|
||||
unsigned int timer_count;
|
||||
};
|
||||
|
||||
#define for_each_line(xpd,i) for ((i) = 0; (i) < PHONEDEV(xpd).channels; (i)++)
|
||||
#define for_each_line(xpd, i) for ((i) = 0; (i) < PHONEDEV(xpd).channels; (i)++)
|
||||
#define IS_BRI(xpd) ((xpd)->type == XPD_TYPE_BRI)
|
||||
#define TICK_TOLERANCE 500 /* usec */
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
#include <linux/version.h>
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
|
||||
# warning "This module is tested only with 2.6 kernels"
|
||||
#endif
|
||||
|
||||
@@ -76,7 +76,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)
|
||||
#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);
|
||||
@@ -1095,7 +1095,7 @@ void xpd_dahdi_preunregister(xpd_t *xpd)
|
||||
dahdi_alarm_notify(&PHONEDEV(xpd).span);
|
||||
XPD_DBG(DEVICES, xpd, "Queuing DAHDI_EVENT_REMOVED on all channels to ask user to release them\n");
|
||||
for (j=0; j<PHONEDEV(xpd).span.channels; j++) {
|
||||
dahdi_qevent_lock(XPD_CHAN(xpd, j),DAHDI_EVENT_REMOVED);
|
||||
dahdi_qevent_lock(XPD_CHAN(xpd, j), DAHDI_EVENT_REMOVED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ void report_bad_ioctl(const char *msg, xpd_t *xpd, int pos, unsigned int cmd);
|
||||
int total_registered_spans(void);
|
||||
void oht_pcm(xpd_t *xpd, int pos, bool pass);
|
||||
void mark_offhook(xpd_t *xpd, int pos, bool to_offhook);
|
||||
#define IS_OFFHOOK(xpd,pos) IS_SET((xpd)->phonedev.offhook_state, (pos))
|
||||
#define IS_OFFHOOK(xpd, pos) IS_SET((xpd)->phonedev.offhook_state, (pos))
|
||||
void notify_rxsig(xpd_t *xpd, int pos, enum dahdi_rxsig rxsig);
|
||||
|
||||
#ifdef CONFIG_PROC_FS
|
||||
|
||||
@@ -64,7 +64,7 @@ static DEF_PARM(uint, drop_pcm_after, 6, 0644, "Number of consecutive tx_sluggis
|
||||
|
||||
/* 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)
|
||||
#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 */
|
||||
@@ -74,7 +74,7 @@ static DEF_PARM(uint, drop_pcm_after, 6, 0644, "Number of consecutive tx_sluggis
|
||||
#define PROC_USBXPP_SUMMARY "xpp_usb"
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
|
||||
# warning "This module is tested only with 2.6 kernels"
|
||||
#endif
|
||||
|
||||
@@ -85,13 +85,13 @@ static DEF_PARM(uint, drop_pcm_after, 6, 0644, "Number of consecutive tx_sluggis
|
||||
usb_buffer_free(dev, size, addr, dma)
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
|
||||
#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) \
|
||||
# define USB_GET_STRING(udev, field, buf) \
|
||||
do { \
|
||||
if ((udev)->descriptor.field) { \
|
||||
char tmp[USB_MAX_STRING]; \
|
||||
@@ -99,7 +99,7 @@ static DEF_PARM(uint, drop_pcm_after, 6, 0644, "Number of consecutive tx_sluggis
|
||||
snprintf((buf), USB_MAX_STRING, "%s", tmp); \
|
||||
} \
|
||||
} while (0);
|
||||
# define USB_GET_IFACE_NAME(udev,iface,buf) \
|
||||
# define USB_GET_IFACE_NAME(udev, iface, buf) \
|
||||
do { \
|
||||
if ((iface)->desc.iInterface) { \
|
||||
char tmp[USB_MAX_STRING]; \
|
||||
@@ -255,7 +255,7 @@ static DEFINE_SEMAPHORE(disconnect_sem);
|
||||
* Debian-Etch and Centos5 are using 2.6.18 for now (lucky for us).
|
||||
* Fedora6 jumped from 2.6.18 to 2.6.20. So far luck is on our side ;-)
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
|
||||
#define USB_PASS_CB(u) struct urb *u, struct pt_regs *regs
|
||||
#else
|
||||
#define USB_PASS_CB(u) struct urb *u
|
||||
@@ -511,7 +511,7 @@ MODULE_DEVICE_TABLE (usb, xusb_table);
|
||||
|
||||
/* usb specific object needed to register this driver with the usb subsystem */
|
||||
static struct usb_driver xusb_driver = {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
|
||||
.owner = THIS_MODULE,
|
||||
#endif
|
||||
.name = "xpp_usb",
|
||||
@@ -550,7 +550,7 @@ 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)
|
||||
#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,
|
||||
@@ -639,7 +639,7 @@ static int set_endpoints(xusb_t *xusb, struct usb_host_interface *iface_desc, st
|
||||
* 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)
|
||||
#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)
|
||||
@@ -677,7 +677,7 @@ static int xusb_probe(struct usb_interface *interface, const struct usb_device_i
|
||||
}
|
||||
if (!model_info) {
|
||||
ERR("Missing endpoint setup for this device %d:%d\n",
|
||||
udev->descriptor.idVendor,udev->descriptor.idProduct);
|
||||
udev->descriptor.idVendor, udev->descriptor.idProduct);
|
||||
retval = -ENODEV;
|
||||
goto probe_failed;
|
||||
}
|
||||
@@ -990,12 +990,12 @@ static int __init xpp_usb_init(void)
|
||||
INFO("revision %s\n", XPP_VERSION);
|
||||
xusb_cache = kmem_cache_create("xusb_cache",
|
||||
sizeof(xframe_t) + XFRAME_DATASIZE,
|
||||
#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,22)) && defined(CONFIG_SLUB)
|
||||
#if (LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 22)) && defined(CONFIG_SLUB)
|
||||
0, SLAB_STORE_USER,
|
||||
#else
|
||||
0, 0,
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)
|
||||
NULL,
|
||||
#endif
|
||||
NULL);
|
||||
|
||||
@@ -219,7 +219,7 @@ static int xframe_receive_cmd(xbus_t *xbus, xframe_t *xframe)
|
||||
pack = (xpacket_t *)p;
|
||||
len = XPACKET_LEN(pack);
|
||||
/* Sanity checks */
|
||||
if (unlikely(XPACKET_OP(pack) == XPROTO_NAME(GLOBAL,PCM_READ))) {
|
||||
if (unlikely(XPACKET_OP(pack) == XPROTO_NAME(GLOBAL, PCM_READ))) {
|
||||
static int rate_limit;
|
||||
|
||||
if ((rate_limit++ % 1003) == 0) {
|
||||
|
||||
@@ -92,49 +92,49 @@ typedef byte xpd_type_t;
|
||||
|
||||
bool valid_xpd_addr(const struct xpd_addr *addr);
|
||||
|
||||
#define XPROTO_NAME(card,op) card ## _ ## op
|
||||
#define XPROTO_HANDLER(card,op) XPROTO_NAME(card,op ## _handler)
|
||||
#define XPROTO_CALLER(card,op) XPROTO_NAME(card,op ## _send)
|
||||
#define XPROTO_NAME(card, op) card ## _ ## op
|
||||
#define XPROTO_HANDLER(card, op) XPROTO_NAME(card, op ## _handler)
|
||||
#define XPROTO_CALLER(card, op) XPROTO_NAME(card, op ## _send)
|
||||
|
||||
#define HANDLER_DEF(card,op) \
|
||||
static int XPROTO_HANDLER(card,op) ( \
|
||||
#define HANDLER_DEF(card, op) \
|
||||
static int XPROTO_HANDLER(card, op) ( \
|
||||
xbus_t *xbus, \
|
||||
xpd_t *xpd, \
|
||||
const xproto_entry_t *cmd, \
|
||||
xpacket_t *pack)
|
||||
|
||||
#define CALL_PROTO(card,op, ...) XPROTO_CALLER(card,op)( __VA_ARGS__ )
|
||||
#define CALL_PROTO(card, op, ...) XPROTO_CALLER(card, op)( __VA_ARGS__ )
|
||||
|
||||
#define DECLARE_CMD(card,op, ...) \
|
||||
#define DECLARE_CMD(card, op, ...) \
|
||||
int CALL_PROTO(card, op, xbus_t *xbus, xpd_t *xpd, ## __VA_ARGS__ )
|
||||
|
||||
#define HOSTCMD(card, op, ...) \
|
||||
DECLARE_CMD(card, op, ## __VA_ARGS__ )
|
||||
|
||||
#define RPACKET_NAME(card,op) XPROTO_NAME(RPACKET_ ## card, op)
|
||||
#define RPACKET_TYPE(card,op) struct RPACKET_NAME(card, op)
|
||||
#define RPACKET_NAME(card, op) XPROTO_NAME(RPACKET_ ## card, op)
|
||||
#define RPACKET_TYPE(card, op) struct RPACKET_NAME(card, op)
|
||||
|
||||
#define DEF_RPACKET_DATA(card,op, ...) \
|
||||
RPACKET_TYPE(card,op) { \
|
||||
#define DEF_RPACKET_DATA(card, op, ...) \
|
||||
RPACKET_TYPE(card, op) { \
|
||||
struct xpacket_header head; \
|
||||
__VA_ARGS__ \
|
||||
} PACKED
|
||||
#define RPACKET_HEADERSIZE sizeof(struct xpacket_header)
|
||||
#define RPACKET_FIELD(p,card,op,field) (((RPACKET_TYPE(card,op) *)(p))->field)
|
||||
#define RPACKET_SIZE(card,op) sizeof(RPACKET_TYPE(card,op))
|
||||
#define RPACKET_FIELD(p, card, op, field) (((RPACKET_TYPE(card, op) *)(p))->field)
|
||||
#define RPACKET_SIZE(card, op) sizeof(RPACKET_TYPE(card, op))
|
||||
|
||||
#define XENTRY(prototab,module,op) \
|
||||
[ XPROTO_NAME(module,op) ] = { \
|
||||
.handler = XPROTO_HANDLER(module,op), \
|
||||
.datalen = RPACKET_SIZE(module,op), \
|
||||
#define XENTRY(prototab, module, op) \
|
||||
[ XPROTO_NAME(module, op) ] = { \
|
||||
.handler = XPROTO_HANDLER(module, op), \
|
||||
.datalen = RPACKET_SIZE(module, op), \
|
||||
.name = #op, \
|
||||
.table = &PROTO_TABLE(prototab) \
|
||||
}
|
||||
|
||||
#define XPACKET_INIT(p, card, op, to, pcm, pcmslot) \
|
||||
do { \
|
||||
XPACKET_OP(p) = XPROTO_NAME(card,op); \
|
||||
XPACKET_LEN(p) = RPACKET_SIZE(card,op); \
|
||||
XPACKET_OP(p) = XPROTO_NAME(card, op); \
|
||||
XPACKET_LEN(p) = RPACKET_SIZE(card, op); \
|
||||
XPACKET_IS_PCM(p) = (pcm); \
|
||||
XPACKET_PCMSLOT(p) = (pcmslot); \
|
||||
XPACKET_RESERVED(p) = 0; \
|
||||
@@ -146,7 +146,7 @@ bool valid_xpd_addr(const struct xpd_addr *addr);
|
||||
|
||||
#define XFRAME_NEW_CMD(frm, p, xbus, card, op, to) \
|
||||
do { \
|
||||
int pack_len = RPACKET_SIZE(card,op); \
|
||||
int pack_len = RPACKET_SIZE(card, op); \
|
||||
\
|
||||
if (!XBUS_FLAGS(xbus, CONNECTED)) \
|
||||
return -ENODEV; \
|
||||
@@ -191,7 +191,7 @@ typedef struct reg_cmd {
|
||||
} PACKED reg_cmd_t;
|
||||
|
||||
/* Shortcut access macros */
|
||||
#define REG_FIELD(regptr,member) ((regptr)->alt.r.member)
|
||||
#define REG_FIELD(regptr, member) ((regptr)->alt.r.member)
|
||||
#define REG_XDATA(regptr) ((regptr)->alt.d.xdata)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
@@ -283,7 +283,7 @@ struct xproto_table {
|
||||
#include "card_pri.h"
|
||||
|
||||
|
||||
#define MEMBER(card,op) RPACKET_TYPE(card,op) RPACKET_NAME(card,op)
|
||||
#define MEMBER(card, op) RPACKET_TYPE(card, op) RPACKET_NAME(card, op)
|
||||
|
||||
struct xpacket {
|
||||
struct xpacket_header head;
|
||||
|
||||
Reference in New Issue
Block a user