summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/mISDN
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-02-19 19:52:38 -0800
committerJoe Perches <joe@perches.com>2012-02-21 09:04:01 -0800
commit475be4d85a274d0961593db41cf85689db1d583c (patch)
treeb2b8931eb747794730522c3cf1898e46948527b9 /drivers/isdn/mISDN
parent0b0a635f79f91f3755b6518627ea06dd0dbfd523 (diff)
isdn: whitespace coding style cleanup
isdn source code uses a not-current coding style. Update the coding style used on a per-line basis so that git diff -w shows only elided blank lines at EOF. Done with emacs and some scripts and some typing. Built x86 allyesconfig. No detected change in objdump -d or size. Signed-off-by: Joe Perches <joe@perches.com>
Diffstat (limited to 'drivers/isdn/mISDN')
-rw-r--r--drivers/isdn/mISDN/clock.c25
-rw-r--r--drivers/isdn/mISDN/core.c37
-rw-r--r--drivers/isdn/mISDN/core.h8
-rw-r--r--drivers/isdn/mISDN/dsp.h25
-rw-r--r--drivers/isdn/mISDN/dsp_audio.c5
-rw-r--r--drivers/isdn/mISDN/dsp_biquad.h6
-rw-r--r--drivers/isdn/mISDN/dsp_blowfish.c112
-rw-r--r--drivers/isdn/mISDN/dsp_cmx.c1040
-rw-r--r--drivers/isdn/mISDN/dsp_core.c181
-rw-r--r--drivers/isdn/mISDN/dsp_dtmf.c66
-rw-r--r--drivers/isdn/mISDN/dsp_ecdis.h26
-rw-r--r--drivers/isdn/mISDN/dsp_hwec.c11
-rw-r--r--drivers/isdn/mISDN/dsp_hwec.h1
-rw-r--r--drivers/isdn/mISDN/dsp_pipeline.c56
-rw-r--r--drivers/isdn/mISDN/dsp_tones.c165
-rw-r--r--drivers/isdn/mISDN/fsm.c42
-rw-r--r--drivers/isdn/mISDN/hwchannel.c22
-rw-r--r--drivers/isdn/mISDN/l1oip.h21
-rw-r--r--drivers/isdn/mISDN/l1oip_codec.c36
-rw-r--r--drivers/isdn/mISDN/l1oip_core.c581
-rw-r--r--drivers/isdn/mISDN/layer1.c16
-rw-r--r--drivers/isdn/mISDN/layer1.h1
-rw-r--r--drivers/isdn/mISDN/layer2.c97
-rw-r--r--drivers/isdn/mISDN/layer2.h12
-rw-r--r--drivers/isdn/mISDN/socket.c89
-rw-r--r--drivers/isdn/mISDN/stack.c124
-rw-r--r--drivers/isdn/mISDN/tei.c114
-rw-r--r--drivers/isdn/mISDN/timerdev.c12
28 files changed, 1453 insertions, 1478 deletions
diff --git a/drivers/isdn/mISDN/clock.c b/drivers/isdn/mISDN/clock.c
index 7418f2d811d8..693fb7c9b59a 100644
--- a/drivers/isdn/mISDN/clock.c
+++ b/drivers/isdn/mISDN/clock.c
@@ -13,11 +13,11 @@
* Quick API description:
*
* A clock source registers using mISDN_register_clock:
- * name = text string to name clock source
+ * name = text string to name clock source
* priority = value to priorize clock sources (0 = default)
* ctl = callback function to enable/disable clock source
* priv = private pointer of clock source
- * return = pointer to clock source structure;
+ * return = pointer to clock source structure;
*
* Note: Callback 'ctl' can be called before mISDN_register_clock returns!
* Also it can be called during mISDN_unregister_clock.
@@ -74,14 +74,14 @@ select_iclock(void)
/* last used clock source still exists but changes, disable */
if (*debug & DEBUG_CLOCK)
printk(KERN_DEBUG "Old clock source '%s' disable.\n",
- lastclock->name);
+ lastclock->name);
lastclock->ctl(lastclock->priv, 0);
}
if (bestclock && bestclock != iclock_current) {
/* new clock source selected, enable */
if (*debug & DEBUG_CLOCK)
printk(KERN_DEBUG "New clock source '%s' enable.\n",
- bestclock->name);
+ bestclock->name);
bestclock->ctl(bestclock->priv, 1);
}
if (bestclock != iclock_current) {
@@ -104,7 +104,7 @@ struct mISDNclock
printk(KERN_ERR "%s: No memory for clock entry.\n", __func__);
return NULL;
}
- strncpy(iclock->name, name, sizeof(iclock->name)-1);
+ strncpy(iclock->name, name, sizeof(iclock->name) - 1);
iclock->pri = pri;
iclock->priv = priv;
iclock->ctl = ctl;
@@ -123,13 +123,13 @@ mISDN_unregister_clock(struct mISDNclock *iclock)
if (*debug & (DEBUG_CORE | DEBUG_CLOCK))
printk(KERN_DEBUG "%s: %s %d\n", __func__, iclock->name,
- iclock->pri);
+ iclock->pri);
write_lock_irqsave(&iclock_lock, flags);
if (iclock_current == iclock) {
if (*debug & DEBUG_CLOCK)
printk(KERN_DEBUG
- "Current clock source '%s' unregisters.\n",
- iclock->name);
+ "Current clock source '%s' unregisters.\n",
+ iclock->name);
iclock->ctl(iclock->priv, 0);
}
list_del(&iclock->list);
@@ -149,9 +149,9 @@ mISDN_clock_update(struct mISDNclock *iclock, int samples, struct timeval *tv)
write_lock_irqsave(&iclock_lock, flags);
if (iclock_current != iclock) {
printk(KERN_ERR "%s: '%s' sends us clock updates, but we do "
- "listen to '%s'. This is a bug!\n", __func__,
- iclock->name,
- iclock_current ? iclock_current->name : "nothing");
+ "listen to '%s'. This is a bug!\n", __func__,
+ iclock->name,
+ iclock_current ? iclock_current->name : "nothing");
iclock->ctl(iclock->priv, 0);
write_unlock_irqrestore(&iclock_lock, flags);
return;
@@ -185,7 +185,7 @@ mISDN_clock_update(struct mISDNclock *iclock, int samples, struct timeval *tv)
iclock_tv_valid = 1;
if (*debug & DEBUG_CLOCK)
printk("Received first clock from source '%s'.\n",
- iclock_current ? iclock_current->name : "nothing");
+ iclock_current ? iclock_current->name : "nothing");
}
write_unlock_irqrestore(&iclock_lock, flags);
}
@@ -215,4 +215,3 @@ mISDN_clock_get(void)
return count;
}
EXPORT_SYMBOL(mISDN_clock_get);
-
diff --git a/drivers/isdn/mISDN/core.c b/drivers/isdn/mISDN/core.c
index afeebb00fe0b..a24530f05db0 100644
--- a/drivers/isdn/mISDN/core.c
+++ b/drivers/isdn/mISDN/core.c
@@ -38,7 +38,7 @@ static void mISDN_dev_release(struct device *dev)
}
static ssize_t _show_id(struct device *dev,
- struct device_attribute *attr, char *buf)
+ struct device_attribute *attr, char *buf)
{
struct mISDNdevice *mdev = dev_to_mISDN(dev);
@@ -48,7 +48,7 @@ static ssize_t _show_id(struct device *dev,
}
static ssize_t _show_nrbchan(struct device *dev,
- struct device_attribute *attr, char *buf)
+ struct device_attribute *attr, char *buf)
{
struct mISDNdevice *mdev = dev_to_mISDN(dev);
@@ -58,7 +58,7 @@ static ssize_t _show_nrbchan(struct device *dev,
}
static ssize_t _show_d_protocols(struct device *dev,
- struct device_attribute *attr, char *buf)
+ struct device_attribute *attr, char *buf)
{
struct mISDNdevice *mdev = dev_to_mISDN(dev);
@@ -68,7 +68,7 @@ static ssize_t _show_d_protocols(struct device *dev,
}
static ssize_t _show_b_protocols(struct device *dev,
- struct device_attribute *attr, char *buf)
+ struct device_attribute *attr, char *buf)
{
struct mISDNdevice *mdev = dev_to_mISDN(dev);
@@ -78,7 +78,7 @@ static ssize_t _show_b_protocols(struct device *dev,
}
static ssize_t _show_protocol(struct device *dev,
- struct device_attribute *attr, char *buf)
+ struct device_attribute *attr, char *buf)
{
struct mISDNdevice *mdev = dev_to_mISDN(dev);
@@ -88,7 +88,7 @@ static ssize_t _show_protocol(struct device *dev,
}
static ssize_t _show_name(struct device *dev,
- struct device_attribute *attr, char *buf)
+ struct device_attribute *attr, char *buf)
{
strcpy(buf, dev_name(dev));
return strlen(buf);
@@ -96,7 +96,7 @@ static ssize_t _show_name(struct device *dev,
#if 0 /* hangs */
static ssize_t _set_name(struct device *dev, struct device_attribute *attr,
- const char *buf, size_t count)
+ const char *buf, size_t count)
{
int err = 0;
char *out = kmalloc(count + 1, GFP_KERNEL);
@@ -136,7 +136,7 @@ static struct device_attribute mISDN_dev_attrs[] = {
__ATTR(channelmap, S_IRUGO, _show_channelmap, NULL),
__ATTR(nrbchan, S_IRUGO, _show_nrbchan, NULL),
__ATTR(name, S_IRUGO, _show_name, NULL),
-/* __ATTR(name, S_IRUGO|S_IWUSR, _show_name, _set_name), */
+/* __ATTR(name, S_IRUGO | S_IWUSR, _show_name, _set_name), */
{}
};
@@ -187,7 +187,7 @@ struct mISDNdevice
*get_mdevice(u_int id)
{
return dev_to_mISDN(class_find_device(&mISDN_class, NULL, &id,
- _get_mdevice));
+ _get_mdevice));
}
static int
@@ -221,7 +221,7 @@ get_free_devid(void)
int
mISDN_register_device(struct mISDNdevice *dev,
- struct device *parent, char *name)
+ struct device *parent, char *name)
{
int err;
@@ -237,7 +237,7 @@ mISDN_register_device(struct mISDNdevice *dev,
dev_set_name(&dev->dev, "mISDN%d", dev->id);
if (debug & DEBUG_CORE)
printk(KERN_DEBUG "mISDN_register %s %d\n",
- dev_name(&dev->dev), dev->id);
+ dev_name(&dev->dev), dev->id);
err = create_stack(dev);
if (err)
goto error1;
@@ -265,7 +265,7 @@ void
mISDN_unregister_device(struct mISDNdevice *dev) {
if (debug & DEBUG_CORE)
printk(KERN_DEBUG "mISDN_unregister %s %d\n",
- dev_name(&dev->dev), dev->id);
+ dev_name(&dev->dev), dev->id);
/* sysfs_remove_link(&dev->dev.kobj, "device"); */
device_del(&dev->dev);
dev_set_drvdata(&dev->dev, NULL);
@@ -311,7 +311,7 @@ get_Bprotocol4id(u_int id)
if (id < ISDN_P_B_START || id > 63) {
printk(KERN_WARNING "%s id not in range %d\n",
- __func__, id);
+ __func__, id);
return NULL;
}
m = 1 << (id & ISDN_P_B_MASK);
@@ -326,12 +326,12 @@ mISDN_register_Bprotocol(struct Bprotocol *bp)
if (debug & DEBUG_CORE)
printk(KERN_DEBUG "%s: %s/%x\n", __func__,
- bp->name, bp->Bprotocols);
+ bp->name, bp->Bprotocols);
old = get_Bprotocol4mask(bp->Bprotocols);
if (old) {
printk(KERN_WARNING
- "register duplicate protocol old %s/%x new %s/%x\n",
- old->name, old->Bprotocols, bp->name, bp->Bprotocols);
+ "register duplicate protocol old %s/%x new %s/%x\n",
+ old->name, old->Bprotocols, bp->name, bp->Bprotocols);
return -EBUSY;
}
write_lock_irqsave(&bp_lock, flags);
@@ -348,7 +348,7 @@ mISDN_unregister_Bprotocol(struct Bprotocol *bp)
if (debug & DEBUG_CORE)
printk(KERN_DEBUG "%s: %s/%x\n", __func__, bp->name,
- bp->Bprotocols);
+ bp->Bprotocols);
write_lock_irqsave(&bp_lock, flags);
list_del(&bp->list);
write_unlock_irqrestore(&bp_lock, flags);
@@ -361,7 +361,7 @@ mISDNInit(void)
int err;
printk(KERN_INFO "Modular ISDN core version %d.%d.%d\n",
- MISDN_MAJOR_VERSION, MISDN_MINOR_VERSION, MISDN_RELEASE);
+ MISDN_MAJOR_VERSION, MISDN_MINOR_VERSION, MISDN_RELEASE);
mISDN_init_clock(&debug);
mISDN_initstack(&debug);
err = class_register(&mISDN_class);
@@ -406,4 +406,3 @@ static void mISDN_cleanup(void)
module_init(mISDNInit);
module_exit(mISDN_cleanup);
-
diff --git a/drivers/isdn/mISDN/core.h b/drivers/isdn/mISDN/core.h
index 7ac2f81a812b..52695bb81ee7 100644
--- a/drivers/isdn/mISDN/core.h
+++ b/drivers/isdn/mISDN/core.h
@@ -45,11 +45,11 @@ extern int get_mdevice_count(void);
#define MGR_OPT_NETWORK 25
extern int connect_Bstack(struct mISDNdevice *, struct mISDNchannel *,
- u_int, struct sockaddr_mISDN *);
+ u_int, struct sockaddr_mISDN *);
extern int connect_layer1(struct mISDNdevice *, struct mISDNchannel *,
- u_int, struct sockaddr_mISDN *);
+ u_int, struct sockaddr_mISDN *);
extern int create_l2entity(struct mISDNdevice *, struct mISDNchannel *,
- u_int, struct sockaddr_mISDN *);
+ u_int, struct sockaddr_mISDN *);
extern int create_stack(struct mISDNdevice *);
extern int create_teimanager(struct mISDNdevice *);
@@ -71,7 +71,7 @@ extern void mISDN_timer_cleanup(void);
extern int l1_init(u_int *);
extern void l1_cleanup(void);
-extern int Isdnl2_Init(u_int *);
+extern int Isdnl2_Init(u_int *);
extern void Isdnl2_cleanup(void);
extern void mISDN_init_clock(u_int *);
diff --git a/drivers/isdn/mISDN/dsp.h b/drivers/isdn/mISDN/dsp.h
index 8549431430f0..afe4173ae007 100644
--- a/drivers/isdn/mISDN/dsp.h
+++ b/drivers/isdn/mISDN/dsp.h
@@ -24,8 +24,8 @@
* bit 1 = enable hfc hardware acceleration for all channels
*
*/
-#define DSP_OPT_ULAW (1<<0)
-#define DSP_OPT_NOHARDWARE (1<<1)
+#define DSP_OPT_ULAW (1 << 0)
+#define DSP_OPT_NOHARDWARE (1 << 1)
#include <linux/timer.h>
#include <linux/workqueue.h>
@@ -97,12 +97,12 @@ struct dsp_conf_member {
struct dsp_conf {
struct list_head list;
u32 id;
- /* all cmx stacks with the same ID are
- connected */
+ /* all cmx stacks with the same ID are
+ connected */
struct list_head mlist;
int software; /* conf is processed by software */
int hardware; /* conf is processed by hardware */
- /* note: if both unset, has only one member */
+ /* note: if both unset, has only one member */
};
@@ -122,7 +122,7 @@ struct dsp_dtmf {
int hardware; /* dtmf uses hardware decoding */
int size; /* number of bytes in buffer */
signed short buffer[DSP_DTMF_NPOINTS];
- /* buffers one full dtmf frame */
+ /* buffers one full dtmf frame */
u8 lastwhat, lastdigit;
int count;
u8 digits[16]; /* dtmf result */
@@ -189,7 +189,7 @@ struct dsp {
u32 conf_id;
struct dsp_conf *conf;
struct dsp_conf_member
- *member;
+ *member;
/* buffer stuff */
int rx_W; /* current write pos for data without timestamp */
@@ -203,7 +203,7 @@ struct dsp {
u8 rx_buff[CMX_BUFF_SIZE];
int last_tx; /* if set, we transmitted last poll interval */
int cmx_delay; /* initial delay of buffers,
- or 0 for dynamic jitter buffer */
+ or 0 for dynamic jitter buffer */
int tx_dejitter; /* if set, dejitter tx buffer */
int tx_data; /* enables tx-data of CMX to upper layer */
@@ -231,7 +231,7 @@ struct dsp {
int bf_sync;
struct dsp_pipeline
- pipeline;
+ pipeline;
};
/* functions */
@@ -253,7 +253,7 @@ extern int dsp_cmx_del_conf(struct dsp_conf *conf);
extern void dsp_dtmf_goertzel_init(struct dsp *dsp);
extern void dsp_dtmf_hardware(struct dsp *dsp);
extern u8 *dsp_dtmf_goertzel_decode(struct dsp *dsp, u8 *data, int len,
- int fmt);
+ int fmt);
extern int dsp_tone(struct dsp *dsp, int tone);
extern void dsp_tone_copy(struct dsp *dsp, u8 *data, int len);
@@ -270,7 +270,6 @@ extern int dsp_pipeline_init(struct dsp_pipeline *pipeline);
extern void dsp_pipeline_destroy(struct dsp_pipeline *pipeline);
extern int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg);
extern void dsp_pipeline_process_tx(struct dsp_pipeline *pipeline, u8 *data,
- int len);
+ int len);
extern void dsp_pipeline_process_rx(struct dsp_pipeline *pipeline, u8 *data,
- int len, unsigned int txlen);
-
+ int len, unsigned int txlen);
diff --git a/drivers/isdn/mISDN/dsp_audio.c b/drivers/isdn/mISDN/dsp_audio.c
index b8f18bd09e43..06022952a437 100644
--- a/drivers/isdn/mISDN/dsp_audio.c
+++ b/drivers/isdn/mISDN/dsp_audio.c
@@ -61,7 +61,7 @@ static inline unsigned char linear2alaw(short int linear)
}
/* Convert the scaled magnitude to segment number. */
- for (seg = 0; seg < 8; seg++) {
+ for (seg = 0; seg < 8; seg++) {
if (pcm_val <= seg_end[seg])
break;
}
@@ -263,7 +263,7 @@ dsp_audio_generate_mix_table(void)
sample = 32767;
if (sample < -32768)
sample = -32768;
- dsp_audio_mix_law[(i<<8)|j] =
+ dsp_audio_mix_law[(i << 8) | j] =
dsp_audio_s16_to_law[sample & 0xffff];
j++;
}
@@ -431,4 +431,3 @@ dsp_change_volume(struct sk_buff *skb, int volume)
i++;
}
}
-
diff --git a/drivers/isdn/mISDN/dsp_biquad.h b/drivers/isdn/mISDN/dsp_biquad.h
index 038191bc45f5..c0c933a5d197 100644
--- a/drivers/isdn/mISDN/dsp_biquad.h
+++ b/drivers/isdn/mISDN/dsp_biquad.h
@@ -38,7 +38,7 @@ struct biquad2_state {
};
static inline void biquad2_init(struct biquad2_state *bq,
- int32_t gain, int32_t a1, int32_t a2, int32_t b1, int32_t b2)
+ int32_t gain, int32_t a1, int32_t a2, int32_t b1, int32_t b2)
{
bq->gain = gain;
bq->a1 = a1;
@@ -55,8 +55,8 @@ static inline int16_t biquad2(struct biquad2_state *bq, int16_t sample)
int32_t y;
int32_t z0;
- z0 = sample*bq->gain + bq->z1*bq->a1 + bq->z2*bq->a2;
- y = z0 + bq->z1*bq->b1 + bq->z2*bq->b2;
+ z0 = sample * bq->gain + bq->z1 * bq->a1 + bq->z2 * bq->a2;
+ y = z0 + bq->z1 * bq->b1 + bq->z2 * bq->b2;
bq->z2 = bq->z1;
bq->z1 = z0 >> 15;
diff --git a/drivers/isdn/mISDN/dsp_blowfish.c b/drivers/isdn/mISDN/dsp_blowfish.c
index 18e411e95bba..0aa572f3858d 100644
--- a/drivers/isdn/mISDN/dsp_blowfish.c
+++ b/drivers/isdn/mISDN/dsp_blowfish.c
@@ -354,8 +354,8 @@ static const u32 bf_sbox[256 * 4] = {
#define GET32_1(x) (((x) >> (16)) & (0xff))
#define GET32_0(x) (((x) >> (24)) & (0xff))
-#define bf_F(x) (((S[GET32_0(x)] + S[256 + GET32_1(x)]) ^ \
- S[512 + GET32_2(x)]) + S[768 + GET32_3(x)])
+#define bf_F(x) (((S[GET32_0(x)] + S[256 + GET32_1(x)]) ^ \
+ S[512 + GET32_2(x)]) + S[768 + GET32_3(x)])
#define EROUND(a, b, n) do { b ^= P[n]; a ^= bf_F(b); } while (0)
#define DROUND(a, b, n) do { a ^= bf_F(b); b ^= P[n]; } while (0)
@@ -388,17 +388,17 @@ dsp_bf_encrypt(struct dsp *dsp, u8 *data, int len)
j = 0;
/* transcode 9 samples xlaw to 8 bytes */
yl = dsp_audio_law2seven[bf_data_in[0]];
- yl = (yl<<7) | dsp_audio_law2seven[bf_data_in[1]];
- yl = (yl<<7) | dsp_audio_law2seven[bf_data_in[2]];
- yl = (yl<<7) | dsp_audio_law2seven[bf_data_in[3]];
+ yl = (yl << 7) | dsp_audio_law2seven[bf_data_in[1]];
+ yl = (yl << 7) | dsp_audio_law2seven[bf_data_in[2]];
+ yl = (yl << 7) | dsp_audio_law2seven[bf_data_in[3]];
nibble = dsp_audio_law2seven[bf_data_in[4]];
yr = nibble;
- yl = (yl<<4) | (nibble>>3);
- yr = (yr<<7) | dsp_audio_law2seven[bf_data_in[5]];
- yr = (yr<<7) | dsp_audio_law2seven[bf_data_in[6]];
- yr = (yr<<7) | dsp_audio_law2seven[bf_data_in[7]];
- yr = (yr<<7) | dsp_audio_law2seven[bf_data_in[8]];
- yr = (yr<<1) | (bf_data_in[0] & 1);
+ yl = (yl << 4) | (nibble >> 3);
+ yr = (yr << 7) | dsp_audio_law2seven[bf_data_in[5]];
+ yr = (yr << 7) | dsp_audio_law2seven[bf_data_in[6]];
+ yr = (yr << 7) | dsp_audio_law2seven[bf_data_in[7]];
+ yr = (yr << 7) | dsp_audio_law2seven[bf_data_in[8]];
+ yr = (yr << 1) | (bf_data_in[0] & 1);
/* fill unused bit with random noise of audio input */
/* encrypt */
@@ -423,24 +423,24 @@ dsp_bf_encrypt(struct dsp *dsp, u8 *data, int len)
yr ^= P[17];
/* calculate 3-bit checksumme */
- cs = yl ^ (yl>>3) ^ (yl>>6) ^ (yl>>9) ^ (yl>>12) ^ (yl>>15)
- ^ (yl>>18) ^ (yl>>21) ^ (yl>>24) ^ (yl>>27) ^ (yl>>30)
- ^ (yr<<2) ^ (yr>>1) ^ (yr>>4) ^ (yr>>7) ^ (yr>>10)
- ^ (yr>>13) ^ (yr>>16) ^ (yr>>19) ^ (yr>>22) ^ (yr>>25)
- ^ (yr>>28) ^ (yr>>31);
+ cs = yl ^ (yl >> 3) ^ (yl >> 6) ^ (yl >> 9) ^ (yl >> 12) ^ (yl >> 15)
+ ^ (yl >> 18) ^ (yl >> 21) ^ (yl >> 24) ^ (yl >> 27) ^ (yl >> 30)
+ ^ (yr << 2) ^ (yr >> 1) ^ (yr >> 4) ^ (yr >> 7) ^ (yr >> 10)
+ ^ (yr >> 13) ^ (yr >> 16) ^ (yr >> 19) ^ (yr >> 22) ^ (yr >> 25)
+ ^ (yr >> 28) ^ (yr >> 31);
/*
* transcode 8 crypted bytes to 9 data bytes with sync
* and checksum information
*/
- bf_crypt_out[0] = (yl>>25) | 0x80;
- bf_crypt_out[1] = (yl>>18) & 0x7f;
- bf_crypt_out[2] = (yl>>11) & 0x7f;
- bf_crypt_out[3] = (yl>>4) & 0x7f;
- bf_crypt_out[4] = ((yl<<3) & 0x78) | ((yr>>29) & 0x07);
- bf_crypt_out[5] = ((yr>>22) & 0x7f) | ((cs<<5) & 0x80);
- bf_crypt_out[6] = ((yr>>15) & 0x7f) | ((cs<<6) & 0x80);
- bf_crypt_out[7] = ((yr>>8) & 0x7f) | (cs<<7);
+ bf_crypt_out[0] = (yl >> 25) | 0x80;
+ bf_crypt_out[1] = (yl >> 18) & 0x7f;
+ bf_crypt_out[2] = (yl >> 11) & 0x7f;
+ bf_crypt_out[3] = (yl >> 4) & 0x7f;
+ bf_crypt_out[4] = ((yl << 3) & 0x78) | ((yr >> 29) & 0x07);
+ bf_crypt_out[5] = ((yr >> 22) & 0x7f) | ((cs << 5) & 0x80);
+ bf_crypt_out[6] = ((yr >> 15) & 0x7f) | ((cs << 6) & 0x80);
+ bf_crypt_out[7] = ((yr >> 8) & 0x7f) | (cs << 7);
bf_crypt_out[8] = yr;
}
@@ -474,45 +474,45 @@ dsp_bf_decrypt(struct dsp *dsp, u8 *data, int len)
* shift upper bit and rotate data to buffer ring
* send current decrypted data
*/
- sync = (sync<<1) | ((*data)>>7);
+ sync = (sync << 1) | ((*data) >> 7);
bf_crypt_inring[j++ & 15] = *data;
*data++ = bf_data_out[k++];
i++;
if (k == 9)
k = 0; /* repeat if no sync has been found */
/* check if not in sync */
- if ((sync&0x1f0) != 0x100)
+ if ((sync & 0x1f0) != 0x100)
continue;
j -= 9;
/* transcode receive data to 64 bit block of encrypted data */
yl = bf_crypt_inring[j++ & 15];
- yl = (yl<<7) | bf_crypt_inring[j++ & 15]; /* bit7 = 0 */
- yl = (yl<<7) | bf_crypt_inring[j++ & 15]; /* bit7 = 0 */
- yl = (yl<<7) | bf_crypt_inring[j++ & 15]; /* bit7 = 0 */
+ yl = (yl << 7) | bf_crypt_inring[j++ & 15]; /* bit7 = 0 */
+ yl = (yl << 7) | bf_crypt_inring[j++ & 15]; /* bit7 = 0 */
+ yl = (yl << 7) | bf_crypt_inring[j++ & 15]; /* bit7 = 0 */
nibble = bf_crypt_inring[j++ & 15]; /* bit7 = 0 */
yr = nibble;
- yl = (yl<<4) | (nibble>>3);
+ yl = (yl << 4) | (nibble >> 3);
cs2 = bf_crypt_inring[j++ & 15];
- yr = (yr<<7) | (cs2 & 0x7f);
+ yr = (yr << 7) | (cs2 & 0x7f);
cs1 = bf_crypt_inring[j++ & 15];
- yr = (yr<<7) | (cs1 & 0x7f);
+ yr = (yr << 7) | (cs1 & 0x7f);
cs0 = bf_crypt_inring[j++ & 15];
- yr = (yr<<7) | (cs0 & 0x7f);
- yr = (yr<<8) | bf_crypt_inring[j++ & 15];
+ yr = (yr << 7) | (cs0 & 0x7f);
+ yr = (yr << 8) | bf_crypt_inring[j++ & 15];
/* calculate 3-bit checksumme */
- cs = yl ^ (yl>>3) ^ (yl>>6) ^ (yl>>9) ^ (yl>>12) ^ (yl>>15)
- ^ (yl>>18) ^ (yl>>21) ^ (yl>>24) ^ (yl>>27) ^ (yl>>30)
- ^ (yr<<2) ^ (yr>>1) ^ (yr>>4) ^ (yr>>7) ^ (yr>>10)
- ^ (yr>>13) ^ (yr>>16) ^ (yr>>19) ^ (yr>>22) ^ (yr>>25)
- ^ (yr>>28) ^ (yr>>31);
+ cs = yl ^ (yl >> 3) ^ (yl >> 6) ^ (yl >> 9) ^ (yl >> 12) ^ (yl >> 15)
+ ^ (yl >> 18) ^ (yl >> 21) ^ (yl >> 24) ^ (yl >> 27) ^ (yl >> 30)
+ ^ (yr << 2) ^ (yr >> 1) ^ (yr >> 4) ^ (yr >> 7) ^ (yr >> 10)
+ ^ (yr >> 13) ^ (yr >> 16) ^ (yr >> 19) ^ (yr >> 22) ^ (yr >> 25)
+ ^ (yr >> 28) ^ (yr >> 31);
/* check if frame is valid */
- if ((cs&0x7) != (((cs2>>5)&4) | ((cs1>>6)&2) | (cs0 >> 7))) {
+ if ((cs & 0x7) != (((cs2 >> 5) & 4) | ((cs1 >> 6) & 2) | (cs0 >> 7))) {
if (dsp_debug & DEBUG_DSP_BLOWFISH)
printk(KERN_DEBUG
- "DSP BLOWFISH: received corrupt frame, "
- "checksumme is not correct\n");
+ "DSP BLOWFISH: received corrupt frame, "
+ "checksumme is not correct\n");
continue;
}
@@ -537,17 +537,17 @@ dsp_bf_decrypt(struct dsp *dsp, u8 *data, int len)
DROUND(yr, yl, 0);
/* transcode 8 crypted bytes to 9 sample bytes */
- bf_data_out[0] = dsp_audio_seven2law[(yl>>25) & 0x7f];
- bf_data_out[1] = dsp_audio_seven2law[(yl>>18) & 0x7f];
- bf_data_out[2] = dsp_audio_seven2law[(yl>>11) & 0x7f];
- bf_data_out[3] = dsp_audio_seven2law[(yl>>4) & 0x7f];
- bf_data_out[4] = dsp_audio_seven2law[((yl<<3) & 0x78) |
- ((yr>>29) & 0x07)];
-
- bf_data_out[5] = dsp_audio_seven2law[(yr>>22) & 0x7f];
- bf_data_out[6] = dsp_audio_seven2law[(yr>>15) & 0x7f];
- bf_data_out[7] = dsp_audio_seven2law[(yr>>8) & 0x7f];
- bf_data_out[8] = dsp_audio_seven2law[(yr>>1) & 0x7f];
+ bf_data_out[0] = dsp_audio_seven2law[(yl >> 25) & 0x7f];
+ bf_data_out[1] = dsp_audio_seven2law[(yl >> 18) & 0x7f];
+ bf_data_out[2] = dsp_audio_seven2law[(yl >> 11) & 0x7f];
+ bf_data_out[3] = dsp_audio_seven2law[(yl >> 4) & 0x7f];
+ bf_data_out[4] = dsp_audio_seven2law[((yl << 3) & 0x78) |
+ ((yr >> 29) & 0x07)];
+
+ bf_data_out[5] = dsp_audio_seven2law[(yr >> 22) & 0x7f];
+ bf_data_out[6] = dsp_audio_seven2law[(yr >> 15) & 0x7f];
+ bf_data_out[7] = dsp_audio_seven2law[(yr >> 8) & 0x7f];
+ bf_data_out[8] = dsp_audio_seven2law[(yr >> 1) & 0x7f];
k = 0; /* start with new decoded frame */
}
@@ -631,9 +631,9 @@ dsp_bf_init(struct dsp *dsp, const u8 *key, uint keylen)
/* Actual subkey generation */
for (j = 0, i = 0; i < 16 + 2; i++) {
temp = (((u32)key[j] << 24) |
- ((u32)key[(j + 1) % keylen] << 16) |
- ((u32)key[(j + 2) % keylen] << 8) |
- ((u32)key[(j + 3) % keylen]));
+ ((u32)key[(j + 1) % keylen] << 16) |
+ ((u32)key[(j + 2) % keylen] << 8) |
+ ((u32)key[(j + 3) % keylen]));
P[i] = P[i] ^ temp;
j = (j + 4) % keylen;
diff --git a/drivers/isdn/mISDN/dsp_cmx.c b/drivers/isdn/mISDN/dsp_cmx.c
index 4d395dea32f3..334feab060a1 100644
--- a/drivers/isdn/mISDN/dsp_cmx.c
+++ b/drivers/isdn/mISDN/dsp_cmx.c
@@ -165,8 +165,8 @@ dsp_cmx_debug(struct dsp *dsp)
printk(KERN_DEBUG "-----Current DSP\n");
list_for_each_entry(odsp, &dsp_ilist, list) {
printk(KERN_DEBUG "* %s hardecho=%d softecho=%d txmix=%d",
- odsp->name, odsp->echo.hardware, odsp->echo.software,
- odsp->tx_mix);
+ odsp->name, odsp->echo.hardware, odsp->echo.software,
+ odsp->tx_mix);
if (odsp->conf)
printk(" (Conf %d)", odsp->conf->id);
if (dsp == odsp)
@@ -178,14 +178,14 @@ dsp_cmx_debug(struct dsp *dsp)
printk(KERN_DEBUG "* Conf %d (%p)\n", conf->id, conf);
list_for_each_entry(member, &conf->mlist, list) {
printk(KERN_DEBUG
- " - member = %s (slot_tx %d, bank_tx %d, "
- "slot_rx %d, bank_rx %d hfc_conf %d "
- "tx_data %d rx_is_off %d)%s\n",
- member->dsp->name, member->dsp->pcm_slot_tx,
- member->dsp->pcm_bank_tx, member->dsp->pcm_slot_rx,
- member->dsp->pcm_bank_rx, member->dsp->hfc_conf,
- member->dsp->tx_data, member->dsp->rx_is_off,
- (member->dsp == dsp) ? " *this*" : "");
+ " - member = %s (slot_tx %d, bank_tx %d, "
+ "slot_rx %d, bank_rx %d hfc_conf %d "
+ "tx_data %d rx_is_off %d)%s\n",
+ member->dsp->name, member->dsp->pcm_slot_tx,
+ member->dsp->pcm_bank_tx, member->dsp->pcm_slot_rx,
+ member->dsp->pcm_bank_rx, member->dsp->hfc_conf,
+ member->dsp->tx_data, member->dsp->rx_is_off,
+ (member->dsp == dsp) ? " *this*" : "");
}
}
printk(KERN_DEBUG "-----end\n");
@@ -227,13 +227,13 @@ dsp_cmx_add_conf_member(struct dsp *dsp, struct dsp_conf *conf)
}
if (dsp->member) {
printk(KERN_WARNING "%s: dsp is already member in a conf.\n",
- __func__);
+ __func__);
return -EINVAL;
}
if (dsp->conf) {
printk(KERN_WARNING "%s: dsp is already in a conf.\n",
- __func__);
+ __func__);
return -EINVAL;
}
@@ -268,19 +268,19 @@ dsp_cmx_del_conf_member(struct dsp *dsp)
if (!dsp) {
printk(KERN_WARNING "%s: dsp is 0.\n",
- __func__);
+ __func__);
return -EINVAL;
}
if (!dsp->conf) {
printk(KERN_WARNING "%s: dsp is not in a conf.\n",
- __func__);
+ __func__);
return -EINVAL;
}
if (list_empty(&dsp->conf->mlist)) {
printk(KERN_WARNING "%s: dsp has linked an empty conf.\n",
- __func__);
+ __func__);
return -EINVAL;
}
@@ -295,8 +295,8 @@ dsp_cmx_del_conf_member(struct dsp *dsp)
}
}
printk(KERN_WARNING
- "%s: dsp is not present in its own conf_meber list.\n",
- __func__);
+ "%s: dsp is not present in its own conf_meber list.\n",
+ __func__);
return -EINVAL;
}
@@ -312,7 +312,7 @@ static struct dsp_conf
if (!id) {
printk(KERN_WARNING "%s: id is 0.\n",
- __func__);
+ __func__);
return NULL;
}
@@ -338,13 +338,13 @@ dsp_cmx_del_conf(struct dsp_conf *conf)
{
if (!conf) {
printk(KERN_WARNING "%s: conf is null.\n",
- __func__);
+ __func__);
return -EINVAL;
}
if (!list_empty(&conf->mlist)) {
printk(KERN_WARNING "%s: conf not empty.\n",
- __func__);
+ __func__);
return -EINVAL;
}
list_del(&conf->list);
@@ -359,7 +359,7 @@ dsp_cmx_del_conf(struct dsp_conf *conf)
*/
static void
dsp_cmx_hw_message(struct dsp *dsp, u32 message, u32 param1, u32 param2,
- u32 param3, u32 param4)
+ u32 param3, u32 param4)
{
struct mISDN_ctrl_req cq;
@@ -389,7 +389,7 @@ dsp_cmx_hardware(struct dsp_conf *conf, struct dsp *dsp)
int freeunits[8];
u_char freeslots[256];
int same_hfc = -1, same_pcm = -1, current_conf = -1,
- all_conf = 1, tx_data = 0;
+ all_conf = 1, tx_data = 0;
/* dsp gets updated (no conf) */
if (!conf) {
@@ -397,17 +397,17 @@ dsp_cmx_hardware(struct dsp_conf *conf, struct dsp *dsp)
return;
if (dsp_debug & DEBUG_DSP_CMX)
printk(KERN_DEBUG "%s checking dsp %s\n",
- __func__, dsp->name);
-one_member:
+ __func__, dsp->name);
+ one_member:
/* remove HFC conference if enabled */
if (dsp->hfc_conf >= 0) {
if (dsp_debug & DEBUG_DSP_CMX)
printk(KERN_DEBUG
- "%s removing %s from HFC conf %d "
- "because dsp is split\n", __func__,
- dsp->name, dsp->hfc_conf);
+ "%s removing %s from HFC conf %d "
+ "because dsp is split\n", __func__,
+ dsp->name, dsp->hfc_conf);
dsp_cmx_hw_message(dsp, MISDN_CTRL_HFC_CONF_SPLIT,
- 0, 0, 0, 0);
+ 0, 0, 0, 0);
dsp->hfc_conf = -1;
}
/* process hw echo */
@@ -418,12 +418,12 @@ one_member:
if (dsp->pcm_slot_tx >= 0 || dsp->pcm_slot_rx >= 0) {
if (dsp_debug & DEBUG_DSP_CMX)
printk(KERN_DEBUG "%s removing %s from"
- " PCM slot %d (TX) %d (RX) because"
- " dsp is split (no echo)\n",
- __func__, dsp->name,
- dsp->pcm_slot_tx, dsp->pcm_slot_rx);
+ " PCM slot %d (TX) %d (RX) because"
+ " dsp is split (no echo)\n",
+ __func__, dsp->name,
+ dsp->pcm_slot_tx, dsp->pcm_slot_rx);
dsp_cmx_hw_message(dsp, MISDN_CTRL_HFC_PCM_DISC,
- 0, 0, 0, 0);
+ 0, 0, 0, 0);