aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/capi/capifs.c4
-rw-r--r--drivers/isdn/gigaset/asyncdata.c18
-rw-r--r--drivers/isdn/gigaset/bas-gigaset.c13
-rw-r--r--drivers/isdn/gigaset/common.c21
-rw-r--r--drivers/isdn/gigaset/ev-layer.c42
-rw-r--r--drivers/isdn/gigaset/gigaset.h20
-rw-r--r--drivers/isdn/gigaset/i4l.c4
-rw-r--r--drivers/isdn/gigaset/interface.c52
-rw-r--r--drivers/isdn/gigaset/isocdata.c6
-rw-r--r--drivers/isdn/gigaset/ser-gigaset.c32
-rw-r--r--drivers/isdn/gigaset/usb-gigaset.c14
-rw-r--r--drivers/isdn/hardware/eicon/di.c28
-rw-r--r--drivers/isdn/hardware/eicon/message.c60
-rw-r--r--drivers/isdn/hardware/mISDN/hfc_multi.h4
-rw-r--r--drivers/isdn/hardware/mISDN/hfcmulti.c67
-rw-r--r--drivers/isdn/hysdn/hysdn_net.c6
-rw-r--r--drivers/isdn/hysdn/hysdn_procconf.c6
-rw-r--r--drivers/isdn/i4l/isdn_concap.c4
-rw-r--r--drivers/isdn/i4l/isdn_net.c224
-rw-r--r--drivers/isdn/i4l/isdn_net.h50
-rw-r--r--drivers/isdn/i4l/isdn_ppp.c32
-rw-r--r--drivers/isdn/mISDN/core.c8
-rw-r--r--drivers/isdn/mISDN/dsp_audio.c2
-rw-r--r--drivers/isdn/mISDN/dsp_cmx.c8
-rw-r--r--drivers/isdn/mISDN/dsp_core.c4
-rw-r--r--drivers/isdn/mISDN/dsp_hwec.c2
-rw-r--r--drivers/isdn/mISDN/dsp_pipeline.c2
-rw-r--r--drivers/isdn/mISDN/dsp_tones.c92
-rw-r--r--drivers/isdn/mISDN/l1oip_codec.c1
-rw-r--r--drivers/isdn/mISDN/l1oip_core.c22
-rw-r--r--drivers/isdn/mISDN/layer1.c3
-rw-r--r--drivers/isdn/mISDN/layer2.c16
-rw-r--r--drivers/isdn/mISDN/socket.c2
-rw-r--r--drivers/isdn/mISDN/stack.c2
-rw-r--r--drivers/isdn/mISDN/tei.c4
-rw-r--r--drivers/isdn/mISDN/timerdev.c9
36 files changed, 376 insertions, 508 deletions
diff --git a/drivers/isdn/capi/capifs.c b/drivers/isdn/capi/capifs.c
index 550e80f390a6..0aa66ec4cbdd 100644
--- a/drivers/isdn/capi/capifs.c
+++ b/drivers/isdn/capi/capifs.c
@@ -156,8 +156,8 @@ void capifs_new_ncci(unsigned int number, dev_t device)
156 if (!inode) 156 if (!inode)
157 return; 157 return;
158 inode->i_ino = number+2; 158 inode->i_ino = number+2;
159 inode->i_uid = config.setuid ? config.uid : current->fsuid; 159 inode->i_uid = config.setuid ? config.uid : current_fsuid();
160 inode->i_gid = config.setgid ? config.gid : current->fsgid; 160 inode->i_gid = config.setgid ? config.gid : current_fsgid();
161 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 161 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
162 init_special_inode(inode, S_IFCHR|config.mode, device); 162 init_special_inode(inode, S_IFCHR|config.mode, device);
163 //inode->i_op = &capifs_file_inode_operations; 163 //inode->i_op = &capifs_file_inode_operations;
diff --git a/drivers/isdn/gigaset/asyncdata.c b/drivers/isdn/gigaset/asyncdata.c
index c2bd97d29273..2a4ce96f04bd 100644
--- a/drivers/isdn/gigaset/asyncdata.c
+++ b/drivers/isdn/gigaset/asyncdata.c
@@ -17,8 +17,6 @@
17#include <linux/crc-ccitt.h> 17#include <linux/crc-ccitt.h>
18#include <linux/bitrev.h> 18#include <linux/bitrev.h>
19 19
20//#define GIG_M10x_STUFF_VOICE_DATA
21
22/* check if byte must be stuffed/escaped 20/* check if byte must be stuffed/escaped
23 * I'm not sure which data should be encoded. 21 * I'm not sure which data should be encoded.
24 * Therefore I will go the hard way and decode every value 22 * Therefore I will go the hard way and decode every value
@@ -147,19 +145,17 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes,
147 } 145 }
148byte_stuff: 146byte_stuff:
149 c ^= PPP_TRANS; 147 c ^= PPP_TRANS;
150#ifdef CONFIG_GIGASET_DEBUG
151 if (unlikely(!muststuff(c))) 148 if (unlikely(!muststuff(c)))
152 gig_dbg(DEBUG_HDLC, "byte stuffed: 0x%02x", c); 149 gig_dbg(DEBUG_HDLC, "byte stuffed: 0x%02x", c);
153#endif
154 } else if (unlikely(c == PPP_FLAG)) { 150 } else if (unlikely(c == PPP_FLAG)) {
155 if (unlikely(inputstate & INS_skip_frame)) { 151 if (unlikely(inputstate & INS_skip_frame)) {
156 if (!(inputstate & INS_have_data)) { /* 7E 7E */
157#ifdef CONFIG_GIGASET_DEBUG 152#ifdef CONFIG_GIGASET_DEBUG
153 if (!(inputstate & INS_have_data)) { /* 7E 7E */
158 ++bcs->emptycount; 154 ++bcs->emptycount;
159#endif
160 } else 155 } else
161 gig_dbg(DEBUG_HDLC, 156 gig_dbg(DEBUG_HDLC,
162 "7e----------------------------"); 157 "7e----------------------------");
158#endif
163 159
164 /* end of frame */ 160 /* end of frame */
165 error = 1; 161 error = 1;
@@ -226,11 +222,9 @@ byte_stuff:
226 } 222 }
227 223
228 break; 224 break;
229#ifdef CONFIG_GIGASET_DEBUG
230 } else if (unlikely(muststuff(c))) { 225 } else if (unlikely(muststuff(c))) {
231 /* Should not happen. Possible after ZDLE=1<CR><LF>. */ 226 /* Should not happen. Possible after ZDLE=1<CR><LF>. */
232 gig_dbg(DEBUG_HDLC, "not byte stuffed: 0x%02x", c); 227 gig_dbg(DEBUG_HDLC, "not byte stuffed: 0x%02x", c);
233#endif
234 } 228 }
235 229
236 /* add character */ 230 /* add character */
@@ -394,20 +388,16 @@ void gigaset_m10x_input(struct inbuf_t *inbuf)
394 inbuf->inputstate &= ~INS_DLE_char; 388 inbuf->inputstate &= ~INS_DLE_char;
395 switch (c) { 389 switch (c) {
396 case 'X': /*begin of command*/ 390 case 'X': /*begin of command*/
397#ifdef CONFIG_GIGASET_DEBUG
398 if (inbuf->inputstate & INS_command) 391 if (inbuf->inputstate & INS_command)
399 dev_err(cs->dev, 392 dev_warn(cs->dev,
400 "received <DLE> 'X' in command mode\n"); 393 "received <DLE> 'X' in command mode\n");
401#endif
402 inbuf->inputstate |= 394 inbuf->inputstate |=
403 INS_command | INS_DLE_command; 395 INS_command | INS_DLE_command;
404 break; 396 break;
405 case '.': /*end of command*/ 397 case '.': /*end of command*/
406#ifdef CONFIG_GIGASET_DEBUG
407 if (!(inbuf->inputstate & INS_command)) 398 if (!(inbuf->inputstate & INS_command))
408 dev_err(cs->dev, 399 dev_warn(cs->dev,
409 "received <DLE> '.' in hdlc mode\n"); 400 "received <DLE> '.' in hdlc mode\n");
410#endif
411 inbuf->inputstate &= cs->dle ? 401 inbuf->inputstate &= cs->dle ?
412 ~(INS_DLE_command|INS_command) 402 ~(INS_DLE_command|INS_command)
413 : ~INS_DLE_command; 403 : ~INS_DLE_command;
diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
index 3f11910c7ccd..18dd8aacbe8d 100644
--- a/drivers/isdn/gigaset/bas-gigaset.c
+++ b/drivers/isdn/gigaset/bas-gigaset.c
@@ -2067,7 +2067,7 @@ static int gigaset_initbcshw(struct bc_state *bcs)
2067 2067
2068 bcs->hw.bas = ubc = kmalloc(sizeof(struct bas_bc_state), GFP_KERNEL); 2068 bcs->hw.bas = ubc = kmalloc(sizeof(struct bas_bc_state), GFP_KERNEL);
2069 if (!ubc) { 2069 if (!ubc) {
2070 err("could not allocate bas_bc_state"); 2070 pr_err("out of memory\n");
2071 return 0; 2071 return 0;
2072 } 2072 }
2073 2073
@@ -2081,7 +2081,7 @@ static int gigaset_initbcshw(struct bc_state *bcs)
2081 ubc->isooutdone = ubc->isooutfree = ubc->isooutovfl = NULL; 2081 ubc->isooutdone = ubc->isooutfree = ubc->isooutovfl = NULL;
2082 ubc->numsub = 0; 2082 ubc->numsub = 0;
2083 if (!(ubc->isooutbuf = kmalloc(sizeof(struct isowbuf_t), GFP_KERNEL))) { 2083 if (!(ubc->isooutbuf = kmalloc(sizeof(struct isowbuf_t), GFP_KERNEL))) {
2084 err("could not allocate isochronous output buffer"); 2084 pr_err("out of memory\n");
2085 kfree(ubc); 2085 kfree(ubc);
2086 bcs->hw.bas = NULL; 2086 bcs->hw.bas = NULL;
2087 return 0; 2087 return 0;
@@ -2136,8 +2136,10 @@ static int gigaset_initcshw(struct cardstate *cs)
2136 struct bas_cardstate *ucs; 2136 struct bas_cardstate *ucs;
2137 2137
2138 cs->hw.bas = ucs = kmalloc(sizeof *ucs, GFP_KERNEL); 2138 cs->hw.bas = ucs = kmalloc(sizeof *ucs, GFP_KERNEL);
2139 if (!ucs) 2139 if (!ucs) {
2140 pr_err("out of memory\n");
2140 return 0; 2141 return 0;
2142 }
2141 2143
2142 ucs->urb_cmd_in = NULL; 2144 ucs->urb_cmd_in = NULL;
2143 ucs->urb_cmd_out = NULL; 2145 ucs->urb_cmd_out = NULL;
@@ -2503,12 +2505,11 @@ static int __init bas_gigaset_init(void)
2503 /* register this driver with the USB subsystem */ 2505 /* register this driver with the USB subsystem */
2504 result = usb_register(&gigaset_usb_driver); 2506 result = usb_register(&gigaset_usb_driver);
2505 if (result < 0) { 2507 if (result < 0) {
2506 err("usb_register failed (error %d)", -result); 2508 pr_err("error %d registering USB driver\n", -result);
2507 goto error; 2509 goto error;
2508 } 2510 }
2509 2511
2510 info(DRIVER_AUTHOR); 2512 pr_info(DRIVER_DESC "\n");
2511 info(DRIVER_DESC);
2512 return 0; 2513 return 0;
2513 2514
2514error: 2515error:
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 9d3ce7718e58..0048ce98bfa8 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -580,7 +580,7 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
580 } else if ((bcs->skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL) 580 } else if ((bcs->skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL)
581 skb_reserve(bcs->skb, HW_HDR_LEN); 581 skb_reserve(bcs->skb, HW_HDR_LEN);
582 else { 582 else {
583 warn("could not allocate skb"); 583 pr_err("out of memory\n");
584 bcs->inputstate |= INS_skip_frame; 584 bcs->inputstate |= INS_skip_frame;
585 } 585 }
586 586
@@ -634,20 +634,20 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
634 634
635 gig_dbg(DEBUG_INIT, "allocating cs"); 635 gig_dbg(DEBUG_INIT, "allocating cs");
636 if (!(cs = alloc_cs(drv))) { 636 if (!(cs = alloc_cs(drv))) {
637 err("maximum number of devices exceeded"); 637 pr_err("maximum number of devices exceeded\n");
638 return NULL; 638 return NULL;
639 } 639 }
640 640
641 gig_dbg(DEBUG_INIT, "allocating bcs[0..%d]", channels - 1); 641 gig_dbg(DEBUG_INIT, "allocating bcs[0..%d]", channels - 1);
642 cs->bcs = kmalloc(channels * sizeof(struct bc_state), GFP_KERNEL); 642 cs->bcs = kmalloc(channels * sizeof(struct bc_state), GFP_KERNEL);
643 if (!cs->bcs) { 643 if (!cs->bcs) {
644 err("out of memory"); 644 pr_err("out of memory\n");
645 goto error; 645 goto error;
646 } 646 }
647 gig_dbg(DEBUG_INIT, "allocating inbuf"); 647 gig_dbg(DEBUG_INIT, "allocating inbuf");
648 cs->inbuf = kmalloc(sizeof(struct inbuf_t), GFP_KERNEL); 648 cs->inbuf = kmalloc(sizeof(struct inbuf_t), GFP_KERNEL);
649 if (!cs->inbuf) { 649 if (!cs->inbuf) {
650 err("out of memory"); 650 pr_err("out of memory\n");
651 goto error; 651 goto error;
652 } 652 }
653 653
@@ -690,7 +690,7 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
690 for (i = 0; i < channels; ++i) { 690 for (i = 0; i < channels; ++i) {
691 gig_dbg(DEBUG_INIT, "setting up bcs[%d].read", i); 691 gig_dbg(DEBUG_INIT, "setting up bcs[%d].read", i);
692 if (!gigaset_initbcs(cs->bcs + i, cs, i)) { 692 if (!gigaset_initbcs(cs->bcs + i, cs, i)) {
693 err("could not allocate channel %d data", i); 693 pr_err("could not allocate channel %d data\n", i);
694 goto error; 694 goto error;
695 } 695 }
696 } 696 }
@@ -720,17 +720,15 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
720 720
721 gig_dbg(DEBUG_INIT, "setting up iif"); 721 gig_dbg(DEBUG_INIT, "setting up iif");
722 if (!gigaset_register_to_LL(cs, modulename)) { 722 if (!gigaset_register_to_LL(cs, modulename)) {
723 err("register_isdn failed"); 723 pr_err("error registering ISDN device\n");
724 goto error; 724 goto error;
725 } 725 }
726 726
727 make_valid(cs, VALID_ID); 727 make_valid(cs, VALID_ID);
728 ++cs->cs_init; 728 ++cs->cs_init;
729 gig_dbg(DEBUG_INIT, "setting up hw"); 729 gig_dbg(DEBUG_INIT, "setting up hw");
730 if (!cs->ops->initcshw(cs)) { 730 if (!cs->ops->initcshw(cs))
731 err("could not allocate device specific data");
732 goto error; 731 goto error;
733 }
734 732
735 ++cs->cs_init; 733 ++cs->cs_init;
736 734
@@ -836,7 +834,7 @@ static void cleanup_cs(struct cardstate *cs)
836 for (i = 0; i < cs->channels; ++i) { 834 for (i = 0; i < cs->channels; ++i) {
837 gigaset_freebcs(cs->bcs + i); 835 gigaset_freebcs(cs->bcs + i);
838 if (!gigaset_initbcs(cs->bcs + i, cs, i)) 836 if (!gigaset_initbcs(cs->bcs + i, cs, i))
839 break; //FIXME error handling 837 pr_err("could not allocate channel %d data\n", i);
840 } 838 }
841 839
842 if (cs->waiting) { 840 if (cs->waiting) {
@@ -1120,8 +1118,7 @@ static int __init gigaset_init_module(void)
1120 if (gigaset_debuglevel == 1) 1118 if (gigaset_debuglevel == 1)
1121 gigaset_debuglevel = DEBUG_DEFAULT; 1119 gigaset_debuglevel = DEBUG_DEFAULT;
1122 1120
1123 info(DRIVER_AUTHOR); 1121 pr_info(DRIVER_DESC "\n");
1124 info(DRIVER_DESC);
1125 return 0; 1122 return 0;
1126} 1123}
1127 1124
diff --git a/drivers/isdn/gigaset/ev-layer.c b/drivers/isdn/gigaset/ev-layer.c
index 5cbf64d850ee..e582a4887bc1 100644
--- a/drivers/isdn/gigaset/ev-layer.c
+++ b/drivers/isdn/gigaset/ev-layer.c
@@ -203,15 +203,6 @@ struct reply_t gigaset_tab_nocid_m10x[]= /* with dle mode */
203 {EV_TIMEOUT, 120,121, -1, 0, 0, {ACT_FAILVER, ACT_INIT}}, 203 {EV_TIMEOUT, 120,121, -1, 0, 0, {ACT_FAILVER, ACT_INIT}},
204 {RSP_ERROR, 120,121, -1, 0, 0, {ACT_FAILVER, ACT_INIT}}, 204 {RSP_ERROR, 120,121, -1, 0, 0, {ACT_FAILVER, ACT_INIT}},
205 {RSP_OK, 121,121, -1, 0, 0, {ACT_GOTVER, ACT_INIT}}, 205 {RSP_OK, 121,121, -1, 0, 0, {ACT_GOTVER, ACT_INIT}},
206#if 0
207 {EV_TIMEOUT, 120,121, -1, 130, 5, {ACT_FAILVER}, "^SGCI=1\r"},
208 {RSP_ERROR, 120,121, -1, 130, 5, {ACT_FAILVER}, "^SGCI=1\r"},
209 {RSP_OK, 121,121, -1, 130, 5, {ACT_GOTVER}, "^SGCI=1\r"},
210
211 {RSP_OK, 130,130, -1, 0, 0, {ACT_INIT}},
212 {RSP_ERROR, 130,130, -1, 0, 0, {ACT_FAILINIT}},
213 {EV_TIMEOUT, 130,130, -1, 0, 0, {ACT_FAILINIT}},
214#endif
215 206
216 /* leave dle mode */ 207 /* leave dle mode */
217 {RSP_INIT, 0, 0,SEQ_DLE0, 201, 5, {0}, "^SDLE=0\r"}, 208 {RSP_INIT, 0, 0,SEQ_DLE0, 201, 5, {0}, "^SDLE=0\r"},
@@ -260,10 +251,6 @@ struct reply_t gigaset_tab_nocid_m10x[]= /* with dle mode */
260 {RSP_INIT, 0, 0,SEQ_NOCID, 0, 0, {ACT_ABORTCID}}, 251 {RSP_INIT, 0, 0,SEQ_NOCID, 0, 0, {ACT_ABORTCID}},
261 252
262 /* reset */ 253 /* reset */
263#if 0
264 {RSP_INIT, 0, 0,SEQ_SHUTDOWN, 503, 5, {0}, "^SGCI=0\r"},
265 {RSP_OK, 503,503, -1, 504, 5, {0}, "Z\r"},
266#endif
267 {RSP_INIT, 0, 0,SEQ_SHUTDOWN, 504, 5, {0}, "Z\r"}, 254 {RSP_INIT, 0, 0,SEQ_SHUTDOWN, 504, 5, {0}, "Z\r"},
268 {RSP_OK, 504,504, -1, 0, 0, {ACT_SDOWN}}, 255 {RSP_OK, 504,504, -1, 0, 0, {ACT_SDOWN}},
269 {RSP_ERROR, 501,599, -1, 0, 0, {ACT_FAILSDOWN}}, 256 {RSP_ERROR, 501,599, -1, 0, 0, {ACT_FAILSDOWN}},
@@ -391,24 +378,6 @@ struct reply_t gigaset_tab_cid_m10x[] = /* for M10x */
391}; 378};
392 379
393 380
394#if 0
395static struct reply_t tab_nocid[]= /* no dle mode */ //FIXME
396{
397 /* resp_code, min_ConState, max_ConState, parameter, new_ConState, timeout, action, command */
398
399 {RSP_ANY, -1, -1, -1, -1,-1, ACT_WARN, NULL},
400 {RSP_LAST,0,0,0,0,0,0}
401};
402
403static struct reply_t tab_cid[] = /* no dle mode */ //FIXME
404{
405 /* resp_code, min_ConState, max_ConState, parameter, new_ConState, timeout, action, command */
406
407 {RSP_ANY, -1, -1, -1, -1,-1, ACT_WARN, NULL},
408 {RSP_LAST,0,0,0,0,0,0}
409};
410#endif
411
412static const struct resp_type_t resp_type[] = 381static const struct resp_type_t resp_type[] =
413{ 382{
414 /*{"", RSP_EMPTY, RT_NOTHING},*/ 383 /*{"", RSP_EMPTY, RT_NOTHING},*/
@@ -665,13 +634,8 @@ void gigaset_handle_modem_response(struct cardstate *cs)
665 dev_err(cs->dev, "out of memory\n"); 634 dev_err(cs->dev, "out of memory\n");
666 ++curarg; 635 ++curarg;
667 } 636 }
668#ifdef CONFIG_GIGASET_DEBUG 637 gig_dbg(DEBUG_CMD, "string==%s",
669 if (!event->ptr) 638 event->ptr ? (char *) event->ptr : "NULL");
670 gig_dbg(DEBUG_CMD, "string==NULL");
671 else
672 gig_dbg(DEBUG_CMD, "string==%s",
673 (char *) event->ptr);
674#endif
675 break; 639 break;
676 case RT_ZCAU: 640 case RT_ZCAU:
677 event->parameter = -1; 641 event->parameter = -1;
@@ -697,9 +661,7 @@ void gigaset_handle_modem_response(struct cardstate *cs)
697 ++curarg; 661 ++curarg;
698 } else 662 } else
699 event->parameter = -1; 663 event->parameter = -1;
700#ifdef CONFIG_GIGASET_DEBUG
701 gig_dbg(DEBUG_CMD, "parameter==%d", event->parameter); 664 gig_dbg(DEBUG_CMD, "parameter==%d", event->parameter);
702#endif
703 break; 665 break;
704 } 666 }
705 667
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h
index 003752954993..747178f03d2c 100644
--- a/drivers/isdn/gigaset/gigaset.h
+++ b/drivers/isdn/gigaset/gigaset.h
@@ -16,6 +16,9 @@
16#ifndef GIGASET_H 16#ifndef GIGASET_H
17#define GIGASET_H 17#define GIGASET_H
18 18
19/* define global prefix for pr_ macros in linux/kernel.h */
20#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
21
19#include <linux/kernel.h> 22#include <linux/kernel.h>
20#include <linux/compiler.h> 23#include <linux/compiler.h>
21#include <linux/types.h> 24#include <linux/types.h>
@@ -97,23 +100,6 @@ enum debuglevel {
97 activated */ 100 activated */
98}; 101};
99 102
100/* Kernel message macros for situations where dev_printk and friends cannot be
101 * used for lack of reliable access to a device structure.
102 * linux/usb.h already contains these but in an obsolete form which clutters
103 * the log needlessly, and according to the USB maintainer those should be
104 * removed rather than fixed anyway.
105 */
106#undef err
107#undef info
108#undef warn
109
110#define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \
111 format "\n" , ## arg)
112#define info(format, arg...) printk(KERN_INFO KBUILD_MODNAME ": " \
113 format "\n" , ## arg)
114#define warn(format, arg...) printk(KERN_WARNING KBUILD_MODNAME ": " \
115 format "\n" , ## arg)
116
117#ifdef CONFIG_GIGASET_DEBUG 103#ifdef CONFIG_GIGASET_DEBUG
118 104
119#define gig_dbg(level, format, arg...) \ 105#define gig_dbg(level, format, arg...) \
diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c
index 3c127a8cbaf2..69a702f0db93 100644
--- a/drivers/isdn/gigaset/i4l.c
+++ b/drivers/isdn/gigaset/i4l.c
@@ -42,7 +42,7 @@ static int writebuf_from_LL(int driverID, int channel, int ack,
42 unsigned skblen; 42 unsigned skblen;
43 43
44 if (!(cs = gigaset_get_cs_by_id(driverID))) { 44 if (!(cs = gigaset_get_cs_by_id(driverID))) {
45 err("%s: invalid driver ID (%d)", __func__, driverID); 45 pr_err("%s: invalid driver ID (%d)\n", __func__, driverID);
46 return -ENODEV; 46 return -ENODEV;
47 } 47 }
48 if (channel < 0 || channel >= cs->channels) { 48 if (channel < 0 || channel >= cs->channels) {
@@ -119,7 +119,7 @@ static int command_from_LL(isdn_ctrl *cntrl)
119 gigaset_debugdrivers(); 119 gigaset_debugdrivers();
120 120
121 if (!cs) { 121 if (!cs) {
122 err("%s: invalid driver ID (%d)", __func__, cntrl->driver); 122 pr_err("%s: invalid driver ID (%d)\n", __func__, cntrl->driver);
123 return -ENODEV; 123 return -ENODEV;
124 } 124 }
125 125
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
index 521951a898ec..311e7ca0fb01 100644
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
@@ -107,7 +107,7 @@ static int if_config(struct cardstate *cs, int *arg)
107 return -EBUSY; 107 return -EBUSY;
108 108
109 if (!cs->connected) { 109 if (!cs->connected) {
110 err("not connected!"); 110 pr_err("%s: not connected\n", __func__);
111 return -ENODEV; 111 return -ENODEV;
112 } 112 }
113 113
@@ -143,9 +143,6 @@ static const struct tty_operations if_ops = {
143 .set_termios = if_set_termios, 143 .set_termios = if_set_termios,
144 .throttle = if_throttle, 144 .throttle = if_throttle,
145 .unthrottle = if_unthrottle, 145 .unthrottle = if_unthrottle,
146#if 0
147 .break_ctl = serial_break,
148#endif
149 .tiocmget = if_tiocmget, 146 .tiocmget = if_tiocmget,
150 .tiocmset = if_tiocmset, 147 .tiocmset = if_tiocmset,
151}; 148};
@@ -188,7 +185,7 @@ static void if_close(struct tty_struct *tty, struct file *filp)
188 185
189 cs = (struct cardstate *) tty->driver_data; 186 cs = (struct cardstate *) tty->driver_data;
190 if (!cs) { 187 if (!cs) {
191 err("cs==NULL in %s", __func__); 188 pr_err("%s: no cardstate\n", __func__);
192 return; 189 return;
193 } 190 }
194 191
@@ -222,7 +219,7 @@ static int if_ioctl(struct tty_struct *tty, struct file *file,
222 219
223 cs = (struct cardstate *) tty->driver_data; 220 cs = (struct cardstate *) tty->driver_data;
224 if (!cs) { 221 if (!cs) {
225 err("cs==NULL in %s", __func__); 222 pr_err("%s: no cardstate\n", __func__);
226 return -ENODEV; 223 return -ENODEV;
227 } 224 }
228 225
@@ -297,7 +294,7 @@ static int if_tiocmget(struct tty_struct *tty, struct file *file)
297 294
298 cs = (struct cardstate *) tty->driver_data; 295 cs = (struct cardstate *) tty->driver_data;
299 if (!cs) { 296 if (!cs) {
300 err("cs==NULL in %s", __func__); 297 pr_err("%s: no cardstate\n", __func__);
301 return -ENODEV; 298 return -ENODEV;
302 } 299 }
303 300
@@ -323,7 +320,7 @@ static int if_tiocmset(struct tty_struct *tty, struct file *file,
323 320
324 cs = (struct cardstate *) tty->driver_data; 321 cs = (struct cardstate *) tty->driver_data;
325 if (!cs) { 322 if (!cs) {
326 err("cs==NULL in %s", __func__); 323 pr_err("%s: no cardstate\n", __func__);
327 return -ENODEV; 324 return -ENODEV;
328 } 325 }
329 326
@@ -354,7 +351,7 @@ static int if_write(struct tty_struct *tty, const unsigned char *buf, int count)
354 351
355 cs = (struct cardstate *) tty->driver_data; 352 cs = (struct cardstate *) tty->driver_data;
356 if (!cs) { 353 if (!cs) {
357 err("cs==NULL in %s", __func__); 354 pr_err("%s: no cardstate\n", __func__);
358 return -ENODEV; 355 return -ENODEV;
359 } 356 }
360 357
@@ -388,7 +385,7 @@ static int if_write_room(struct tty_struct *tty)
388 385
389 cs = (struct cardstate *) tty->driver_data; 386 cs = (struct cardstate *) tty->driver_data;
390 if (!cs) { 387 if (!cs) {
391 err("cs==NULL in %s", __func__); 388 pr_err("%s: no cardstate\n", __func__);
392 return -ENODEV; 389 return -ENODEV;
393 } 390 }
394 391
@@ -420,7 +417,7 @@ static int if_chars_in_buffer(struct tty_struct *tty)
420 417
421 cs = (struct cardstate *) tty->driver_data; 418 cs = (struct cardstate *) tty->driver_data;
422 if (!cs) { 419 if (!cs) {
423 err("cs==NULL in %s", __func__); 420 pr_err("%s: no cardstate\n", __func__);
424 return -ENODEV; 421 return -ENODEV;
425 } 422 }
426 423
@@ -451,7 +448,7 @@ static void if_throttle(struct tty_struct *tty)
451 448
452 cs = (struct cardstate *) tty->driver_data; 449 cs = (struct cardstate *) tty->driver_data;
453 if (!cs) { 450 if (!cs) {
454 err("cs==NULL in %s", __func__); 451 pr_err("%s: no cardstate\n", __func__);
455 return; 452 return;
456 } 453 }
457 454
@@ -474,7 +471,7 @@ static void if_unthrottle(struct tty_struct *tty)
474 471
475 cs = (struct cardstate *) tty->driver_data; 472 cs = (struct cardstate *) tty->driver_data;
476 if (!cs) { 473 if (!cs) {
477 err("cs==NULL in %s", __func__); 474 pr_err("%s: no cardstate\n", __func__);
478 return; 475 return;
479 } 476 }
480 477
@@ -501,7 +498,7 @@ static void if_set_termios(struct tty_struct *tty, struct ktermios *old)
501 498
502 cs = (struct cardstate *) tty->driver_data; 499 cs = (struct cardstate *) tty->driver_data;
503 if (!cs) { 500 if (!cs) {
504 err("cs==NULL in %s", __func__); 501 pr_err("%s: no cardstate\n", __func__);
505 return; 502 return;
506 } 503 }
507 504
@@ -565,29 +562,6 @@ static void if_set_termios(struct tty_struct *tty, struct ktermios *old)
565 562
566 cs->ops->set_line_ctrl(cs, cflag); 563 cs->ops->set_line_ctrl(cs, cflag);
567 564
568#if 0
569 //FIXME this hangs M101 [ts 2005-03-09]
570 //FIXME do we need this?
571 /*
572 * Set flow control: well, I do not really now how to handle DTR/RTS.
573 * Just do what we have seen with SniffUSB on Win98.
574 */
575 /* Drop DTR/RTS if no flow control otherwise assert */
576 gig_dbg(DEBUG_IF, "%u: control_state %x",
577 cs->minor_index, control_state);
578 new_state = control_state;
579 if ((iflag & IXOFF) || (iflag & IXON) || (cflag & CRTSCTS))
580 new_state |= TIOCM_DTR | TIOCM_RTS;
581 else
582 new_state &= ~(TIOCM_DTR | TIOCM_RTS);
583 if (new_state != control_state) {
584 gig_dbg(DEBUG_IF, "%u: new_state %x",
585 cs->minor_index, new_state);
586 gigaset_set_modem_ctrl(cs, control_state, new_state);
587 control_state = new_state;
588 }
589#endif
590
591 /* save off the modified port settings */ 565 /* save off the modified port settings */
592 cs->control_state = control_state; 566 cs->control_state = control_state;
593 567
@@ -701,7 +675,7 @@ void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname,
701 675
702 ret = tty_register_driver(tty); 676 ret = tty_register_driver(tty);
703 if (ret < 0) { 677 if (ret < 0) {
704 warn("failed to register tty driver (error %d)", ret); 678 pr_err("error %d registering tty driver\n", ret);
705 goto error; 679 goto error;
706 } 680 }
707 gig_dbg(DEBUG_IF, "tty driver initialized"); 681 gig_dbg(DEBUG_IF, "tty driver initialized");
@@ -709,7 +683,7 @@ void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname,
709 return; 683 return;
710 684
711enomem: 685enomem:
712 warn("could not allocate tty structures"); 686 pr_err("out of memory\n");
713error: 687error:
714 if (drv->tty) 688 if (drv->tty)
715 put_tty_driver(drv->tty); 689 put_tty_driver(drv->tty);
diff --git a/drivers/isdn/gigaset/isocdata.c b/drivers/isdn/gigaset/isocdata.c
index fbce5222d83c..b171e75cb52e 100644
--- a/drivers/isdn/gigaset/isocdata.c
+++ b/drivers/isdn/gigaset/isocdata.c
@@ -88,11 +88,9 @@ static inline int isowbuf_startwrite(struct isowbuf_t *iwb)
88 __func__); 88 __func__);
89 return 0; 89 return 0;
90 } 90 }
91#ifdef CONFIG_GIGASET_DEBUG
92 gig_dbg(DEBUG_ISO, 91 gig_dbg(DEBUG_ISO,
93 "%s: acquired iso write semaphore, data[write]=%02x, nbits=%d", 92 "%s: acquired iso write semaphore, data[write]=%02x, nbits=%d",
94 __func__, iwb->data[iwb->write], iwb->wbits); 93 __func__, iwb->data[iwb->write], iwb->wbits);
95#endif
96 return 1; 94 return 1;
97} 95}
98 96
@@ -173,13 +171,13 @@ int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size)
173 __func__, read, write, limit); 171 __func__, read, write, limit);
174#ifdef CONFIG_GIGASET_DEBUG 172#ifdef CONFIG_GIGASET_DEBUG
175 if (unlikely(size < 0 || size > BAS_OUTBUFPAD)) { 173 if (unlikely(size < 0 || size > BAS_OUTBUFPAD)) {
176 err("invalid size %d", size); 174 pr_err("invalid size %d\n", size);
177 return -EINVAL; 175 return -EINVAL;
178 } 176 }
179 src = iwb->read; 177 src = iwb->read;
180 if (unlikely(limit > BAS_OUTBUFSIZE + BAS_OUTBUFPAD || 178 if (unlikely(limit > BAS_OUTBUFSIZE + BAS_OUTBUFPAD ||
181 (read < src && limit >= src))) { 179 (read < src && limit >= src))) {
182 err("isoc write buffer frame reservation violated"); 180 pr_err("isoc write buffer frame reservation violated\n");
183 return -EFAULT; 181 return -EFAULT;
184 } 182 }
185#endif 183#endif
diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
index 07052ed2a0c5..ac245e7e96a5 100644
--- a/drivers/isdn/gigaset/ser-gigaset.c
+++ b/drivers/isdn/gigaset/ser-gigaset.c
@@ -16,7 +16,6 @@
16#include <linux/moduleparam.h> 16#include <linux/moduleparam.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/tty.h> 18#include <linux/tty.h>
19#include <linux/poll.h>
20#include <linux/completion.h> 19#include <linux/completion.h>
21 20
22/* Version Information */ 21/* Version Information */
@@ -408,7 +407,7 @@ static int gigaset_initcshw(struct cardstate *cs)
408 int rc; 407 int rc;
409 408
410 if (!(cs->hw.ser = kzalloc(sizeof(struct ser_cardstate), GFP_KERNEL))) { 409 if (!(cs->hw.ser = kzalloc(sizeof(struct ser_cardstate), GFP_KERNEL))) {
411 err("%s: out of memory!", __func__); 410 pr_err("out of memory\n");
412 return 0; 411 return 0;
413 } 412 }
414 413
@@ -416,7 +415,7 @@ static int gigaset_initcshw(struct cardstate *cs)
416 cs->hw.ser->dev.id = cs->minor_index; 415 cs->hw.ser->dev.id = cs->minor_index;
417 cs->hw.ser->dev.dev.release = gigaset_device_release; 416 cs->hw.ser->dev.dev.release = gigaset_device_release;
418 if ((rc = platform_device_register(&cs->hw.ser->dev)) != 0) { 417 if ((rc = platform_device_register(&cs->hw.ser->dev)) != 0) {
419 err("error %d registering platform device", rc); 418 pr_err("error %d registering platform device\n", rc);
420 kfree(cs->hw.ser); 419 kfree(cs->hw.ser);
421 cs->hw.ser = NULL; 420 cs->hw.ser = NULL;
422 return 0; 421 return 0;
@@ -514,11 +513,10 @@ gigaset_tty_open(struct tty_struct *tty)
514 513
515 gig_dbg(DEBUG_INIT, "Starting HLL for Gigaset M101"); 514 gig_dbg(DEBUG_INIT, "Starting HLL for Gigaset M101");
516 515
517 info(DRIVER_AUTHOR); 516 pr_info(DRIVER_DESC "\n");
518 info(DRIVER_DESC);
519 517
520 if (!driver) { 518 if (!driver) {
521 err("%s: no driver structure", __func__); 519 pr_err("%s: no driver structure\n", __func__);
522 return -ENODEV; 520 return -ENODEV;
523 } 521 }
524 522
@@ -571,11 +569,10 @@ gigaset_tty_close(struct tty_struct *tty)
571 } 569 }
572 570
573 /* prevent other callers from entering ldisc methods */ 571 /* prevent other callers from entering ldisc methods */
574 /* FIXME: should use the tty state flags */
575 tty->disc_data = NULL; 572 tty->disc_data = NULL;
576 573
577 if (!cs->hw.ser) 574 if (!cs->hw.ser)
578 err("%s: no hw cardstate", __func__); 575 pr_err("%s: no hw cardstate\n", __func__);
579 else { 576 else {
580 /* wait for running methods to finish */ 577 /* wait for running methods to finish */
581 if (!atomic_dec_and_test(&cs->hw.ser->refcnt)) 578 if (!atomic_dec_and_test(&cs->hw.ser->refcnt))
@@ -673,18 +670,6 @@ gigaset_tty_ioctl(struct tty_struct *tty, struct file *file,
673} 670}
674 671
675/* 672/*
676 * Poll on the tty.
677 * Unused, always return zero.
678 *
679 * FIXME: should probably return an exception - especially on hangup
680 */
681static unsigned int
682gigaset_tty_poll(struct tty_struct *tty, struct file *file, poll_table *wait)
683{
684 return 0;
685}
686
687/*
688 * Called by the tty driver when a block of data has been received. 673 * Called by the tty driver when a block of data has been received.
689 * Will not be re-entered while running but other ldisc functions 674 * Will not be re-entered while running but other ldisc functions
690 * may be called in parallel. 675 * may be called in parallel.
@@ -773,7 +758,6 @@ static struct tty_ldisc_ops gigaset_ldisc = {
773 .read = gigaset_tty_read, 758 .read = gigaset_tty_read,
774 .write = gigaset_tty_write, 759 .write = gigaset_tty_write,
775 .ioctl = gigaset_tty_ioctl, 760 .ioctl = gigaset_tty_ioctl,
776 .poll = gigaset_tty_poll,
777 .receive_buf = gigaset_tty_receive, 761 .receive_buf = gigaset_tty_receive,
778 .write_wakeup = gigaset_tty_wakeup, 762 .write_wakeup = gigaset_tty_wakeup,
779}; 763};
@@ -788,7 +772,7 @@ static int __init ser_gigaset_init(void)
788 772
789 gig_dbg(DEBUG_INIT, "%s", __func__); 773 gig_dbg(DEBUG_INIT, "%s", __func__);
790 if ((rc = platform_driver_register(&device_driver)) != 0) { 774 if ((rc = platform_driver_register(&device_driver)) != 0) {
791 err("error %d registering platform driver", rc); 775 pr_err("error %d registering platform driver\n", rc);
792 return rc; 776 return rc;
793 } 777 }
794 778
@@ -799,7 +783,7 @@ static int __init ser_gigaset_init(void)
799 goto error; 783 goto error;
800 784
801 if ((rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc)) != 0) { 785 if ((rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc)) != 0) {
802 err("error %d registering line discipline", rc); 786 pr_err("error %d registering line discipline\n", rc);
803 goto error; 787 goto error;
804 } 788 }
805 789
@@ -826,7 +810,7 @@ static void __exit ser_gigaset_exit(void)
826 } 810 }
827 811
828 if ((rc = tty_unregister_ldisc(N_GIGASET_M101)) != 0) 812 if ((rc = tty_unregister_ldisc(N_GIGASET_M101)) != 0)
829 err("error %d unregistering line discipline", rc); 813 pr_err("error %d unregistering line discipline\n", rc);
830 814
831 platform_driver_unregister(&device_driver); 815 platform_driver_unregister(&device_driver);
832} 816}
diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
index 4661830a49db..fba61f670527 100644
--- a/drivers/isdn/gigaset/usb-gigaset.c
+++ b/drivers/isdn/gigaset/usb-gigaset.c
@@ -407,7 +407,7 @@ static void gigaset_read_int_callback(struct urb *urb)
407 spin_lock_irqsave(&cs->lock, flags); 407 spin_lock_irqsave(&cs->lock, flags);
408 if (!cs->connected) { 408 if (!cs->connected) {
409 spin_unlock_irqrestore(&cs->lock, flags); 409 spin_unlock_irqrestore(&cs->lock, flags);
410 err("%s: disconnected", __func__); 410 pr_err("%s: disconnected\n", __func__);
411 return; 411 return;
412 } 412 }
413 r = usb_submit_urb(urb, GFP_ATOMIC); 413 r = usb_submit_urb(urb, GFP_ATOMIC);
@@ -440,7 +440,7 @@ static void gigaset_write_bulk_callback(struct urb *urb)
440 440
441 spin_lock_irqsave(&cs->lock, flags); 441 spin_lock_irqsave(&cs->lock, flags);
442 if (!cs->connected) { 442 if (!cs->connected) {
443 err("%s: not connected", __func__); 443 pr_err("%s: disconnected\n", __func__);
444 } else { 444 } else {
445 cs->hw.usb->busy = 0; 445 cs->hw.usb->busy = 0;
446 tasklet_schedule(&cs->write_tasklet); 446 tasklet_schedule(&cs->write_tasklet);
@@ -612,8 +612,10 @@ static int gigaset_initcshw(struct cardstate *cs)
612 612
613 cs->hw.usb = ucs = 613 cs->hw.usb = ucs =
614 kmalloc(sizeof(struct usb_cardstate), GFP_KERNEL); 614 kmalloc(sizeof(struct usb_cardstate), GFP_KERNEL);
615 if (!ucs) 615 if (!ucs) {
616 pr_err("out of memory\n");
616 return 0; 617 return 0;
618 }
617 619
618 ucs->bchars[0] = 0; 620 ucs->bchars[0] = 0;
619 ucs->bchars[1] = 0; 621 ucs->bchars[1] = 0;
@@ -936,13 +938,11 @@ static int __init usb_gigaset_init(void)
936 /* register this driver with the USB subsystem */ 938 /* register this driver with the USB subsystem */
937 result = usb_register(&gigaset_usb_driver); 939 result = usb_register(&gigaset_usb_driver);
938 if (result < 0) { 940 if (result < 0) {
939 err("usb_gigaset: usb_register failed (error %d)", 941 pr_err("error %d registering USB driver\n", -result);
940 -result);
941 goto error; 942 goto error;
942 } 943 }
943 944
944 info(DRIVER_AUTHOR); 945 pr_info(DRIVER_DESC "\n");
945 info(DRIVER_DESC);
946 return 0; 946 return 0;
947 947
948error: 948error:
diff --git a/drivers/isdn/hardware/eicon/di.c b/drivers/isdn/hardware/eicon/di.c
index 10760b3c5eb5..b029d130eb21 100644
--- a/drivers/isdn/hardware/eicon/di.c
+++ b/drivers/isdn/hardware/eicon/di.c
@@ -353,13 +353,13 @@ void scom_clear_int(ADAPTER * a)
353/*------------------------------------------------------------------*/ 353/*------------------------------------------------------------------*/
354/* return code handler */ 354/* return code handler */
355/*------------------------------------------------------------------*/ 355/*------------------------------------------------------------------*/
356byte isdn_rc(ADAPTER * a, 356static byte isdn_rc(ADAPTER *a,
357 byte Rc, 357 byte Rc,
358 byte Id, 358 byte Id,
359 byte Ch, 359 byte Ch,
360 word Ref, 360 word Ref,
361 dword extended_info_type, 361 dword extended_info_type,
362 dword extended_info) 362 dword extended_info)
363{ 363{
364 ENTITY * this; 364 ENTITY * this;
365 byte e_no; 365 byte e_no;
@@ -555,13 +555,13 @@ byte isdn_rc(ADAPTER * a,
555/*------------------------------------------------------------------*/ 555/*------------------------------------------------------------------*/
556/* indication handler */ 556/* indication handler */
557/*------------------------------------------------------------------*/ 557/*------------------------------------------------------------------*/
558byte isdn_ind(ADAPTER * a, 558static byte isdn_ind(ADAPTER *a,
559 byte Ind, 559 byte Ind,
560 byte Id, 560 byte Id,
561 byte Ch, 561 byte Ch,
562 PBUFFER * RBuffer, 562 PBUFFER *RBuffer,
563 byte MInd, 563 byte MInd,
564 word MLength) 564 word MLength)
565{ 565{
566 ENTITY * this; 566 ENTITY * this;
567 word clength; 567 word clength;
diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c
index 599fed88222d..4cc94f200b72 100644
--- a/drivers/isdn/hardware/eicon/message.c
+++ b/drivers/isdn/hardware/eicon/message.c
@@ -592,7 +592,7 @@ word api_put(APPL * appl, CAPI_MSG * msg)
592/* api_parse function, check the format of api messages */ 592/* api_parse function, check the format of api messages */
593/*------------------------------------------------------------------*/ 593/*------------------------------------------------------------------*/
594 594
595word api_parse(byte * msg, word length, byte * format, API_PARSE * parms) 595static word api_parse(byte *msg, word length, byte *format, API_PARSE *parms)
596{ 596{
597 word i; 597 word i;
598 word p; 598 word p;
@@ -631,7 +631,7 @@ word api_parse(byte * msg, word length, byte * format, API_PARSE * parms)
631 return false; 631 return false;
632} 632}
633 633
634void api_save_msg(API_PARSE *in, byte *format, API_SAVE *out) 634static void api_save_msg(API_PARSE *in, byte *format, API_SAVE *out)
635{ 635{
636 word i, j, n = 0; 636 word i, j, n = 0;
637 byte *p; 637 byte *p;
@@ -663,7 +663,7 @@ void api_save_msg(API_PARSE *in, byte *format, API_SAVE *out)
663 out->parms[i].length = 0; 663 out->parms[i].length = 0;
664} 664}
665 665
666void api_load_msg(API_SAVE *in, API_PARSE *out) 666static void api_load_msg(API_SAVE *in, API_PARSE *out)
667{ 667{
668 word i; 668 word i;
669 669
@@ -3414,7 +3414,8 @@ byte select_b_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci,
3414 return false; 3414 return false;
3415} 3415}
3416 3416
3417byte manufacturer_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) 3417static byte manufacturer_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
3418 PLCI *plci, APPL *appl, API_PARSE *parms)
3418{ 3419{
3419 word command; 3420 word command;
3420 word i; 3421 word i;
@@ -3742,7 +3743,8 @@ byte manufacturer_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * p
3742} 3743}
3743 3744
3744 3745
3745byte manufacturer_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) 3746static byte manufacturer_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
3747 PLCI *plci, APPL *appl, API_PARSE *msg)
3746{ 3748{
3747 word indication; 3749 word indication;
3748 3750
@@ -4074,7 +4076,8 @@ capi_callback_suffix:
4074} 4076}
4075 4077
4076 4078
4077void control_rc(PLCI * plci, byte req, byte rc, byte ch, byte global_req, byte nl_rc) 4079static void control_rc(PLCI *plci, byte req, byte rc, byte ch, byte global_req,
4080 byte nl_rc)
4078{ 4081{
4079 dword Id; 4082 dword Id;
4080 dword rId; 4083 dword rId;
@@ -4740,7 +4743,7 @@ void control_rc(PLCI * plci, byte req, byte rc, byte ch, byte global_req, byte
4740 } 4743 }
4741} 4744}
4742 4745
4743void data_rc(PLCI * plci, byte ch) 4746static void data_rc(PLCI *plci, byte ch)
4744{ 4747{
4745 dword Id; 4748 dword Id;
4746 DIVA_CAPI_ADAPTER * a; 4749 DIVA_CAPI_ADAPTER * a;
@@ -4776,7 +4779,7 @@ void data_rc(PLCI * plci, byte ch)
4776 } 4779 }
4777} 4780}
4778 4781
4779void data_ack(PLCI * plci, byte ch) 4782static void data_ack(PLCI *plci, byte ch)
4780{ 4783{
4781 dword Id; 4784 dword Id;
4782 DIVA_CAPI_ADAPTER * a; 4785 DIVA_CAPI_ADAPTER * a;
@@ -4802,7 +4805,7 @@ void data_ack(PLCI * plci, byte ch)
4802 } 4805 }
4803} 4806}
4804 4807
4805void sig_ind(PLCI * plci) 4808static void sig_ind(PLCI *plci)
4806{ 4809{
4807 dword x_Id; 4810 dword x_Id;
4808 dword Id; 4811 dword Id;
@@ -6170,7 +6173,7 @@ static void SendSetupInfo(APPL * appl, PLCI * plci, dword Id, byte * * par
6170} 6173}
6171 6174
6172 6175
6173void SendInfo(PLCI * plci, dword Id, byte * * parms, byte iesent) 6176static void SendInfo(PLCI *plci, dword Id, byte **parms, byte iesent)
6174{ 6177{
6175 word i; 6178 word i;
6176 word j; 6179 word j;
@@ -6346,7 +6349,8 @@ void SendInfo(PLCI * plci, dword Id, byte * * parms, byte iesent)
6346} 6349}
6347 6350
6348 6351
6349byte SendMultiIE(PLCI * plci, dword Id, byte * * parms, byte ie_type, dword info_mask, byte setupParse) 6352static byte SendMultiIE(PLCI *plci, dword Id, byte **parms, byte ie_type,
6353 dword info_mask, byte setupParse)
6350{ 6354{
6351 word i; 6355 word i;
6352 word j; 6356 word j;
@@ -6465,7 +6469,7 @@ static void SendSSExtInd(APPL * appl, PLCI * plci, dword Id, byte * * parm
6465 } 6469 }
6466}; 6470};
6467 6471
6468void nl_ind(PLCI * plci) 6472static void nl_ind(PLCI *plci)
6469{ 6473{
6470 byte ch; 6474 byte ch;
6471 word ncci; 6475 word ncci;
@@ -7247,7 +7251,7 @@ void nl_ind(PLCI * plci)
7247/* find a free PLCI */ 7251/* find a free PLCI */
7248/*------------------------------------------------------------------*/ 7252/*------------------------------------------------------------------*/
7249 7253
7250word get_plci(DIVA_CAPI_ADAPTER * a) 7254static word get_plci(DIVA_CAPI_ADAPTER *a)
7251{ 7255{
7252 word i,j; 7256 word i,j;
7253 PLCI * plci; 7257 PLCI * plci;
@@ -7406,7 +7410,7 @@ static void add_ie(PLCI * plci, byte code, byte * p, word p_length)
7406/* put a unstructured data into the buffer */ 7410/* put a unstructured data into the buffer */
7407/*------------------------------------------------------------------*/ 7411/*------------------------------------------------------------------*/
7408 7412
7409void add_d(PLCI * plci, word length, byte * p) 7413static void add_d(PLCI *plci, word length, byte *p)
7410{ 7414{
7411 word i; 7415 word i;
7412 7416
@@ -7424,7 +7428,7 @@ void add_d(PLCI * plci, word length, byte * p)
7424/* parameter buffer */ 7428/* parameter buffer */
7425/*------------------------------------------------------------------*/ 7429/*------------------------------------------------------------------*/
7426 7430
7427void add_ai(PLCI * plci, API_PARSE * ai) 7431static void add_ai(PLCI *plci, API_PARSE *ai)
7428{ 7432{
7429 word i; 7433 word i;
7430 API_PARSE ai_parms[5]; 7434 API_PARSE ai_parms[5];
@@ -7445,7 +7449,8 @@ void add_ai(PLCI * plci, API_PARSE * ai)
7445/* put parameter for b1 protocol in the parameter buffer */ 7449/* put parameter for b1 protocol in the parameter buffer */
7446/*------------------------------------------------------------------*/ 7450/*------------------------------------------------------------------*/
7447 7451
7448word add_b1(PLCI * plci, API_PARSE * bp, word b_channel_info, word b1_facilities) 7452static word add_b1(PLCI *plci, API_PARSE *bp, word b_channel_info,
7453 word b1_facilities)
7449{ 7454{
7450 API_PARSE bp_parms[8]; 7455 API_PARSE bp_parms[8];
7451 API_PARSE mdm_cfg[9]; 7456 API_PARSE mdm_cfg[9];
@@ -7909,7 +7914,7 @@ word add_b1(PLCI * plci, API_PARSE * bp, word b_channel_info, word b1_faciliti
7909/* put parameter for b2 and B3 protocol in the parameter buffer */ 7914/* put parameter for b2 and B3 protocol in the parameter buffer */
7910/*------------------------------------------------------------------*/ 7915/*------------------------------------------------------------------*/
7911 7916
7912word add_b23(PLCI * plci, API_PARSE * bp) 7917static word add_b23(PLCI *plci, API_PARSE *bp)
7913{ 7918{
7914 word i, fax_control_bits; 7919 word i, fax_control_bits;
7915 byte pos, len; 7920 byte pos, len;
@@ -8706,7 +8711,7 @@ void sig_req(PLCI * plci, byte req, byte Id)
8706/* send a request for the network layer entity */ 8711/* send a request for the network layer entity */
8707/*------------------------------------------------------------------*/ 8712/*------------------------------------------------------------------*/
8708 8713
8709void nl_req_ncci(PLCI * plci, byte req, byte ncci) 8714static void nl_req_ncci(PLCI *plci, byte req, byte ncci)
8710{ 8715{
8711 if(!plci) return; 8716 if(!plci) return;
8712 if(plci->adapter->adapter_disabled) return; 8717 if(plci->adapter->adapter_disabled) return;
@@ -8728,7 +8733,7 @@ void nl_req_ncci(PLCI * plci, byte req, byte ncci)
8728 plci->req_in_start = plci->req_in; 8733 plci->req_in_start = plci->req_in;
8729} 8734}
8730 8735
8731void send_req(PLCI * plci) 8736static void send_req(PLCI *plci)
8732{ 8737{
8733 ENTITY * e; 8738 ENTITY * e;
8734 word l; 8739 word l;
@@ -8863,7 +8868,7 @@ void send_data(PLCI * plci)
8863 } 8868 }
8864} 8869}
8865 8870
8866void listen_check(DIVA_CAPI_ADAPTER * a) 8871static void listen_check(DIVA_CAPI_ADAPTER *a)
8867{ 8872{
8868 word i,j; 8873 word i,j;
8869 PLCI * plci; 8874 PLCI * plci;
@@ -8906,7 +8911,7 @@ void listen_check(DIVA_CAPI_ADAPTER * a)
8906/* functions for all parameters sent in INDs */ 8911/* functions for all parameters sent in INDs */
8907/*------------------------------------------------------------------*/ 8912/*------------------------------------------------------------------*/
8908 8913
8909void IndParse(PLCI * plci, word * parms_id, byte ** parms, byte multiIEsize) 8914static void IndParse(PLCI *plci, word *parms_id, byte **parms, byte multiIEsize)
8910{ 8915{
8911 word ploc; /* points to current location within packet */ 8916 word ploc; /* points to current location within packet */
8912 byte w; 8917 byte w;
@@ -8991,7 +8996,7 @@ void IndParse(PLCI * plci, word * parms_id, byte ** parms, byte multiIEsize)
8991/* try to match a cip from received BC and HLC */ 8996/* try to match a cip from received BC and HLC */
8992/*------------------------------------------------------------------*/ 8997/*------------------------------------------------------------------*/
8993 8998
8994byte ie_compare(byte * ie1, byte * ie2) 8999static byte ie_compare(byte *ie1, byte *ie2)
8995{ 9000{
8996 word i; 9001 word i;
8997 if(!ie1 || ! ie2) return false; 9002 if(!ie1 || ! ie2) return false;
@@ -9000,7 +9005,7 @@ byte ie_compare(byte * ie1, byte * ie2)
9000 return true; 9005 return true;
9001} 9006}
9002 9007
9003word find_cip(DIVA_CAPI_ADAPTER * a, byte * bc, byte * hlc) 9008static word find_cip(DIVA_CAPI_ADAPTER *a, byte *bc, byte *hlc)
9004{ 9009{
9005 word i; 9010 word i;
9006 word j; 9011 word j;
@@ -9068,7 +9073,7 @@ static byte AddInfo(byte **add_i,
9068/* voice and codec features */ 9073/* voice and codec features */
9069/*------------------------------------------------------------------*/ 9074/*------------------------------------------------------------------*/
9070 9075
9071void SetVoiceChannel(PLCI *plci, byte *chi, DIVA_CAPI_ADAPTER * a) 9076static void SetVoiceChannel(PLCI *plci, byte *chi, DIVA_CAPI_ADAPTER *a)
9072{ 9077{
9073 byte voice_chi[] = "\x02\x18\x01"; 9078 byte voice_chi[] = "\x02\x18\x01";
9074 byte channel; 9079 byte channel;
@@ -9086,7 +9091,7 @@ void SetVoiceChannel(PLCI *plci, byte *chi, DIVA_CAPI_ADAPTER * a)
9086 } 9091 }
9087} 9092}
9088 9093
9089void VoiceChannelOff(PLCI *plci) 9094static void VoiceChannelOff(PLCI *plci)
9090{ 9095{
9091 dbug(1,dprintf("ExtDevOFF")); 9096 dbug(1,dprintf("ExtDevOFF"));
9092 add_p(plci,FTY,"\x02\x01\x08"); /* B Off */ 9097 add_p(plci,FTY,"\x02\x01\x08"); /* B Off */
@@ -9099,7 +9104,8 @@ void VoiceChannelOff(PLCI *plci)
9099} 9104}
9100 9105
9101 9106
9102word AdvCodecSupport(DIVA_CAPI_ADAPTER *a, PLCI *plci, APPL *appl, byte hook_listen) 9107static word AdvCodecSupport(DIVA_CAPI_ADAPTER *a, PLCI *plci, APPL *appl,
9108 byte hook_listen)
9103{ 9109{
9104 word j; 9110 word j;
9105 PLCI *splci; 9111 PLCI *splci;
@@ -9195,7 +9201,7 @@ word AdvCodecSupport(DIVA_CAPI_ADAPTER *a, PLCI *plci, APPL *appl, byte ho
9195} 9201}
9196 9202
9197 9203
9198void CodecIdCheck(DIVA_CAPI_ADAPTER *a, PLCI *plci) 9204static void CodecIdCheck(DIVA_CAPI_ADAPTER *a, PLCI *plci)
9199{ 9205{
9200 9206
9201 dbug(1,dprintf("CodecIdCheck")); 9207 dbug(1,dprintf("CodecIdCheck"));
diff --git a/drivers/isdn/hardware/mISDN/hfc_multi.h b/drivers/isdn/hardware/mISDN/hfc_multi.h
index a33d87afc843..7bbf7300593d 100644
--- a/drivers/isdn/hardware/mISDN/hfc_multi.h
+++ b/drivers/isdn/hardware/mISDN/hfc_multi.h
@@ -162,8 +162,8 @@ struct hfc_multi {
162 void (*write_fifo)(struct hfc_multi *hc, u_char *data, 162 void (*write_fifo)(struct hfc_multi *hc, u_char *data,
163 int len); 163 int len);
164 u_long pci_origmembase, plx_origmembase, dsp_origmembase; 164 u_long pci_origmembase, plx_origmembase, dsp_origmembase;
165 u_char *pci_membase; /* PCI memory (MUST BE BYTE POINTER) */ 165 void __iomem *pci_membase; /* PCI memory */
166 u_char *plx_membase; /* PLX memory */ 166 void __iomem *plx_membase; /* PLX memory */
167 u_char *dsp_membase; /* DSP on PLX */ 167 u_char *dsp_membase; /* DSP on PLX */
168 u_long pci_iobase; /* PCI IO */ 168 u_long pci_iobase; /* PCI IO */
169 struct hfcm_hw hw; /* remember data of write-only-registers */ 169 struct hfcm_hw hw; /* remember data of write-only-registers */
diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c
index 1eac03f39d00..c63e2f49da8a 100644
--- a/drivers/isdn/hardware/mISDN/hfcmulti.c
+++ b/drivers/isdn/hardware/mISDN/hfcmulti.c
@@ -171,9 +171,8 @@ static int (*unregister_interrupt)(void);
171static int interrupt_registered; 171static int interrupt_registered;
172 172
173static struct hfc_multi *syncmaster; 173static struct hfc_multi *syncmaster;
174int plxsd_master; /* if we have a master card (yet) */ 174static int plxsd_master; /* if we have a master card (yet) */
175static spinlock_t plx_lock; /* may not acquire other lock inside */ 175static spinlock_t plx_lock; /* may not acquire other lock inside */
176EXPORT_SYMBOL(plx_lock);
177 176
178#define TYP_E1 1 177#define TYP_E1 1
179#define TYP_4S 4 178#define TYP_4S 4
@@ -422,7 +421,7 @@ HFC_wait_debug(struct hfc_multi *hc, const char *function, int line)
422#endif 421#endif
423 422
424/* write fifo data (REGIO) */ 423/* write fifo data (REGIO) */
425void 424static void
426write_fifo_regio(struct hfc_multi *hc, u_char *data, int len) 425write_fifo_regio(struct hfc_multi *hc, u_char *data, int len)
427{ 426{
428 outb(A_FIFO_DATA0, (hc->pci_iobase)+4); 427 outb(A_FIFO_DATA0, (hc->pci_iobase)+4);
@@ -443,7 +442,7 @@ write_fifo_regio(struct hfc_multi *hc, u_char *data, int len)
443 } 442 }
444} 443}
445/* write fifo data (PCIMEM) */ 444/* write fifo data (PCIMEM) */
446void 445static void
447write_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len) 446write_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len)
448{ 447{
449 while (len>>2) { 448 while (len>>2) {
@@ -465,7 +464,7 @@ write_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len)
465 } 464 }
466} 465}
467/* read fifo data (REGIO) */ 466/* read fifo data (REGIO) */
468void 467static void
469read_fifo_regio(struct hfc_multi *hc, u_char *data, int len) 468read_fifo_regio(struct hfc_multi *hc, u_char *data, int len)
470{ 469{
471 outb(A_FIFO_DATA0, (hc->pci_iobase)+4); 470 outb(A_FIFO_DATA0, (hc->pci_iobase)+4);
@@ -487,7 +486,7 @@ read_fifo_regio(struct hfc_multi *hc, u_char *data, int len)
487} 486}
488 487
489/* read fifo data (PCIMEM) */ 488/* read fifo data (PCIMEM) */
490void 489static void
491read_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len) 490read_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len)
492{ 491{
493 while (len>>2) { 492 while (len>>2) {
@@ -706,7 +705,7 @@ vpm_out(struct hfc_multi *c, int which, unsigned short addr,
706} 705}
707 706
708 707
709void 708static void
710vpm_init(struct hfc_multi *wc) 709vpm_init(struct hfc_multi *wc)
711{ 710{
712 unsigned char reg; 711 unsigned char reg;
@@ -789,7 +788,8 @@ vpm_init(struct hfc_multi *wc)
789 } 788 }
790} 789}
791 790
792void 791#ifdef UNUSED
792static void
793vpm_check(struct hfc_multi *hctmp) 793vpm_check(struct hfc_multi *hctmp)
794{ 794{
795 unsigned char gpi2; 795 unsigned char gpi2;
@@ -799,6 +799,7 @@ vpm_check(struct hfc_multi *hctmp)
799 if ((gpi2 & 0x3) != 0x3) 799 if ((gpi2 & 0x3) != 0x3)
800 printk(KERN_DEBUG "Got interrupt 0x%x from VPM!\n", gpi2); 800 printk(KERN_DEBUG "Got interrupt 0x%x from VPM!\n", gpi2);
801} 801}
802#endif /* UNUSED */
802 803
803 804
804/* 805/*
@@ -812,7 +813,7 @@ vpm_check(struct hfc_multi *hctmp)
812 * 813 *
813 */ 814 */
814 815
815void 816static void
816vpm_echocan_on(struct hfc_multi *hc, int ch, int taps) 817vpm_echocan_on(struct hfc_multi *hc, int ch, int taps)
817{ 818{
818 unsigned int timeslot; 819 unsigned int timeslot;
@@ -844,7 +845,7 @@ vpm_echocan_on(struct hfc_multi *hc, int ch, int taps)
844 vpm_out(hc, unit, timeslot, 0x7e); 845 vpm_out(hc, unit, timeslot, 0x7e);
845} 846}
846 847
847void 848static void
848vpm_echocan_off(struct hfc_multi *hc, int ch) 849vpm_echocan_off(struct hfc_multi *hc, int ch)
849{ 850{
850 unsigned int timeslot; 851 unsigned int timeslot;
@@ -887,8 +888,9 @@ vpm_echocan_off(struct hfc_multi *hc, int ch)
887static inline void 888static inline void
888hfcmulti_resync(struct hfc_multi *locked, struct hfc_multi *newmaster, int rm) 889hfcmulti_resync(struct hfc_multi *locked, struct hfc_multi *newmaster, int rm)
889{ 890{
890 struct hfc_multi *hc, *next, *pcmmaster = 0; 891 struct hfc_multi *hc, *next, *pcmmaster = NULL;
891 u_int *plx_acc_32, pv; 892 void __iomem *plx_acc_32;
893 u_int pv;
892 u_long flags; 894 u_long flags;
893 895
894 spin_lock_irqsave(&HFClock, flags); 896 spin_lock_irqsave(&HFClock, flags);
@@ -916,7 +918,7 @@ hfcmulti_resync(struct hfc_multi *locked, struct hfc_multi *newmaster, int rm)
916 /* Disable sync of all cards */ 918 /* Disable sync of all cards */
917 list_for_each_entry_safe(hc, next, &HFClist, list) { 919 list_for_each_entry_safe(hc, next, &HFClist, list) {
918 if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) { 920 if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) {
919 plx_acc_32 = (u_int *)(hc->plx_membase+PLX_GPIOC); 921 plx_acc_32 = hc->plx_membase + PLX_GPIOC;
920 pv = readl(plx_acc_32); 922 pv = readl(plx_acc_32);
921 pv &= ~PLX_SYNC_O_EN; 923 pv &= ~PLX_SYNC_O_EN;
922 writel(pv, plx_acc_32); 924 writel(pv, plx_acc_32);
@@ -938,7 +940,7 @@ hfcmulti_resync(struct hfc_multi *locked, struct hfc_multi *newmaster, int rm)
938 printk(KERN_DEBUG "id=%d (0x%p) = syncronized with " 940 printk(KERN_DEBUG "id=%d (0x%p) = syncronized with "
939 "interface.\n", hc->id, hc); 941 "interface.\n", hc->id, hc);
940 /* Enable new sync master */ 942 /* Enable new sync master */
941 plx_acc_32 = (u_int *)(hc->plx_membase+PLX_GPIOC); 943 plx_acc_32 = hc->plx_membase + PLX_GPIOC;
942 pv = readl(plx_acc_32); 944 pv = readl(plx_acc_32);
943 pv |= PLX_SYNC_O_EN; 945 pv |= PLX_SYNC_O_EN;
944 writel(pv, plx_acc_32); 946 writel(pv, plx_acc_32);
@@ -968,7 +970,7 @@ hfcmulti_resync(struct hfc_multi *locked, struct hfc_multi *newmaster, int rm)
968 "QUARTZ is automatically " 970 "QUARTZ is automatically "
969 "enabled by HFC-%dS\n", hc->type); 971 "enabled by HFC-%dS\n", hc->type);
970 } 972 }
971 plx_acc_32 = (u_int *)(hc->plx_membase+PLX_GPIOC); 973 plx_acc_32 = hc->plx_membase + PLX_GPIOC;
972 pv = readl(plx_acc_32); 974 pv = readl(plx_acc_32);
973 pv |= PLX_SYNC_O_EN; 975 pv |= PLX_SYNC_O_EN;
974 writel(pv, plx_acc_32); 976 writel(pv, plx_acc_32);
@@ -1013,7 +1015,8 @@ plxsd_checksync(struct hfc_multi *hc, int rm)
1013static void 1015static void
1014release_io_hfcmulti(struct hfc_multi *hc) 1016release_io_hfcmulti(struct hfc_multi *hc)
1015{ 1017{
1016 u_int *plx_acc_32, pv; 1018 void __iomem *plx_acc_32;
1019 u_int pv;
1017 u_long plx_flags; 1020 u_long plx_flags;
1018 1021
1019 if (debug & DEBUG_HFCMULTI_INIT) 1022 if (debug & DEBUG_HFCMULTI_INIT)
@@ -1033,7 +1036,7 @@ release_io_hfcmulti(struct hfc_multi *hc)
1033 printk(KERN_DEBUG "%s: release PLXSD card %d\n", 1036 printk(KERN_DEBUG "%s: release PLXSD card %d\n",
1034 __func__, hc->id + 1); 1037 __func__, hc->id + 1);
1035 spin_lock_irqsave(&plx_lock, plx_flags); 1038 spin_lock_irqsave(&plx_lock, plx_flags);
1036 plx_acc_32 = (u_int *)(hc->plx_membase+PLX_GPIOC); 1039 plx_acc_32 = hc->plx_membase + PLX_GPIOC;
1037 writel(PLX_GPIOC_INIT, plx_acc_32); 1040 writel(PLX_GPIOC_INIT, plx_acc_32);
1038 pv = readl(plx_acc_32); 1041 pv = readl(plx_acc_32);
1039 /* Termination off */ 1042 /* Termination off */
@@ -1055,9 +1058,9 @@ release_io_hfcmulti(struct hfc_multi *hc)
1055 test_and_clear_bit(HFC_CHIP_PLXSD, &hc->chip); /* prevent resync */ 1058 test_and_clear_bit(HFC_CHIP_PLXSD, &hc->chip); /* prevent resync */
1056 pci_write_config_word(hc->pci_dev, PCI_COMMAND, 0); 1059 pci_write_config_word(hc->pci_dev, PCI_COMMAND, 0);
1057 if (hc->pci_membase) 1060 if (hc->pci_membase)
1058 iounmap((void *)hc->pci_membase); 1061 iounmap(hc->pci_membase);
1059 if (hc->plx_membase) 1062 if (hc->plx_membase)
1060 iounmap((void *)hc->plx_membase); 1063 iounmap(hc->plx_membase);
1061 if (hc->pci_iobase) 1064 if (hc->pci_iobase)
1062 release_region(hc->pci_iobase, 8); 1065 release_region(hc->pci_iobase, 8);
1063 1066
@@ -1080,7 +1083,8 @@ init_chip(struct hfc_multi *hc)
1080 u_long flags, val, val2 = 0, rev; 1083 u_long flags, val, val2 = 0, rev;
1081 int i, err = 0; 1084 int i, err = 0;
1082 u_char r_conf_en, rval; 1085 u_char r_conf_en, rval;
1083 u_int *plx_acc_32, pv; 1086 void __iomem *plx_acc_32;
1087 u_int pv;
1084 u_long plx_flags, hfc_flags; 1088 u_long plx_flags, hfc_flags;
1085 int plx_count; 1089 int plx_count;
1086 struct hfc_multi *pos, *next, *plx_last_hc; 1090 struct hfc_multi *pos, *next, *plx_last_hc;
@@ -1154,7 +1158,7 @@ init_chip(struct hfc_multi *hc)
1154 printk(KERN_DEBUG "%s: initializing PLXSD card %d\n", 1158 printk(KERN_DEBUG "%s: initializing PLXSD card %d\n",
1155 __func__, hc->id + 1); 1159 __func__, hc->id + 1);
1156 spin_lock_irqsave(&plx_lock, plx_flags); 1160 spin_lock_irqsave(&plx_lock, plx_flags);
1157 plx_acc_32 = (u_int *)(hc->plx_membase+PLX_GPIOC); 1161 plx_acc_32 = hc->plx_membase + PLX_GPIOC;
1158 writel(PLX_GPIOC_INIT, plx_acc_32); 1162 writel(PLX_GPIOC_INIT, plx_acc_32);
1159 pv = readl(plx_acc_32); 1163 pv = readl(plx_acc_32);
1160 /* The first and the last cards are terminating the PCM bus */ 1164 /* The first and the last cards are terminating the PCM bus */
@@ -1190,8 +1194,7 @@ init_chip(struct hfc_multi *hc)
1190 "we disable termination\n", 1194 "we disable termination\n",
1191 __func__, plx_last_hc->id + 1); 1195 __func__, plx_last_hc->id + 1);
1192 spin_lock_irqsave(&plx_lock, plx_flags); 1196 spin_lock_irqsave(&plx_lock, plx_flags);
1193 plx_acc_32 = (u_int *)(plx_last_hc->plx_membase 1197 plx_acc_32 = plx_last_hc->plx_membase + PLX_GPIOC;
1194 + PLX_GPIOC);
1195 pv = readl(plx_acc_32); 1198 pv = readl(plx_acc_32);
1196 pv &= ~PLX_TERM_ON; 1199 pv &= ~PLX_TERM_ON;
1197 writel(pv, plx_acc_32); 1200 writel(pv, plx_acc_32);
@@ -1240,7 +1243,7 @@ init_chip(struct hfc_multi *hc)
1240 /* Speech Design PLX bridge pcm and sync mode */ 1243 /* Speech Design PLX bridge pcm and sync mode */
1241 if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) { 1244 if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) {
1242 spin_lock_irqsave(&plx_lock, plx_flags); 1245 spin_lock_irqsave(&plx_lock, plx_flags);
1243 plx_acc_32 = (u_int *)(hc->plx_membase+PLX_GPIOC); 1246 plx_acc_32 = hc->plx_membase + PLX_GPIOC;
1244 pv = readl(plx_acc_32); 1247 pv = readl(plx_acc_32);
1245 /* Connect PCM */ 1248 /* Connect PCM */
1246 if (hc->hw.r_pcm_md0 & V_PCM_MD) { 1249 if (hc->hw.r_pcm_md0 & V_PCM_MD) {
@@ -1352,8 +1355,7 @@ controller_fail:
1352 /* retry with master clock */ 1355 /* retry with master clock */
1353 if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) { 1356 if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) {
1354 spin_lock_irqsave(&plx_lock, plx_flags); 1357 spin_lock_irqsave(&plx_lock, plx_flags);
1355 plx_acc_32 = (u_int *)(hc->plx_membase + 1358 plx_acc_32 = hc->plx_membase + PLX_GPIOC;
1356 PLX_GPIOC);
1357 pv = readl(plx_acc_32); 1359 pv = readl(plx_acc_32);
1358 pv |= PLX_MASTER_EN | PLX_SLAVE_EN_N; 1360 pv |= PLX_MASTER_EN | PLX_SLAVE_EN_N;
1359 pv |= PLX_SYNC_O_EN; 1361 pv |= PLX_SYNC_O_EN;
@@ -1389,7 +1391,7 @@ controller_fail:
1389 if (test_bit(HFC_CHIP_PCM_MASTER, &hc->chip)) 1391 if (test_bit(HFC_CHIP_PCM_MASTER, &hc->chip))
1390 plxsd_master = 1; 1392 plxsd_master = 1;
1391 spin_lock_irqsave(&plx_lock, plx_flags); 1393 spin_lock_irqsave(&plx_lock, plx_flags);
1392 plx_acc_32 = (u_int *)(hc->plx_membase+PLX_GPIOC); 1394 plx_acc_32 = hc->plx_membase + PLX_GPIOC;
1393 pv = readl(plx_acc_32); 1395 pv = readl(plx_acc_32);
1394 pv |= PLX_DSP_RES_N; 1396 pv |= PLX_DSP_RES_N;
1395 writel(pv, plx_acc_32); 1397 writel(pv, plx_acc_32);
@@ -2586,7 +2588,8 @@ hfcmulti_interrupt(int intno, void *dev_id)
2586 struct dchannel *dch; 2588 struct dchannel *dch;
2587 u_char r_irq_statech, status, r_irq_misc, r_irq_oview; 2589 u_char r_irq_statech, status, r_irq_misc, r_irq_oview;
2588 int i; 2590 int i;
2589 u_short *plx_acc, wval; 2591 void __iomem *plx_acc;
2592 u_short wval;
2590 u_char e1_syncsta, temp; 2593 u_char e1_syncsta, temp;
2591 u_long flags; 2594 u_long flags;
2592 2595
@@ -2606,7 +2609,7 @@ hfcmulti_interrupt(int intno, void *dev_id)
2606 2609
2607 if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) { 2610 if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) {
2608 spin_lock_irqsave(&plx_lock, flags); 2611 spin_lock_irqsave(&plx_lock, flags);
2609 plx_acc = (u_short *)(hc->plx_membase + PLX_INTCSR); 2612 plx_acc = hc->plx_membase + PLX_INTCSR;
2610 wval = readw(plx_acc); 2613 wval = readw(plx_acc);
2611 spin_unlock_irqrestore(&plx_lock, flags); 2614 spin_unlock_irqrestore(&plx_lock, flags);
2612 if (!(wval & PLX_INTCSR_LINTI1_STATUS)) 2615 if (!(wval & PLX_INTCSR_LINTI1_STATUS))
@@ -4091,7 +4094,7 @@ init_card(struct hfc_multi *hc)
4091{ 4094{
4092 int err = -EIO; 4095 int err = -EIO;
4093 u_long flags; 4096 u_long flags;
4094 u_short *plx_acc; 4097 void __iomem *plx_acc;
4095 u_long plx_flags; 4098 u_long plx_flags;
4096 4099
4097 if (debug & DEBUG_HFCMULTI_INIT) 4100 if (debug & DEBUG_HFCMULTI_INIT)
@@ -4113,7 +4116,7 @@ init_card(struct hfc_multi *hc)
4113 4116
4114 if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) { 4117 if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) {
4115 spin_lock_irqsave(&plx_lock, plx_flags); 4118 spin_lock_irqsave(&plx_lock, plx_flags);
4116 plx_acc = (u_short *)(hc->plx_membase+PLX_INTCSR); 4119 plx_acc = hc->plx_membase + PLX_INTCSR;
4117 writew((PLX_INTCSR_PCIINT_ENABLE | PLX_INTCSR_LINTI1_ENABLE), 4120 writew((PLX_INTCSR_PCIINT_ENABLE | PLX_INTCSR_LINTI1_ENABLE),
4118 plx_acc); /* enable PCI & LINT1 irq */ 4121 plx_acc); /* enable PCI & LINT1 irq */
4119 spin_unlock_irqrestore(&plx_lock, plx_flags); 4122 spin_unlock_irqrestore(&plx_lock, plx_flags);
@@ -4162,7 +4165,7 @@ init_card(struct hfc_multi *hc)
4162error: 4165error:
4163 if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) { 4166 if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) {
4164 spin_lock_irqsave(&plx_lock, plx_flags); 4167 spin_lock_irqsave(&plx_lock, plx_flags);
4165 plx_acc = (u_short *)(hc->plx_membase+PLX_INTCSR); 4168 plx_acc = hc->plx_membase + PLX_INTCSR;
4166 writew(0x00, plx_acc); /*disable IRQs*/ 4169 writew(0x00, plx_acc); /*disable IRQs*/
4167 spin_unlock_irqrestore(&plx_lock, plx_flags); 4170 spin_unlock_irqrestore(&plx_lock, plx_flags);
4168 } 4171 }
diff --git a/drivers/isdn/hysdn/hysdn_net.c b/drivers/isdn/hysdn/hysdn_net.c
index 3f2a0a20c19b..7ee5bd9f2bb4 100644
--- a/drivers/isdn/hysdn/hysdn_net.c
+++ b/drivers/isdn/hysdn/hysdn_net.c
@@ -76,7 +76,7 @@ static int
76net_open(struct net_device *dev) 76net_open(struct net_device *dev)
77{ 77{
78 struct in_device *in_dev; 78 struct in_device *in_dev;
79 hysdn_card *card = dev->priv; 79 hysdn_card *card = dev->ml_priv;
80 int i; 80 int i;
81 81
82 netif_start_queue(dev); /* start tx-queueing */ 82 netif_start_queue(dev); /* start tx-queueing */
@@ -159,7 +159,7 @@ net_send_packet(struct sk_buff *skb, struct net_device *dev)
159 spin_unlock_irq(&lp->lock); 159 spin_unlock_irq(&lp->lock);
160 160
161 if (lp->sk_count <= 3) { 161 if (lp->sk_count <= 3) {
162 schedule_work(&((hysdn_card *) dev->priv)->irq_queue); 162 schedule_work(&((hysdn_card *) dev->ml_priv)->irq_queue);
163 } 163 }
164 return (0); /* success */ 164 return (0); /* success */
165} /* net_send_packet */ 165} /* net_send_packet */
@@ -295,7 +295,7 @@ hysdn_net_create(hysdn_card * card)
295 kfree(dev); 295 kfree(dev);
296 return (i); 296 return (i);
297 } 297 }
298 dev->priv = card; /* remember pointer to own data structure */ 298 dev->ml_priv = card; /* remember pointer to own data structure */
299 card->netif = dev; /* setup the local pointer */ 299 card->netif = dev; /* setup the local pointer */
300 300
301 if (card->debug_flags & LOG_NET_INIT) 301 if (card->debug_flags & LOG_NET_INIT)
diff --git a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c
index 484299b031f8..8f9f4912de32 100644
--- a/drivers/isdn/hysdn/hysdn_procconf.c
+++ b/drivers/isdn/hysdn/hysdn_procconf.c
@@ -246,7 +246,8 @@ hysdn_conf_open(struct inode *ino, struct file *filep)
246 } 246 }
247 if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL)) 247 if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
248 hysdn_addlog(card, "config open for uid=%d gid=%d mode=0x%x", 248 hysdn_addlog(card, "config open for uid=%d gid=%d mode=0x%x",
249 filep->f_uid, filep->f_gid, filep->f_mode); 249 filep->f_cred->fsuid, filep->f_cred->fsgid,
250 filep->f_mode);
250 251
251 if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) { 252 if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) {
252 /* write only access -> write boot file or conf line */ 253 /* write only access -> write boot file or conf line */
@@ -331,7 +332,8 @@ hysdn_conf_close(struct inode *ino, struct file *filep)
331 } 332 }
332 if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL)) 333 if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
333 hysdn_addlog(card, "config close for uid=%d gid=%d mode=0x%x", 334 hysdn_addlog(card, "config close for uid=%d gid=%d mode=0x%x",
334 filep->f_uid, filep->f_gid, filep->f_mode); 335 filep->f_cred->fsuid, filep->f_cred->fsgid,
336 filep->f_mode);
335 337
336 if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) { 338 if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) {
337 /* write only access -> write boot file or conf line */ 339 /* write only access -> write boot file or conf line */
diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c
index 0193b6f7c70c..46048e55f241 100644
--- a/drivers/isdn/i4l/isdn_concap.c
+++ b/drivers/isdn/i4l/isdn_concap.c
@@ -42,7 +42,7 @@
42static int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb) 42static int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb)
43{ 43{
44 struct net_device *ndev = concap -> net_dev; 44 struct net_device *ndev = concap -> net_dev;
45 isdn_net_dev *nd = ((isdn_net_local *) ndev->priv)->netdev; 45 isdn_net_dev *nd = ((isdn_net_local *) netdev_priv(ndev))->netdev;
46 isdn_net_local *lp = isdn_net_get_locked_lp(nd); 46 isdn_net_local *lp = isdn_net_get_locked_lp(nd);
47 47
48 IX25DEBUG( "isdn_concap_dl_data_req: %s \n", concap->net_dev->name); 48 IX25DEBUG( "isdn_concap_dl_data_req: %s \n", concap->net_dev->name);
@@ -61,7 +61,7 @@ static int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *
61static int isdn_concap_dl_connect_req(struct concap_proto *concap) 61static int isdn_concap_dl_connect_req(struct concap_proto *concap)
62{ 62{
63 struct net_device *ndev = concap -> net_dev; 63 struct net_device *ndev = concap -> net_dev;
64 isdn_net_local *lp = (isdn_net_local *) ndev->priv; 64 isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
65 int ret; 65 int ret;
66 IX25DEBUG( "isdn_concap_dl_connect_req: %s \n", ndev -> name); 66 IX25DEBUG( "isdn_concap_dl_connect_req: %s \n", ndev -> name);
67 67
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index 1bfc55d7a26c..023ea11d2f9e 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -120,7 +120,7 @@ static __inline__ int isdn_net_device_busy(isdn_net_local *lp)
120 return 0; 120 return 0;
121 121
122 if (lp->master) 122 if (lp->master)
123 nd = ((isdn_net_local *) lp->master->priv)->netdev; 123 nd = ISDN_MASTER_PRIV(lp)->netdev;
124 else 124 else
125 nd = lp->netdev; 125 nd = lp->netdev;
126 126
@@ -213,9 +213,9 @@ isdn_net_reset(struct net_device *dev)
213{ 213{
214#ifdef CONFIG_ISDN_X25 214#ifdef CONFIG_ISDN_X25
215 struct concap_device_ops * dops = 215 struct concap_device_ops * dops =
216 ( (isdn_net_local *) dev->priv ) -> dops; 216 ((isdn_net_local *) netdev_priv(dev))->dops;
217 struct concap_proto * cprot = 217 struct concap_proto * cprot =
218 ( (isdn_net_local *) dev->priv ) -> netdev -> cprot; 218 ((isdn_net_local *) netdev_priv(dev))->netdev->cprot;
219#endif 219#endif
220#ifdef CONFIG_ISDN_X25 220#ifdef CONFIG_ISDN_X25
221 if( cprot && cprot -> pops && dops ) 221 if( cprot && cprot -> pops && dops )
@@ -250,11 +250,11 @@ isdn_net_open(struct net_device *dev)
250 } 250 }
251 251
252 /* If this interface has slaves, start them also */ 252 /* If this interface has slaves, start them also */
253 253 p = MASTER_TO_SLAVE(dev);
254 if ((p = (((isdn_net_local *) dev->priv)->slave))) { 254 if (p) {
255 while (p) { 255 while (p) {
256 isdn_net_reset(p); 256 isdn_net_reset(p);
257 p = (((isdn_net_local *) p->priv)->slave); 257 p = MASTER_TO_SLAVE(p);
258 } 258 }
259 } 259 }
260 isdn_lock_drivers(); 260 isdn_lock_drivers();
@@ -483,7 +483,7 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c)
483 isdn_net_ciscohdlck_connected(lp); 483 isdn_net_ciscohdlck_connected(lp);
484 if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP) { 484 if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP) {
485 if (lp->master) { /* is lp a slave? */ 485 if (lp->master) { /* is lp a slave? */
486 isdn_net_dev *nd = ((isdn_net_local *)lp->master->priv)->netdev; 486 isdn_net_dev *nd = ISDN_MASTER_PRIV(lp)->netdev;
487 isdn_net_add_to_bundle(nd, lp); 487 isdn_net_add_to_bundle(nd, lp);
488 } 488 }
489 } 489 }
@@ -823,7 +823,7 @@ isdn_net_dial(void)
823void 823void
824isdn_net_hangup(struct net_device *d) 824isdn_net_hangup(struct net_device *d)
825{ 825{
826 isdn_net_local *lp = (isdn_net_local *) d->priv; 826 isdn_net_local *lp = (isdn_net_local *) netdev_priv(d);
827 isdn_ctrl cmd; 827 isdn_ctrl cmd;
828#ifdef CONFIG_ISDN_X25 828#ifdef CONFIG_ISDN_X25
829 struct concap_proto *cprot = lp->netdev->cprot; 829 struct concap_proto *cprot = lp->netdev->cprot;
@@ -832,7 +832,7 @@ isdn_net_hangup(struct net_device *d)
832 832
833 if (lp->flags & ISDN_NET_CONNECTED) { 833 if (lp->flags & ISDN_NET_CONNECTED) {
834 if (lp->slave != NULL) { 834 if (lp->slave != NULL) {
835 isdn_net_local *slp = (isdn_net_local *)lp->slave->priv; 835 isdn_net_local *slp = ISDN_SLAVE_PRIV(lp);
836 if (slp->flags & ISDN_NET_CONNECTED) { 836 if (slp->flags & ISDN_NET_CONNECTED) {
837 printk(KERN_INFO 837 printk(KERN_INFO
838 "isdn_net: hang up slave %s before %s\n", 838 "isdn_net: hang up slave %s before %s\n",
@@ -865,8 +865,8 @@ isdn_net_hangup(struct net_device *d)
865} 865}
866 866
867typedef struct { 867typedef struct {
868 unsigned short source; 868 __be16 source;
869 unsigned short dest; 869 __be16 dest;
870} ip_ports; 870} ip_ports;
871 871
872static void 872static void
@@ -890,15 +890,15 @@ isdn_net_log_skb(struct sk_buff * skb, isdn_net_local * lp)
890 proto = ETH_P_IP; 890 proto = ETH_P_IP;
891 switch (lp->p_encap) { 891 switch (lp->p_encap) {
892 case ISDN_NET_ENCAP_IPTYP: 892 case ISDN_NET_ENCAP_IPTYP:
893 proto = ntohs(*(unsigned short *) &buf[0]); 893 proto = ntohs(*(__be16 *)&buf[0]);
894 p = &buf[2]; 894 p = &buf[2];
895 break; 895 break;
896 case ISDN_NET_ENCAP_ETHER: 896 case ISDN_NET_ENCAP_ETHER:
897 proto = ntohs(*(unsigned short *) &buf[12]); 897 proto = ntohs(*(__be16 *)&buf[12]);
898 p = &buf[14]; 898 p = &buf[14];
899 break; 899 break;
900 case ISDN_NET_ENCAP_CISCOHDLC: 900 case ISDN_NET_ENCAP_CISCOHDLC:
901 proto = ntohs(*(unsigned short *) &buf[2]); 901 proto = ntohs(*(__be16 *)&buf[2]);
902 p = &buf[4]; 902 p = &buf[4];
903 break; 903 break;
904#ifdef CONFIG_ISDN_PPP 904#ifdef CONFIG_ISDN_PPP
@@ -942,18 +942,12 @@ isdn_net_log_skb(struct sk_buff * skb, isdn_net_local * lp)
942 strcpy(addinfo, " IDP"); 942 strcpy(addinfo, " IDP");
943 break; 943 break;
944 } 944 }
945 printk(KERN_INFO 945 printk(KERN_INFO "OPEN: %pI4 -> %pI4%s\n",
946 "OPEN: %d.%d.%d.%d -> %d.%d.%d.%d%s\n", 946 p + 12, p + 16, addinfo);
947
948 p[12], p[13], p[14], p[15],
949 p[16], p[17], p[18], p[19],
950 addinfo);
951 break; 947 break;
952 case ETH_P_ARP: 948 case ETH_P_ARP:
953 printk(KERN_INFO 949 printk(KERN_INFO "OPEN: ARP %pI4 -> *.*.*.* ?%pI4\n",
954 "OPEN: ARP %d.%d.%d.%d -> *.*.*.* ?%d.%d.%d.%d\n", 950 p + 14, p + 24);
955 p[14], p[15], p[16], p[17],
956 p[24], p[25], p[26], p[27]);
957 break; 951 break;
958 } 952 }
959} 953}
@@ -1054,10 +1048,10 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
1054{ 1048{
1055 isdn_net_dev *nd; 1049 isdn_net_dev *nd;
1056 isdn_net_local *slp; 1050 isdn_net_local *slp;
1057 isdn_net_local *lp = (isdn_net_local *) ndev->priv; 1051 isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
1058 int retv = 0; 1052 int retv = 0;
1059 1053
1060 if (((isdn_net_local *) (ndev->priv))->master) { 1054 if (((isdn_net_local *) netdev_priv(ndev))->master) {
1061 printk("isdn BUG at %s:%d!\n", __FILE__, __LINE__); 1055 printk("isdn BUG at %s:%d!\n", __FILE__, __LINE__);
1062 dev_kfree_skb(skb); 1056 dev_kfree_skb(skb);
1063 return 0; 1057 return 0;
@@ -1069,7 +1063,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
1069 return isdn_ppp_xmit(skb, ndev); 1063 return isdn_ppp_xmit(skb, ndev);
1070 } 1064 }
1071#endif 1065#endif
1072 nd = ((isdn_net_local *) ndev->priv)->netdev; 1066 nd = ((isdn_net_local *) netdev_priv(ndev))->netdev;
1073 lp = isdn_net_get_locked_lp(nd); 1067 lp = isdn_net_get_locked_lp(nd);
1074 if (!lp) { 1068 if (!lp) {
1075 printk(KERN_WARNING "%s: all channels busy - requeuing!\n", ndev->name); 1069 printk(KERN_WARNING "%s: all channels busy - requeuing!\n", ndev->name);
@@ -1096,9 +1090,9 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
1096 } else { 1090 } else {
1097 /* subsequent overload: if slavedelay exceeded, start dialing */ 1091 /* subsequent overload: if slavedelay exceeded, start dialing */
1098 if (time_after(jiffies, lp->sqfull_stamp + lp->slavedelay)) { 1092 if (time_after(jiffies, lp->sqfull_stamp + lp->slavedelay)) {
1099 slp = lp->slave->priv; 1093 slp = ISDN_SLAVE_PRIV(lp);
1100 if (!(slp->flags & ISDN_NET_CONNECTED)) { 1094 if (!(slp->flags & ISDN_NET_CONNECTED)) {
1101 isdn_net_force_dial_lp((isdn_net_local *) lp->slave->priv); 1095 isdn_net_force_dial_lp(ISDN_SLAVE_PRIV(lp));
1102 } 1096 }
1103 } 1097 }
1104 } 1098 }
@@ -1118,7 +1112,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
1118static void 1112static void
1119isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev) 1113isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev)
1120{ 1114{
1121 isdn_net_local *lp = (isdn_net_local *) dev->priv; 1115 isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
1122 if (!skb) 1116 if (!skb)
1123 return; 1117 return;
1124 if (lp->p_encap == ISDN_NET_ENCAP_ETHER) { 1118 if (lp->p_encap == ISDN_NET_ENCAP_ETHER) {
@@ -1133,7 +1127,7 @@ isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev)
1133 1127
1134static void isdn_net_tx_timeout(struct net_device * ndev) 1128static void isdn_net_tx_timeout(struct net_device * ndev)
1135{ 1129{
1136 isdn_net_local *lp = (isdn_net_local *) ndev->priv; 1130 isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
1137 1131
1138 printk(KERN_WARNING "isdn_tx_timeout dev %s dialstate %d\n", ndev->name, lp->dialstate); 1132 printk(KERN_WARNING "isdn_tx_timeout dev %s dialstate %d\n", ndev->name, lp->dialstate);
1139 if (!lp->dialstate){ 1133 if (!lp->dialstate){
@@ -1167,7 +1161,7 @@ static void isdn_net_tx_timeout(struct net_device * ndev)
1167static int 1161static int
1168isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev) 1162isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
1169{ 1163{
1170 isdn_net_local *lp = (isdn_net_local *) ndev->priv; 1164 isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
1171#ifdef CONFIG_ISDN_X25 1165#ifdef CONFIG_ISDN_X25
1172 struct concap_proto * cprot = lp -> netdev -> cprot; 1166 struct concap_proto * cprot = lp -> netdev -> cprot;
1173/* At this point hard_start_xmit() passes control to the encapsulation 1167/* At this point hard_start_xmit() passes control to the encapsulation
@@ -1316,7 +1310,7 @@ isdn_net_close(struct net_device *dev)
1316 struct net_device *p; 1310 struct net_device *p;
1317#ifdef CONFIG_ISDN_X25 1311#ifdef CONFIG_ISDN_X25
1318 struct concap_proto * cprot = 1312 struct concap_proto * cprot =
1319 ( (isdn_net_local *) dev->priv ) -> netdev -> cprot; 1313 ((isdn_net_local *) netdev_priv(dev))->netdev->cprot;
1320 /* printk(KERN_DEBUG "isdn_net_close %s\n" , dev-> name ); */ 1314 /* printk(KERN_DEBUG "isdn_net_close %s\n" , dev-> name ); */
1321#endif 1315#endif
1322 1316
@@ -1324,17 +1318,18 @@ isdn_net_close(struct net_device *dev)
1324 if( cprot && cprot -> pops ) cprot -> pops -> close( cprot ); 1318 if( cprot && cprot -> pops ) cprot -> pops -> close( cprot );
1325#endif 1319#endif
1326 netif_stop_queue(dev); 1320 netif_stop_queue(dev);
1327 if ((p = (((isdn_net_local *) dev->priv)->slave))) { 1321 p = MASTER_TO_SLAVE(dev);
1322 if (p) {
1328 /* If this interface has slaves, stop them also */ 1323 /* If this interface has slaves, stop them also */
1329 while (p) { 1324 while (p) {
1330#ifdef CONFIG_ISDN_X25 1325#ifdef CONFIG_ISDN_X25
1331 cprot = ( (isdn_net_local *) p->priv ) 1326 cprot = ((isdn_net_local *) netdev_priv(p))
1332 -> netdev -> cprot; 1327 -> netdev -> cprot;
1333 if( cprot && cprot -> pops ) 1328 if( cprot && cprot -> pops )
1334 cprot -> pops -> close( cprot ); 1329 cprot -> pops -> close( cprot );
1335#endif 1330#endif
1336 isdn_net_hangup(p); 1331 isdn_net_hangup(p);
1337 p = (((isdn_net_local *) p->priv)->slave); 1332 p = MASTER_TO_SLAVE(p);
1338 } 1333 }
1339 } 1334 }
1340 isdn_net_hangup(dev); 1335 isdn_net_hangup(dev);
@@ -1348,7 +1343,7 @@ isdn_net_close(struct net_device *dev)
1348static struct net_device_stats * 1343static struct net_device_stats *
1349isdn_net_get_stats(struct net_device *dev) 1344isdn_net_get_stats(struct net_device *dev)
1350{ 1345{
1351 isdn_net_local *lp = (isdn_net_local *) dev->priv; 1346 isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
1352 return &lp->stats; 1347 return &lp->stats;
1353} 1348}
1354 1349
@@ -1361,7 +1356,7 @@ isdn_net_get_stats(struct net_device *dev)
1361 * This is normal practice and works for any 'now in use' protocol. 1356 * This is normal practice and works for any 'now in use' protocol.
1362 */ 1357 */
1363 1358
1364static unsigned short 1359static __be16
1365isdn_net_type_trans(struct sk_buff *skb, struct net_device *dev) 1360isdn_net_type_trans(struct sk_buff *skb, struct net_device *dev)
1366{ 1361{
1367 struct ethhdr *eth; 1362 struct ethhdr *eth;
@@ -1427,7 +1422,7 @@ isdn_net_ciscohdlck_alloc_skb(isdn_net_local *lp, int len)
1427static int 1422static int
1428isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 1423isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1429{ 1424{
1430 isdn_net_local *lp = (isdn_net_local *) dev->priv; 1425 isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
1431 unsigned long len = 0; 1426 unsigned long len = 0;
1432 unsigned long expires = 0; 1427 unsigned long expires = 0;
1433 int tmp = 0; 1428 int tmp = 0;
@@ -1539,15 +1534,16 @@ isdn_net_ciscohdlck_slarp_send_keepalive(unsigned long data)
1539 p = skb_put(skb, 4 + 14); 1534 p = skb_put(skb, 4 + 14);
1540 1535
1541 /* cisco header */ 1536 /* cisco header */
1542 p += put_u8 (p, CISCO_ADDR_UNICAST); 1537 *(u8 *)(p + 0) = CISCO_ADDR_UNICAST;
1543 p += put_u8 (p, CISCO_CTRL); 1538 *(u8 *)(p + 1) = CISCO_CTRL;
1544 p += put_u16(p, CISCO_TYPE_SLARP); 1539 *(__be16 *)(p + 2) = cpu_to_be16(CISCO_TYPE_SLARP);
1545 1540
1546 /* slarp keepalive */ 1541 /* slarp keepalive */
1547 p += put_u32(p, CISCO_SLARP_KEEPALIVE); 1542 *(__be32 *)(p + 4) = cpu_to_be32(CISCO_SLARP_KEEPALIVE);
1548 p += put_u32(p, lp->cisco_myseq); 1543 *(__be32 *)(p + 8) = cpu_to_be32(lp->cisco_myseq);
1549 p += put_u32(p, lp->cisco_yourseq); 1544 *(__be32 *)(p + 12) = cpu_to_be32(lp->cisco_yourseq);
1550 p += put_u16(p, 0xffff); // reliablity, always 0xffff 1545 *(__be16 *)(p + 16) = cpu_to_be16(0xffff); // reliablity, always 0xffff
1546 p += 18;
1551 1547
1552 isdn_net_write_super(lp, skb); 1548 isdn_net_write_super(lp, skb);
1553 1549
@@ -1569,15 +1565,16 @@ isdn_net_ciscohdlck_slarp_send_request(isdn_net_local *lp)
1569 p = skb_put(skb, 4 + 14); 1565 p = skb_put(skb, 4 + 14);
1570 1566
1571 /* cisco header */ 1567 /* cisco header */
1572 p += put_u8 (p, CISCO_ADDR_UNICAST); 1568 *(u8 *)(p + 0) = CISCO_ADDR_UNICAST;
1573 p += put_u8 (p, CISCO_CTRL); 1569 *(u8 *)(p + 1) = CISCO_CTRL;
1574 p += put_u16(p, CISCO_TYPE_SLARP); 1570 *(__be16 *)(p + 2) = cpu_to_be16(CISCO_TYPE_SLARP);
1575 1571
1576 /* slarp request */ 1572 /* slarp request */
1577 p += put_u32(p, CISCO_SLARP_REQUEST); 1573 *(__be32 *)(p + 4) = cpu_to_be32(CISCO_SLARP_REQUEST);
1578 p += put_u32(p, 0); // address 1574 *(__be32 *)(p + 8) = cpu_to_be32(0); // address
1579 p += put_u32(p, 0); // netmask 1575 *(__be32 *)(p + 12) = cpu_to_be32(0); // netmask
1580 p += put_u16(p, 0); // unused 1576 *(__be16 *)(p + 16) = cpu_to_be16(0); // unused
1577 p += 18;
1581 1578
1582 isdn_net_write_super(lp, skb); 1579 isdn_net_write_super(lp, skb);
1583} 1580}
@@ -1634,18 +1631,17 @@ isdn_net_ciscohdlck_slarp_send_reply(isdn_net_local *lp)
1634 p = skb_put(skb, 4 + 14); 1631 p = skb_put(skb, 4 + 14);
1635 1632
1636 /* cisco header */ 1633 /* cisco header */
1637 p += put_u8 (p, CISCO_ADDR_UNICAST); 1634 *(u8 *)(p + 0) = CISCO_ADDR_UNICAST;
1638 p += put_u8 (p, CISCO_CTRL); 1635 *(u8 *)(p + 1) = CISCO_CTRL;
1639 p += put_u16(p, CISCO_TYPE_SLARP); 1636 *(__be16 *)(p + 2) = cpu_to_be16(CISCO_TYPE_SLARP);
1640 1637
1641 /* slarp reply, send own ip/netmask; if values are nonsense remote 1638 /* slarp reply, send own ip/netmask; if values are nonsense remote
1642 * should think we are unable to provide it with an address via SLARP */ 1639 * should think we are unable to provide it with an address via SLARP */
1643 p += put_u32(p, CISCO_SLARP_REPLY); 1640 *(__be32 *)(p + 4) = cpu_to_be32(CISCO_SLARP_REPLY);
1644 *(__be32 *)p = addr; // address 1641 *(__be32 *)(p + 8) = addr; // address
1645 p += 4; 1642 *(__be32 *)(p + 12) = mask; // netmask
1646 *(__be32 *)p = mask; // netmask 1643 *(__be16 *)(p + 16) = cpu_to_be16(0); // unused
1647 p += 4; 1644 p += 18;
1648 p += put_u16(p, 0); // unused
1649 1645
1650 isdn_net_write_super(lp, skb); 1646 isdn_net_write_super(lp, skb);
1651} 1647}
@@ -1656,44 +1652,39 @@ isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb)
1656 unsigned char *p; 1652 unsigned char *p;
1657 int period; 1653 int period;
1658 u32 code; 1654 u32 code;
1659 u32 my_seq, addr; 1655 u32 my_seq;
1660 u32 your_seq, mask; 1656 u32 your_seq;
1661 u32 local; 1657 __be32 local;
1658 __be32 *addr, *mask;
1662 u16 unused; 1659 u16 unused;
1663 1660
1664 if (skb->len < 14) 1661 if (skb->len < 14)
1665 return; 1662 return;
1666 1663
1667 p = skb->data; 1664 p = skb->data;
1668 p += get_u32(p, &code); 1665 code = be32_to_cpup((__be32 *)p);
1669 1666 p += 4;
1667
1670 switch (code) { 1668 switch (code) {
1671 case CISCO_SLARP_REQUEST: 1669 case CISCO_SLARP_REQUEST:
1672 lp->cisco_yourseq = 0; 1670 lp->cisco_yourseq = 0;
1673 isdn_net_ciscohdlck_slarp_send_reply(lp); 1671 isdn_net_ciscohdlck_slarp_send_reply(lp);
1674 break; 1672 break;
1675 case CISCO_SLARP_REPLY: 1673 case CISCO_SLARP_REPLY:
1676 addr = ntohl(*(u32 *)p); 1674 addr = (__be32 *)p;
1677 mask = ntohl(*(u32 *)(p+4)); 1675 mask = (__be32 *)(p + 4);
1678 if (mask != 0xfffffffc) 1676 if (*mask != cpu_to_be32(0xfffffffc))
1679 goto slarp_reply_out; 1677 goto slarp_reply_out;
1680 if ((addr & 3) == 0 || (addr & 3) == 3) 1678 if ((*addr & cpu_to_be32(3)) == cpu_to_be32(0) ||
1679 (*addr & cpu_to_be32(3)) == cpu_to_be32(3))
1681 goto slarp_reply_out; 1680 goto slarp_reply_out;
1682 local = addr ^ 3; 1681 local = *addr ^ cpu_to_be32(3);
1683 printk(KERN_INFO "%s: got slarp reply: " 1682 printk(KERN_INFO "%s: got slarp reply: remote ip: %pI4, local ip: %pI4 mask: %pI4\n",
1684 "remote ip: %d.%d.%d.%d, " 1683 lp->netdev->dev->name, addr, &local, mask);
1685 "local ip: %d.%d.%d.%d "
1686 "mask: %d.%d.%d.%d\n",
1687 lp->netdev->dev->name,
1688 HIPQUAD(addr),
1689 HIPQUAD(local),
1690 HIPQUAD(mask));
1691 break; 1684 break;
1692 slarp_reply_out: 1685 slarp_reply_out:
1693 printk(KERN_INFO "%s: got invalid slarp " 1686 printk(KERN_INFO "%s: got invalid slarp reply (%pI4/%pI4) - ignored\n",
1694 "reply (%d.%d.%d.%d/%d.%d.%d.%d) " 1687 lp->netdev->dev->name, addr, mask);
1695 "- ignored\n", lp->netdev->dev->name,
1696 HIPQUAD(addr), HIPQUAD(mask));
1697 break; 1688 break;
1698 case CISCO_SLARP_KEEPALIVE: 1689 case CISCO_SLARP_KEEPALIVE:
1699 period = (int)((jiffies - lp->cisco_last_slarp_in 1690 period = (int)((jiffies - lp->cisco_last_slarp_in
@@ -1707,9 +1698,10 @@ isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb)
1707 lp->cisco_keepalive_period); 1698 lp->cisco_keepalive_period);
1708 } 1699 }
1709 lp->cisco_last_slarp_in = jiffies; 1700 lp->cisco_last_slarp_in = jiffies;
1710 p += get_u32(p, &my_seq); 1701 my_seq = be32_to_cpup((__be32 *)(p + 0));
1711 p += get_u32(p, &your_seq); 1702 your_seq = be32_to_cpup((__be32 *)(p + 4));
1712 p += get_u16(p, &unused); 1703 unused = be16_to_cpup((__be16 *)(p + 8));
1704 p += 10;
1713 lp->cisco_yourseq = my_seq; 1705 lp->cisco_yourseq = my_seq;
1714 lp->cisco_mineseen = your_seq; 1706 lp->cisco_mineseen = your_seq;
1715 break; 1707 break;
@@ -1728,9 +1720,10 @@ isdn_net_ciscohdlck_receive(isdn_net_local *lp, struct sk_buff *skb)
1728 goto out_free; 1720 goto out_free;
1729 1721
1730 p = skb->data; 1722 p = skb->data;
1731 p += get_u8 (p, &addr); 1723 addr = *(u8 *)(p + 0);
1732 p += get_u8 (p, &ctrl); 1724 ctrl = *(u8 *)(p + 1);
1733 p += get_u16(p, &type); 1725 type = be16_to_cpup((__be16 *)(p + 2));
1726 p += 4;
1734 skb_pull(skb, 4); 1727 skb_pull(skb, 4);
1735 1728
1736 if (addr != CISCO_ADDR_UNICAST && addr != CISCO_ADDR_BROADCAST) { 1729 if (addr != CISCO_ADDR_UNICAST && addr != CISCO_ADDR_BROADCAST) {
@@ -1771,7 +1764,7 @@ isdn_net_ciscohdlck_receive(isdn_net_local *lp, struct sk_buff *skb)
1771static void 1764static void
1772isdn_net_receive(struct net_device *ndev, struct sk_buff *skb) 1765isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
1773{ 1766{
1774 isdn_net_local *lp = (isdn_net_local *) ndev->priv; 1767 isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
1775 isdn_net_local *olp = lp; /* original 'lp' */ 1768 isdn_net_local *olp = lp; /* original 'lp' */
1776#ifdef CONFIG_ISDN_X25 1769#ifdef CONFIG_ISDN_X25
1777 struct concap_proto *cprot = lp -> netdev -> cprot; 1770 struct concap_proto *cprot = lp -> netdev -> cprot;
@@ -1785,7 +1778,7 @@ isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
1785 * handle master's statistics and hangup-timeout 1778 * handle master's statistics and hangup-timeout
1786 */ 1779 */
1787 ndev = lp->master; 1780 ndev = lp->master;
1788 lp = (isdn_net_local *) ndev->priv; 1781 lp = (isdn_net_local *) netdev_priv(ndev);
1789 lp->stats.rx_packets++; 1782 lp->stats.rx_packets++;
1790 lp->stats.rx_bytes += skb->len; 1783 lp->stats.rx_bytes += skb->len;
1791 } 1784 }
@@ -1825,7 +1818,7 @@ isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
1825 /* IP with type field */ 1818 /* IP with type field */
1826 olp->huptimer = 0; 1819 olp->huptimer = 0;
1827 lp->huptimer = 0; 1820 lp->huptimer = 0;
1828 skb->protocol = *(unsigned short *) &(skb->data[0]); 1821 skb->protocol = *(__be16 *)&(skb->data[0]);
1829 skb_pull(skb, 2); 1822 skb_pull(skb, 2);
1830 if (*(unsigned short *) skb->data == 0xFFFF) 1823 if (*(unsigned short *) skb->data == 0xFFFF)
1831 skb->protocol = htons(ETH_P_802_3); 1824 skb->protocol = htons(ETH_P_802_3);
@@ -1886,7 +1879,7 @@ static int isdn_net_header(struct sk_buff *skb, struct net_device *dev,
1886 unsigned short type, 1879 unsigned short type,
1887 const void *daddr, const void *saddr, unsigned plen) 1880 const void *daddr, const void *saddr, unsigned plen)
1888{ 1881{
1889 isdn_net_local *lp = dev->priv; 1882 isdn_net_local *lp = netdev_priv(dev);
1890 unsigned char *p; 1883 unsigned char *p;
1891 ushort len = 0; 1884 ushort len = 0;
1892 1885
@@ -1907,20 +1900,21 @@ static int isdn_net_header(struct sk_buff *skb, struct net_device *dev,
1907 break; 1900 break;
1908 case ISDN_NET_ENCAP_IPTYP: 1901 case ISDN_NET_ENCAP_IPTYP:
1909 /* ethernet type field */ 1902 /* ethernet type field */
1910 *((ushort *) skb_push(skb, 2)) = htons(type); 1903 *((__be16 *)skb_push(skb, 2)) = htons(type);
1911 len = 2; 1904 len = 2;
1912 break; 1905 break;
1913 case ISDN_NET_ENCAP_UIHDLC: 1906 case ISDN_NET_ENCAP_UIHDLC:
1914 /* HDLC with UI-Frames (for ispa with -h1 option) */ 1907 /* HDLC with UI-Frames (for ispa with -h1 option) */
1915 *((ushort *) skb_push(skb, 2)) = htons(0x0103); 1908 *((__be16 *)skb_push(skb, 2)) = htons(0x0103);
1916 len = 2; 1909 len = 2;
1917 break; 1910 break;
1918 case ISDN_NET_ENCAP_CISCOHDLC: 1911 case ISDN_NET_ENCAP_CISCOHDLC:
1919 case ISDN_NET_ENCAP_CISCOHDLCK: 1912 case ISDN_NET_ENCAP_CISCOHDLCK:
1920 p = skb_push(skb, 4); 1913 p = skb_push(skb, 4);
1921 p += put_u8 (p, CISCO_ADDR_UNICAST); 1914 *(u8 *)(p + 0) = CISCO_ADDR_UNICAST;
1922 p += put_u8 (p, CISCO_CTRL); 1915 *(u8 *)(p + 1) = CISCO_CTRL;
1923 p += put_u16(p, type); 1916 *(__be16 *)(p + 2) = cpu_to_be16(type);
1917 p += 4;
1924 len = 4; 1918 len = 4;
1925 break; 1919 break;
1926#ifdef CONFIG_ISDN_X25 1920#ifdef CONFIG_ISDN_X25
@@ -1942,7 +1936,7 @@ static int
1942isdn_net_rebuild_header(struct sk_buff *skb) 1936isdn_net_rebuild_header(struct sk_buff *skb)
1943{ 1937{
1944 struct net_device *dev = skb->dev; 1938 struct net_device *dev = skb->dev;
1945 isdn_net_local *lp = dev->priv; 1939 isdn_net_local *lp = netdev_priv(dev);
1946 int ret = 0; 1940 int ret = 0;
1947 1941
1948 if (lp->p_encap == ISDN_NET_ENCAP_ETHER) { 1942 if (lp->p_encap == ISDN_NET_ENCAP_ETHER) {
@@ -1972,7 +1966,7 @@ isdn_net_rebuild_header(struct sk_buff *skb)
1972static int isdn_header_cache(const struct neighbour *neigh, struct hh_cache *hh) 1966static int isdn_header_cache(const struct neighbour *neigh, struct hh_cache *hh)
1973{ 1967{
1974 const struct net_device *dev = neigh->dev; 1968 const struct net_device *dev = neigh->dev;
1975 isdn_net_local *lp = dev->priv; 1969 isdn_net_local *lp = netdev_priv(dev);
1976 1970
1977 if (lp->p_encap == ISDN_NET_ENCAP_ETHER) 1971 if (lp->p_encap == ISDN_NET_ENCAP_ETHER)
1978 return eth_header_cache(neigh, hh); 1972 return eth_header_cache(neigh, hh);
@@ -1983,9 +1977,9 @@ static void isdn_header_cache_update(struct hh_cache *hh,
1983 const struct net_device *dev, 1977 const struct net_device *dev,
1984 const unsigned char *haddr) 1978 const unsigned char *haddr)
1985{ 1979{
1986 isdn_net_local *lp = dev->priv; 1980 isdn_net_local *lp = netdev_priv(dev);
1987 if (lp->p_encap == ISDN_NET_ENCAP_ETHER) 1981 if (lp->p_encap == ISDN_NET_ENCAP_ETHER)
1988 return eth_header_cache_update(hh, dev, haddr); 1982 eth_header_cache_update(hh, dev, haddr);
1989} 1983}
1990 1984
1991static const struct header_ops isdn_header_ops = { 1985static const struct header_ops isdn_header_ops = {
@@ -2298,16 +2292,16 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup)
2298 * it's master and parent slave is online. If not, reject the call. 2292 * it's master and parent slave is online. If not, reject the call.
2299 */ 2293 */
2300 if (lp->master) { 2294 if (lp->master) {
2301 isdn_net_local *mlp = (isdn_net_local *) lp->master->priv; 2295 isdn_net_local *mlp = ISDN_MASTER_PRIV(lp);
2302 printk(KERN_DEBUG "ICALLslv: %s\n", p->dev->name); 2296 printk(KERN_DEBUG "ICALLslv: %s\n", p->dev->name);
2303 printk(KERN_DEBUG "master=%s\n", lp->master->name); 2297 printk(KERN_DEBUG "master=%s\n", lp->master->name);
2304 if (mlp->flags & ISDN_NET_CONNECTED) { 2298 if (mlp->flags & ISDN_NET_CONNECTED) {
2305 printk(KERN_DEBUG "master online\n"); 2299 printk(KERN_DEBUG "master online\n");
2306 /* Master is online, find parent-slave (master if first slave) */ 2300 /* Master is online, find parent-slave (master if first slave) */
2307 while (mlp->slave) { 2301 while (mlp->slave) {
2308 if ((isdn_net_local *) mlp->slave->priv == lp) 2302 if (ISDN_SLAVE_PRIV(mlp) == lp)
2309 break; 2303 break;
2310 mlp = (isdn_net_local *) mlp->slave->priv; 2304 mlp = ISDN_SLAVE_PRIV(mlp);
2311 } 2305 }
2312 } else 2306 } else
2313 printk(KERN_DEBUG "master offline\n"); 2307 printk(KERN_DEBUG "master offline\n");
@@ -2519,7 +2513,7 @@ isdn_net_force_dial(char *name)
2519 */ 2513 */
2520static void _isdn_setup(struct net_device *dev) 2514static void _isdn_setup(struct net_device *dev)
2521{ 2515{
2522 isdn_net_local *lp = dev->priv; 2516 isdn_net_local *lp = netdev_priv(dev);
2523 2517
2524 dev->flags = IFF_NOARP | IFF_POINTOPOINT; 2518 dev->flags = IFF_NOARP | IFF_POINTOPOINT;
2525 lp->p_encap = ISDN_NET_ENCAP_RAWIP; 2519 lp->p_encap = ISDN_NET_ENCAP_RAWIP;
@@ -2575,20 +2569,20 @@ isdn_net_new(char *name, struct net_device *master)
2575 kfree(netdev); 2569 kfree(netdev);
2576 return NULL; 2570 return NULL;
2577 } 2571 }
2578 netdev->local = netdev->dev->priv; 2572 netdev->local = netdev_priv(netdev->dev);
2579 netdev->dev->init = isdn_net_init; 2573 netdev->dev->init = isdn_net_init;
2580 if (master) { 2574 if (master) {
2581 /* Device shall be a slave */ 2575 /* Device shall be a slave */
2582 struct net_device *p = (((isdn_net_local *) master->priv)->slave); 2576 struct net_device *p = MASTER_TO_SLAVE(master);
2583 struct net_device *q = master; 2577 struct net_device *q = master;
2584 2578
2585 netdev->local->master = master; 2579 netdev->local->master = master;
2586 /* Put device at end of slave-chain */ 2580 /* Put device at end of slave-chain */
2587 while (p) { 2581 while (p) {
2588 q = p; 2582 q = p;
2589 p = (((isdn_net_local *) p->priv)->slave); 2583 p = MASTER_TO_SLAVE(p);
2590 } 2584 }
2591 ((isdn_net_local *) q->priv)->slave = netdev->dev; 2585 MASTER_TO_SLAVE(q) = netdev->dev;
2592 } else { 2586 } else {
2593 /* Device shall be a master */ 2587 /* Device shall be a master */
2594 /* 2588 /*
@@ -3086,7 +3080,7 @@ isdn_net_force_hangup(char *name)
3086 /* If this interface has slaves, do a hangup for them also. */ 3080 /* If this interface has slaves, do a hangup for them also. */
3087 while (q) { 3081 while (q) {
3088 isdn_net_hangup(q); 3082 isdn_net_hangup(q);
3089 q = (((isdn_net_local *) q->priv)->slave); 3083 q = MASTER_TO_SLAVE(q);
3090 } 3084 }
3091 isdn_net_hangup(p->dev); 3085 isdn_net_hangup(p->dev);
3092 return 0; 3086 return 0;
@@ -3116,8 +3110,10 @@ isdn_net_realrm(isdn_net_dev * p, isdn_net_dev * q)
3116 isdn_unexclusive_channel(p->local->pre_device, p->local->pre_channel); 3110 isdn_unexclusive_channel(p->local->pre_device, p->local->pre_channel);
3117 if (p->local->master) { 3111 if (p->local->master) {
3118 /* It's a slave-device, so update master's slave-pointer if necessary */ 3112 /* It's a slave-device, so update master's slave-pointer if necessary */
3119 if (((isdn_net_local *) (p->local->master->priv))->slave == p->dev) 3113 if (((isdn_net_local *) ISDN_MASTER_PRIV(p->local))->slave ==
3120 ((isdn_net_local *) (p->local->master->priv))->slave = p->local->slave; 3114 p->dev)
3115 ((isdn_net_local *)ISDN_MASTER_PRIV(p->local))->slave =
3116 p->local->slave;
3121 } else { 3117 } else {
3122 /* Unregister only if it's a master-device */ 3118 /* Unregister only if it's a master-device */
3123 unregister_netdev(p->dev); 3119 unregister_netdev(p->dev);
diff --git a/drivers/isdn/i4l/isdn_net.h b/drivers/isdn/i4l/isdn_net.h
index be4949715d55..74032d0881ef 100644
--- a/drivers/isdn/i4l/isdn_net.h
+++ b/drivers/isdn/i4l/isdn_net.h
@@ -56,6 +56,11 @@ extern void isdn_net_write_super(isdn_net_local *lp, struct sk_buff *skb);
56 56
57#define ISDN_NET_MAX_QUEUE_LENGTH 2 57#define ISDN_NET_MAX_QUEUE_LENGTH 2
58 58
59#define ISDN_MASTER_PRIV(lp) ((isdn_net_local *) netdev_priv(lp->master))
60#define ISDN_SLAVE_PRIV(lp) ((isdn_net_local *) netdev_priv(lp->slave))
61#define MASTER_TO_SLAVE(master) \
62 (((isdn_net_local *) netdev_priv(master))->slave)
63
59/* 64/*
60 * is this particular channel busy? 65 * is this particular channel busy?
61 */ 66 */
@@ -126,7 +131,7 @@ static __inline__ void isdn_net_rm_from_bundle(isdn_net_local *lp)
126 unsigned long flags; 131 unsigned long flags;
127 132
128 if (lp->master) 133 if (lp->master)
129 master_lp = (isdn_net_local *) lp->master->priv; 134 master_lp = ISDN_MASTER_PRIV(lp);
130 135
131// printk(KERN_DEBUG "%s: lp:%s(%p) mlp:%s(%p) last(%p) next(%p) mndq(%p)\n", 136// printk(KERN_DEBUG "%s: lp:%s(%p) mlp:%s(%p) last(%p) next(%p) mndq(%p)\n",
132// __func__, lp->name, lp, master_lp->name, master_lp, lp->last, lp->next, master_lp->netdev->queue); 137// __func__, lp->name, lp, master_lp->name, master_lp, lp->last, lp->next, master_lp->netdev->queue);
@@ -145,46 +150,3 @@ static __inline__ void isdn_net_rm_from_bundle(isdn_net_local *lp)
145 spin_unlock_irqrestore(&master_lp->netdev->queue_lock, flags); 150 spin_unlock_irqrestore(&master_lp->netdev->queue_lock, flags);
146} 151}
147 152
148static inline int
149put_u8(unsigned char *p, u8 x)
150{
151 *p = x;
152 return 1;
153}
154
155static inline int
156put_u16(unsigned char *p, u16 x)
157{
158 *((u16 *)p) = htons(x);
159 return 2;
160}
161
162static inline int
163put_u32(unsigned char *p, u32 x)
164{
165 *((u32 *)p) = htonl(x);
166 return 4;
167}
168
169static inline int
170get_u8(unsigned char *p, u8 *x)
171{
172 *x = *p;
173 return 1;
174}
175
176static inline int
177get_u16(unsigned char *p, u16 *x)
178{
179 *x = ntohs(*((u16 *)p));
180 return 2;
181}
182
183static inline int
184get_u32(unsigned char *p, u32 *x)
185{
186 *x = ntohl(*((u32 *)p));
187 return 4;
188}
189
190
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index 77c280ef2eb6..a3551dd0324d 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -1040,7 +1040,7 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
1040 is = ippp_table[slot]; 1040 is = ippp_table[slot];
1041 1041
1042 if (lp->master) { // FIXME? 1042 if (lp->master) { // FIXME?
1043 mlp = (isdn_net_local *) lp->master->priv; 1043 mlp = ISDN_MASTER_PRIV(lp);
1044 slot = mlp->ppp_slot; 1044 slot = mlp->ppp_slot;
1045 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) { 1045 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
1046 printk(KERN_ERR "isdn_ppp_push_higher: master->ppp_slot(%d)\n", 1046 printk(KERN_ERR "isdn_ppp_push_higher: master->ppp_slot(%d)\n",
@@ -1223,7 +1223,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev)
1223 struct ippp_struct *ipt,*ipts; 1223 struct ippp_struct *ipt,*ipts;
1224 int slot, retval = 0; 1224 int slot, retval = 0;
1225 1225
1226 mlp = (isdn_net_local *) (netdev->priv); 1226 mlp = (isdn_net_local *) netdev_priv(netdev);
1227 nd = mlp->netdev; /* get master lp */ 1227 nd = mlp->netdev; /* get master lp */
1228 1228
1229 slot = mlp->ppp_slot; 1229 slot = mlp->ppp_slot;
@@ -1289,10 +1289,10 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev)
1289 *skb_push(skb, 4) = 1; /* indicate outbound */ 1289 *skb_push(skb, 4) = 1; /* indicate outbound */
1290 1290
1291 { 1291 {
1292 u_int16_t *p = (u_int16_t *) skb->data; 1292 __be16 *p = (__be16 *)skb->data;
1293 1293
1294 p++; 1294 p++;
1295 *p = htons(proto); 1295 *p = htons(proto);
1296 } 1296 }
1297 1297
1298 if (ipt->pass_filter 1298 if (ipt->pass_filter
@@ -1487,10 +1487,10 @@ int isdn_ppp_autodial_filter(struct sk_buff *skb, isdn_net_local *lp)
1487 *skb_pull(skb, IPPP_MAX_HEADER - 4) = 1; /* indicate outbound */ 1487 *skb_pull(skb, IPPP_MAX_HEADER - 4) = 1; /* indicate outbound */
1488 1488
1489 { 1489 {
1490 u_int16_t *p = (u_int16_t *) skb->data; 1490 __be16 *p = (__be16 *)skb->data;
1491 1491
1492 p++; 1492 p++;
1493 *p = htons(proto); 1493 *p = htons(proto);
1494 } 1494 }
1495 1495
1496 drop |= is->pass_filter 1496 drop |= is->pass_filter
@@ -1810,14 +1810,14 @@ static u32 isdn_ppp_mp_get_seq( int short_seq,
1810 1810
1811 if( !short_seq ) 1811 if( !short_seq )
1812 { 1812 {
1813 seq = ntohl(*(u32*)skb->data) & MP_LONGSEQ_MASK; 1813 seq = ntohl(*(__be32 *)skb->data) & MP_LONGSEQ_MASK;
1814 skb_push(skb,1); 1814 skb_push(skb,1);
1815 } 1815 }
1816 else 1816 else
1817 { 1817 {
1818 /* convert 12-bit short seq number to 24-bit long one 1818 /* convert 12-bit short seq number to 24-bit long one
1819 */ 1819 */
1820 seq = ntohs(*(u16*)skb->data) & MP_SHORTSEQ_MASK; 1820 seq = ntohs(*(__be16 *)skb->data) & MP_SHORTSEQ_MASK;
1821 1821
1822 /* check for seqence wrap */ 1822 /* check for seqence wrap */
1823 if( !(seq & MP_SHORTSEQ_MAXBIT) && 1823 if( !(seq & MP_SHORTSEQ_MAXBIT) &&
@@ -2013,7 +2013,7 @@ isdn_ppp_dev_ioctl_stats(int slot, struct ifreq *ifr, struct net_device *dev)
2013{ 2013{
2014 struct ppp_stats __user *res = ifr->ifr_data; 2014 struct ppp_stats __user *res = ifr->ifr_data;
2015 struct ppp_stats t; 2015 struct ppp_stats t;
2016 isdn_net_local *lp = (isdn_net_local *) dev->priv; 2016 isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
2017 2017
2018 if (!access_ok(VERIFY_WRITE, res, sizeof(struct ppp_stats))) 2018 if (!access_ok(VERIFY_WRITE, res, sizeof(struct ppp_stats)))
2019 return -EFAULT; 2019 return -EFAULT;
@@ -2052,7 +2052,7 @@ isdn_ppp_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
2052{ 2052{
2053 int error=0; 2053 int error=0;
2054 int len; 2054 int len;
2055 isdn_net_local *lp = (isdn_net_local *) dev->priv; 2055 isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
2056 2056
2057 2057
2058 if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP) 2058 if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP)
@@ -2119,7 +2119,7 @@ isdn_ppp_dial_slave(char *name)
2119 2119
2120 sdev = lp->slave; 2120 sdev = lp->slave;
2121 while (sdev) { 2121 while (sdev) {
2122 isdn_net_local *mlp = (isdn_net_local *) sdev->priv; 2122 isdn_net_local *mlp = (isdn_net_local *) netdev_priv(sdev);
2123 if (!(mlp->flags & ISDN_NET_CONNECTED)) 2123 if (!(mlp->flags & ISDN_NET_CONNECTED))
2124 break; 2124 break;
2125 sdev = mlp->slave; 2125 sdev = mlp->slave;
@@ -2127,7 +2127,7 @@ isdn_ppp_dial_slave(char *name)
2127 if (!sdev) 2127 if (!sdev)
2128 return 2; 2128 return 2;
2129 2129
2130 isdn_net_dial_req((isdn_net_local *) sdev->priv); 2130 isdn_net_dial_req((isdn_net_local *) netdev_priv(sdev));
2131 return 0; 2131 return 0;
2132#else 2132#else
2133 return -1; 2133 return -1;
@@ -2150,10 +2150,10 @@ isdn_ppp_hangup_slave(char *name)
2150 2150
2151 sdev = lp->slave; 2151 sdev = lp->slave;
2152 while (sdev) { 2152 while (sdev) {
2153 isdn_net_local *mlp = (isdn_net_local *) sdev->priv; 2153 isdn_net_local *mlp = (isdn_net_local *) netdev_priv(sdev);
2154 2154
2155 if (mlp->slave) { /* find last connected link in chain */ 2155 if (mlp->slave) { /* find last connected link in chain */
2156 isdn_net_local *nlp = (isdn_net_local *) mlp->slave->priv; 2156 isdn_net_local *nlp = ISDN_SLAVE_PRIV(mlp);
2157 2157
2158 if (!(nlp->flags & ISDN_NET_CONNECTED)) 2158 if (!(nlp->flags & ISDN_NET_CONNECTED))
2159 break; 2159 break;
@@ -2688,7 +2688,7 @@ static void isdn_ppp_receive_ccp(isdn_net_dev *net_dev, isdn_net_local *lp,
2688 isdn_ppp_frame_log("ccp-rcv", skb->data, skb->len, 32, is->unit,lp->ppp_slot); 2688 isdn_ppp_frame_log("ccp-rcv", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
2689 2689
2690 if(lp->master) { 2690 if(lp->master) {
2691 int slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot; 2691 int slot = ISDN_MASTER_PRIV(lp)->ppp_slot;
2692 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) { 2692 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
2693 printk(KERN_ERR "%s: slot(%d) out of range\n", 2693 printk(KERN_ERR "%s: slot(%d) out of range\n",
2694 __func__, slot); 2694 __func__, slot);
@@ -2875,7 +2875,7 @@ static void isdn_ppp_send_ccp(isdn_net_dev *net_dev, isdn_net_local *lp, struct
2875 isdn_ppp_frame_log("ccp-xmit", skb->data, skb->len, 32, is->unit,lp->ppp_slot); 2875 isdn_ppp_frame_log("ccp-xmit", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
2876 2876
2877 if (lp->master) { 2877 if (lp->master) {
2878 slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot; 2878 slot = ISDN_MASTER_PRIV(lp)->ppp_slot;
2879 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) { 2879 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
2880 printk(KERN_ERR "%s: slot(%d) out of range\n", 2880 printk(KERN_ERR "%s: slot(%d) out of range\n",
2881 __func__, slot); 2881 __func__, slot);
diff --git a/drivers/isdn/mISDN/core.c b/drivers/isdn/mISDN/core.c
index 33068177b7c9..751665c448d0 100644
--- a/drivers/isdn/mISDN/core.c
+++ b/drivers/isdn/mISDN/core.c
@@ -26,12 +26,12 @@ MODULE_LICENSE("GPL");
26module_param(debug, uint, S_IRUGO | S_IWUSR); 26module_param(debug, uint, S_IRUGO | S_IWUSR);
27 27
28static LIST_HEAD(devices); 28static LIST_HEAD(devices);
29DEFINE_RWLOCK(device_lock); 29static DEFINE_RWLOCK(device_lock);
30static u64 device_ids; 30static u64 device_ids;
31#define MAX_DEVICE_ID 63 31#define MAX_DEVICE_ID 63
32 32
33static LIST_HEAD(Bprotocols); 33static LIST_HEAD(Bprotocols);
34DEFINE_RWLOCK(bp_lock); 34static DEFINE_RWLOCK(bp_lock);
35 35
36struct mISDNdevice 36struct mISDNdevice
37*get_mdevice(u_int id) 37*get_mdevice(u_int id)
@@ -192,7 +192,7 @@ mISDN_unregister_Bprotocol(struct Bprotocol *bp)
192} 192}
193EXPORT_SYMBOL(mISDN_unregister_Bprotocol); 193EXPORT_SYMBOL(mISDN_unregister_Bprotocol);
194 194
195int 195static int
196mISDNInit(void) 196mISDNInit(void)
197{ 197{
198 int err; 198 int err;
@@ -224,7 +224,7 @@ error:
224 return err; 224 return err;
225} 225}
226 226
227void mISDN_cleanup(void) 227static void mISDN_cleanup(void)
228{ 228{
229 misdn_sock_cleanup(); 229 misdn_sock_cleanup();
230 mISDN_timer_cleanup(); 230 mISDN_timer_cleanup();
diff --git a/drivers/isdn/mISDN/dsp_audio.c b/drivers/isdn/mISDN/dsp_audio.c
index 1c2dd5694773..de3795e3f432 100644
--- a/drivers/isdn/mISDN/dsp_audio.c
+++ b/drivers/isdn/mISDN/dsp_audio.c
@@ -30,7 +30,7 @@ EXPORT_SYMBOL(dsp_audio_s16_to_law);
30/* alaw -> ulaw */ 30/* alaw -> ulaw */
31u8 dsp_audio_alaw_to_ulaw[256]; 31u8 dsp_audio_alaw_to_ulaw[256];
32/* ulaw -> alaw */ 32/* ulaw -> alaw */
33u8 dsp_audio_ulaw_to_alaw[256]; 33static u8 dsp_audio_ulaw_to_alaw[256];
34u8 dsp_silence; 34u8 dsp_silence;
35 35
36 36
diff --git a/drivers/isdn/mISDN/dsp_cmx.c b/drivers/isdn/mISDN/dsp_cmx.c
index c2f51cc50760..c884511e2d49 100644
--- a/drivers/isdn/mISDN/dsp_cmx.c
+++ b/drivers/isdn/mISDN/dsp_cmx.c
@@ -1540,11 +1540,13 @@ send_packet:
1540 schedule_work(&dsp->workq); 1540 schedule_work(&dsp->workq);
1541} 1541}
1542 1542
1543u32 samplecount; 1543static u32 samplecount;
1544struct timer_list dsp_spl_tl; 1544struct timer_list dsp_spl_tl;
1545u32 dsp_spl_jiffies; /* calculate the next time to fire */ 1545u32 dsp_spl_jiffies; /* calculate the next time to fire */
1546u32 dsp_start_jiffies; /* jiffies at the time, the calculation begins */ 1546#ifdef UNUSED
1547struct timeval dsp_start_tv; /* time at start of calculation */ 1547static u32 dsp_start_jiffies; /* jiffies at the time, the calculation begins */
1548#endif /* UNUSED */
1549static struct timeval dsp_start_tv; /* time at start of calculation */
1548 1550
1549void 1551void
1550dsp_cmx_send(void *arg) 1552dsp_cmx_send(void *arg)
diff --git a/drivers/isdn/mISDN/dsp_core.c b/drivers/isdn/mISDN/dsp_core.c
index 2f10ed82c0db..1dc21d803410 100644
--- a/drivers/isdn/mISDN/dsp_core.c
+++ b/drivers/isdn/mISDN/dsp_core.c
@@ -161,7 +161,7 @@
161#include "core.h" 161#include "core.h"
162#include "dsp.h" 162#include "dsp.h"
163 163
164const char *mISDN_dsp_revision = "2.0"; 164static const char *mISDN_dsp_revision = "2.0";
165 165
166static int debug; 166static int debug;
167static int options; 167static int options;
@@ -631,7 +631,6 @@ dsp_function(struct mISDNchannel *ch, struct sk_buff *skb)
631 int ret = 0; 631 int ret = 0;
632 u8 *digits; 632 u8 *digits;
633 int cont; 633 int cont;
634 struct sk_buff *nskb;
635 u_long flags; 634 u_long flags;
636 635
637 hh = mISDN_HEAD_P(skb); 636 hh = mISDN_HEAD_P(skb);
@@ -690,6 +689,7 @@ dsp_function(struct mISDNchannel *ch, struct sk_buff *skb)
690 digits = dsp_dtmf_goertzel_decode(dsp, skb->data, 689 digits = dsp_dtmf_goertzel_decode(dsp, skb->data,
691 skb->len, (dsp_options&DSP_OPT_ULAW)?1:0); 690 skb->len, (dsp_options&DSP_OPT_ULAW)?1:0);
692 while (*digits) { 691 while (*digits) {
692 struct sk_buff *nskb;
693 if (dsp_debug & DEBUG_DSP_DTMF) 693 if (dsp_debug & DEBUG_DSP_DTMF)
694 printk(KERN_DEBUG "%s: digit" 694 printk(KERN_DEBUG "%s: digit"
695 "(%c) to layer %s\n", 695 "(%c) to layer %s\n",
diff --git a/drivers/isdn/mISDN/dsp_hwec.c b/drivers/isdn/mISDN/dsp_hwec.c
index eb892d9dd5c6..806a997fe7cc 100644
--- a/drivers/isdn/mISDN/dsp_hwec.c
+++ b/drivers/isdn/mISDN/dsp_hwec.c
@@ -43,7 +43,7 @@ static struct mISDN_dsp_element dsp_hwec_p = {
43 .free = NULL, 43 .free = NULL,
44 .process_tx = NULL, 44 .process_tx = NULL,
45 .process_rx = NULL, 45 .process_rx = NULL,
46 .num_args = sizeof(args) / sizeof(struct mISDN_dsp_element_arg), 46 .num_args = ARRAY_SIZE(args),
47 .args = args, 47 .args = args,
48}; 48};
49struct mISDN_dsp_element *dsp_hwec = &dsp_hwec_p; 49struct mISDN_dsp_element *dsp_hwec = &dsp_hwec_p;
diff --git a/drivers/isdn/mISDN/dsp_pipeline.c b/drivers/isdn/mISDN/dsp_pipeline.c
index 850260ab57d0..5ee6651b45b9 100644
--- a/drivers/isdn/mISDN/dsp_pipeline.c
+++ b/drivers/isdn/mISDN/dsp_pipeline.c
@@ -249,7 +249,7 @@ int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg)
249 name = strsep(&tok, "("); 249 name = strsep(&tok, "(");
250 args = strsep(&tok, ")"); 250 args = strsep(&tok, ")");
251 if (args && !*args) 251 if (args && !*args)
252 args = 0; 252 args = NULL;
253 253
254 list_for_each_entry_safe(entry, n, &dsp_elements, list) 254 list_for_each_entry_safe(entry, n, &dsp_elements, list)
255 if (!strcmp(entry->elem->name, name)) { 255 if (!strcmp(entry->elem->name, name)) {
diff --git a/drivers/isdn/mISDN/dsp_tones.c b/drivers/isdn/mISDN/dsp_tones.c
index 23dd0dd21524..7a9af66f4b19 100644
--- a/drivers/isdn/mISDN/dsp_tones.c
+++ b/drivers/isdn/mISDN/dsp_tones.c
@@ -231,120 +231,120 @@ dsp_audio_generate_ulaw_samples(void)
231 * tone sequence definition * 231 * tone sequence definition *
232 ****************************/ 232 ****************************/
233 233
234struct pattern { 234static struct pattern {
235 int tone; 235 int tone;
236 u8 *data[10]; 236 u8 *data[10];
237 u32 *siz[10]; 237 u32 *siz[10];
238 u32 seq[10]; 238 u32 seq[10];
239} pattern[] = { 239} pattern[] = {
240 {TONE_GERMAN_DIALTONE, 240 {TONE_GERMAN_DIALTONE,
241 {DATA_GA, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 241 {DATA_GA, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
242 {SIZE_GA, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 242 {SIZE_GA, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
243 {1900, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 243 {1900, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
244 244
245 {TONE_GERMAN_OLDDIALTONE, 245 {TONE_GERMAN_OLDDIALTONE,
246 {DATA_GO, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 246 {DATA_GO, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
247 {SIZE_GO, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 247 {SIZE_GO, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
248 {1998, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 248 {1998, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
249 249
250 {TONE_AMERICAN_DIALTONE, 250 {TONE_AMERICAN_DIALTONE,
251 {DATA_DT, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 251 {DATA_DT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
252 {SIZE_DT, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 252 {SIZE_DT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
253 {8000, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 253 {8000, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
254 254
255 {TONE_GERMAN_DIALPBX, 255 {TONE_GERMAN_DIALPBX,
256 {DATA_GA, DATA_S, DATA_GA, DATA_S, DATA_GA, DATA_S, 0, 0, 0, 0}, 256 {DATA_GA, DATA_S, DATA_GA, DATA_S, DATA_GA, DATA_S, NULL, NULL, NULL, NULL},
257 {SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, 0, 0, 0, 0}, 257 {SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL},
258 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, 258 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} },
259 259
260 {TONE_GERMAN_OLDDIALPBX, 260 {TONE_GERMAN_OLDDIALPBX,
261 {DATA_GO, DATA_S, DATA_GO, DATA_S, DATA_GO, DATA_S, 0, 0, 0, 0}, 261 {DATA_GO, DATA_S, DATA_GO, DATA_S, DATA_GO, DATA_S, NULL, NULL, NULL, NULL},
262 {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, 0, 0, 0, 0}, 262 {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL},
263 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, 263 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} },
264 264
265 {TONE_AMERICAN_DIALPBX, 265 {TONE_AMERICAN_DIALPBX,
266 {DATA_DT, DATA_S, DATA_DT, DATA_S, DATA_DT, DATA_S, 0, 0, 0, 0}, 266 {DATA_DT, DATA_S, DATA_DT, DATA_S, DATA_DT, DATA_S, NULL, NULL, NULL, NULL},
267 {SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, 0, 0, 0, 0}, 267 {SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, NULL, NULL, NULL, NULL},
268 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, 268 {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} },
269 269
270 {TONE_GERMAN_RINGING, 270 {TONE_GERMAN_RINGING,
271 {DATA_GA, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 271 {DATA_GA, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
272 {SIZE_GA, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, 272 {SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
273 {8000, 32000, 0, 0, 0, 0, 0, 0, 0, 0} }, 273 {8000, 32000, 0, 0, 0, 0, 0, 0, 0, 0} },
274 274
275 {TONE_GERMAN_OLDRINGING, 275 {TONE_GERMAN_OLDRINGING,
276 {DATA_GO, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 276 {DATA_GO, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
277 {SIZE_GO, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, 277 {SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
278 {8000, 40000, 0, 0, 0, 0, 0, 0, 0, 0} }, 278 {8000, 40000, 0, 0, 0, 0, 0, 0, 0, 0} },
279 279
280 {TONE_AMERICAN_RINGING, 280 {TONE_AMERICAN_RINGING,
281 {DATA_RI, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 281 {DATA_RI, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
282 {SIZE_RI, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, 282 {SIZE_RI, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
283 {8000, 32000, 0, 0, 0, 0, 0, 0, 0, 0} }, 283 {8000, 32000, 0, 0, 0, 0, 0, 0, 0, 0} },
284 284
285 {TONE_GERMAN_RINGPBX, 285 {TONE_GERMAN_RINGPBX,
286 {DATA_GA, DATA_S, DATA_GA, DATA_S, 0, 0, 0, 0, 0, 0}, 286 {DATA_GA, DATA_S, DATA_GA, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL},
287 {SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, 0, 0, 0, 0, 0, 0}, 287 {SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL},
288 {4000, 4000, 4000, 28000, 0, 0, 0, 0, 0, 0} }, 288 {4000, 4000, 4000, 28000, 0, 0, 0, 0, 0, 0} },
289 289
290 {TONE_GERMAN_OLDRINGPBX, 290 {TONE_GERMAN_OLDRINGPBX,
291 {DATA_GO, DATA_S, DATA_GO, DATA_S, 0, 0, 0, 0, 0, 0}, 291 {DATA_GO, DATA_S, DATA_GO, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL},
292 {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, 0, 0, 0, 0, 0, 0}, 292 {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL},
293 {4000, 4000, 4000, 28000, 0, 0, 0, 0, 0, 0} }, 293 {4000, 4000, 4000, 28000, 0, 0, 0, 0, 0, 0} },
294 294
295 {TONE_AMERICAN_RINGPBX, 295 {TONE_AMERICAN_RINGPBX,
296 {DATA_RI, DATA_S, DATA_RI, DATA_S, 0, 0, 0, 0, 0, 0}, 296 {DATA_RI, DATA_S, DATA_RI, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL},
297 {SIZE_RI, SIZE_S, SIZE_RI, SIZE_S, 0, 0, 0, 0, 0, 0}, 297 {SIZE_RI, SIZE_S, SIZE_RI, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL},
298 {4000, 4000, 4000, 28000, 0, 0, 0, 0, 0, 0} }, 298 {4000, 4000, 4000, 28000, 0, 0, 0, 0, 0, 0} },
299 299
300 {TONE_GERMAN_BUSY, 300 {TONE_GERMAN_BUSY,
301 {DATA_GA, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 301 {DATA_GA, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
302 {SIZE_GA, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, 302 {SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
303 {4000, 4000, 0, 0, 0, 0, 0, 0, 0, 0} }, 303 {4000, 4000, 0, 0, 0, 0, 0, 0, 0, 0} },
304 304
305 {TONE_GERMAN_OLDBUSY, 305 {TONE_GERMAN_OLDBUSY,
306 {DATA_GO, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 306 {DATA_GO, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
307 {SIZE_GO, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, 307 {SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
308 {1000, 5000, 0, 0, 0, 0, 0, 0, 0, 0} }, 308 {1000, 5000, 0, 0, 0, 0, 0, 0, 0, 0} },
309 309
310 {TONE_AMERICAN_BUSY, 310 {TONE_AMERICAN_BUSY,
311 {DATA_BU, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 311 {DATA_BU, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
312 {SIZE_BU, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, 312 {SIZE_BU, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
313 {4000, 4000, 0, 0, 0, 0, 0, 0, 0, 0} }, 313 {4000, 4000, 0, 0, 0, 0, 0, 0, 0, 0} },
314 314
315 {TONE_GERMAN_HANGUP, 315 {TONE_GERMAN_HANGUP,
316 {DATA_GA, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 316 {DATA_GA, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
317 {SIZE_GA, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, 317 {SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
318 {4000, 4000, 0, 0, 0, 0, 0, 0, 0, 0} }, 318 {4000, 4000, 0, 0, 0, 0, 0, 0, 0, 0} },
319 319
320 {TONE_GERMAN_OLDHANGUP, 320 {TONE_GERMAN_OLDHANGUP,
321 {DATA_GO, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 321 {DATA_GO, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
322 {SIZE_GO, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, 322 {SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
323 {1000, 5000, 0, 0, 0, 0, 0, 0, 0, 0} }, 323 {1000, 5000, 0, 0, 0, 0, 0, 0, 0, 0} },
324 324
325 {TONE_AMERICAN_HANGUP, 325 {TONE_AMERICAN_HANGUP,
326 {DATA_DT, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 326 {DATA_DT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
327 {SIZE_DT, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 327 {SIZE_DT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
328 {8000, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 328 {8000, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
329 329
330 {TONE_SPECIAL_INFO, 330 {TONE_SPECIAL_INFO,
331 {DATA_S1, DATA_S2, DATA_S3, DATA_S, 0, 0, 0, 0, 0, 0}, 331 {DATA_S1, DATA_S2, DATA_S3, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL},
332 {SIZE_S1, SIZE_S2, SIZE_S3, SIZE_S, 0, 0, 0, 0, 0, 0}, 332 {SIZE_S1, SIZE_S2, SIZE_S3, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL},
333 {2666, 2666, 2666, 8002, 0, 0, 0, 0, 0, 0} }, 333 {2666, 2666, 2666, 8002, 0, 0, 0, 0, 0, 0} },
334 334
335 {TONE_GERMAN_GASSENBESETZT, 335 {TONE_GERMAN_GASSENBESETZT,
336 {DATA_GA, DATA_S, 0, 0, 0, 0, 0, 0, 0, 0}, 336 {DATA_GA, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
337 {SIZE_GA, SIZE_S, 0, 0, 0, 0, 0, 0, 0, 0}, 337 {SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
338 {2000, 2000, 0, 0, 0, 0, 0, 0, 0, 0} }, 338 {2000, 2000, 0, 0, 0, 0, 0, 0, 0, 0} },
339 339
340 {TONE_GERMAN_AUFSCHALTTON, 340 {TONE_GERMAN_AUFSCHALTTON,
341 {DATA_GO, DATA_S, DATA_GO, DATA_S, 0, 0, 0, 0, 0, 0}, 341 {DATA_GO, DATA_S, DATA_GO, DATA_S, NULL, NULL, NULL, NULL, NULL, NULL},
342 {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, 0, 0, 0, 0, 0, 0}, 342 {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL, NULL, NULL},
343 {1000, 5000, 1000, 17000, 0, 0, 0, 0, 0, 0} }, 343 {1000, 5000, 1000, 17000, 0, 0, 0, 0, 0, 0} },
344 344
345 {0, 345 {0,
346 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 346 {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
347 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 347 {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
348 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, 348 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
349}; 349};
350 350
@@ -467,7 +467,7 @@ dsp_tone_timeout(void *arg)
467 467
468 /* set next tone */ 468 /* set next tone */
469 if (pat->data[index] == DATA_S) 469 if (pat->data[index] == DATA_S)
470 dsp_tone_hw_message(dsp, 0, 0); 470 dsp_tone_hw_message(dsp, NULL, 0);
471 else 471 else
472 dsp_tone_hw_message(dsp, pat->data[index], *(pat->siz[index])); 472 dsp_tone_hw_message(dsp, pat->data[index], *(pat->siz[index]));
473 /* set timer */ 473 /* set timer */
diff --git a/drivers/isdn/mISDN/l1oip_codec.c b/drivers/isdn/mISDN/l1oip_codec.c
index a2dc4570ef43..2ec4b28d9edc 100644
--- a/drivers/isdn/mISDN/l1oip_codec.c
+++ b/drivers/isdn/mISDN/l1oip_codec.c
@@ -49,6 +49,7 @@ NOTE: The bytes are handled as they are law-encoded.
49#include <linux/vmalloc.h> 49#include <linux/vmalloc.h>
50#include <linux/mISDNif.h> 50#include <linux/mISDNif.h>
51#include "core.h" 51#include "core.h"
52#include "l1oip.h"
52 53
53/* definitions of codec. don't use calculations, code may run slower. */ 54/* definitions of codec. don't use calculations, code may run slower. */
54 55
diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c
index e42150a57780..0884dd6892f8 100644
--- a/drivers/isdn/mISDN/l1oip_core.c
+++ b/drivers/isdn/mISDN/l1oip_core.c
@@ -469,7 +469,7 @@ l1oip_socket_recv(struct l1oip *hc, u8 remotecodec, u8 channel, u16 timebase,
469static void 469static void
470l1oip_socket_parse(struct l1oip *hc, struct sockaddr_in *sin, u8 *buf, int len) 470l1oip_socket_parse(struct l1oip *hc, struct sockaddr_in *sin, u8 *buf, int len)
471{ 471{
472 u32 id; 472 u32 packet_id;
473 u8 channel; 473 u8 channel;
474 u8 remotecodec; 474 u8 remotecodec;
475 u16 timebase; 475 u16 timebase;
@@ -508,7 +508,7 @@ l1oip_socket_parse(struct l1oip *hc, struct sockaddr_in *sin, u8 *buf, int len)
508 } 508 }
509 509
510 /* get id flag */ 510 /* get id flag */
511 id = (*buf>>4)&1; 511 packet_id = (*buf>>4)&1;
512 512
513 /* check coding */ 513 /* check coding */
514 remotecodec = (*buf) & 0x0f; 514 remotecodec = (*buf) & 0x0f;
@@ -520,11 +520,11 @@ l1oip_socket_parse(struct l1oip *hc, struct sockaddr_in *sin, u8 *buf, int len)
520 buf++; 520 buf++;
521 len--; 521 len--;
522 522
523 /* check id */ 523 /* check packet_id */
524 if (id) { 524 if (packet_id) {
525 if (!hc->id) { 525 if (!hc->id) {
526 printk(KERN_WARNING "%s: packet error - packet has id " 526 printk(KERN_WARNING "%s: packet error - packet has id "
527 "0x%x, but we have not\n", __func__, id); 527 "0x%x, but we have not\n", __func__, packet_id);
528 return; 528 return;
529 } 529 }
530 if (len < 4) { 530 if (len < 4) {
@@ -532,16 +532,16 @@ l1oip_socket_parse(struct l1oip *hc, struct sockaddr_in *sin, u8 *buf, int len)
532 "short for ID value\n", __func__); 532 "short for ID value\n", __func__);
533 return; 533 return;
534 } 534 }
535 id = (*buf++) << 24; 535 packet_id = (*buf++) << 24;
536 id += (*buf++) << 16; 536 packet_id += (*buf++) << 16;
537 id += (*buf++) << 8; 537 packet_id += (*buf++) << 8;
538 id += (*buf++); 538 packet_id += (*buf++);
539 len -= 4; 539 len -= 4;
540 540
541 if (id != hc->id) { 541 if (packet_id != hc->id) {
542 printk(KERN_WARNING "%s: packet error - ID mismatch, " 542 printk(KERN_WARNING "%s: packet error - ID mismatch, "
543 "got 0x%x, we 0x%x\n", 543 "got 0x%x, we 0x%x\n",
544 __func__, id, hc->id); 544 __func__, packet_id, hc->id);
545 return; 545 return;
546 } 546 }
547 } else { 547 } else {
diff --git a/drivers/isdn/mISDN/layer1.c b/drivers/isdn/mISDN/layer1.c
index fced1a2755f8..b73e952d12cf 100644
--- a/drivers/isdn/mISDN/layer1.c
+++ b/drivers/isdn/mISDN/layer1.c
@@ -18,10 +18,11 @@
18 18
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/mISDNhw.h> 20#include <linux/mISDNhw.h>
21#include "core.h"
21#include "layer1.h" 22#include "layer1.h"
22#include "fsm.h" 23#include "fsm.h"
23 24
24static int *debug; 25static u_int *debug;
25 26
26struct layer1 { 27struct layer1 {
27 u_long Flags; 28 u_long Flags;
diff --git a/drivers/isdn/mISDN/layer2.c b/drivers/isdn/mISDN/layer2.c
index a7915a156c04..d6e2863f224a 100644
--- a/drivers/isdn/mISDN/layer2.c
+++ b/drivers/isdn/mISDN/layer2.c
@@ -15,10 +15,12 @@
15 * 15 *
16 */ 16 */
17 17
18#include <linux/mISDNif.h>
19#include "core.h"
18#include "fsm.h" 20#include "fsm.h"
19#include "layer2.h" 21#include "layer2.h"
20 22
21static int *debug; 23static u_int *debug;
22 24
23static 25static
24struct Fsm l2fsm = {NULL, 0, 0, NULL, NULL}; 26struct Fsm l2fsm = {NULL, 0, 0, NULL, NULL};
@@ -465,7 +467,7 @@ IsRNR(u_char *data, struct layer2 *l2)
465 data[0] == RNR : (data[0] & 0xf) == RNR; 467 data[0] == RNR : (data[0] & 0xf) == RNR;
466} 468}
467 469
468int 470static int
469iframe_error(struct layer2 *l2, struct sk_buff *skb) 471iframe_error(struct layer2 *l2, struct sk_buff *skb)
470{ 472{
471 u_int i; 473 u_int i;
@@ -483,7 +485,7 @@ iframe_error(struct layer2 *l2, struct sk_buff *skb)
483 return 0; 485 return 0;
484} 486}
485 487
486int 488static int
487super_error(struct layer2 *l2, struct sk_buff *skb) 489super_error(struct layer2 *l2, struct sk_buff *skb)
488{ 490{
489 if (skb->len != l2addrsize(l2) + 491 if (skb->len != l2addrsize(l2) +
@@ -492,7 +494,7 @@ super_error(struct layer2 *l2, struct sk_buff *skb)
492 return 0; 494 return 0;
493} 495}
494 496
495int 497static int
496unnum_error(struct layer2 *l2, struct sk_buff *skb, int wantrsp) 498unnum_error(struct layer2 *l2, struct sk_buff *skb, int wantrsp)
497{ 499{
498 int rsp = (*skb->data & 0x2) >> 1; 500 int rsp = (*skb->data & 0x2) >> 1;
@@ -505,7 +507,7 @@ unnum_error(struct layer2 *l2, struct sk_buff *skb, int wantrsp)
505 return 0; 507 return 0;
506} 508}
507 509
508int 510static int
509UI_error(struct layer2 *l2, struct sk_buff *skb) 511UI_error(struct layer2 *l2, struct sk_buff *skb)
510{ 512{
511 int rsp = *skb->data & 0x2; 513 int rsp = *skb->data & 0x2;
@@ -518,7 +520,7 @@ UI_error(struct layer2 *l2, struct sk_buff *skb)
518 return 0; 520 return 0;
519} 521}
520 522
521int 523static int
522FRMR_error(struct layer2 *l2, struct sk_buff *skb) 524FRMR_error(struct layer2 *l2, struct sk_buff *skb)
523{ 525{
524 u_int headers = l2addrsize(l2) + 1; 526 u_int headers = l2addrsize(l2) + 1;
@@ -1065,7 +1067,7 @@ l2_st6_dm_release(struct FsmInst *fi, int event, void *arg)
1065 } 1067 }
1066} 1068}
1067 1069
1068void 1070static void
1069enquiry_cr(struct layer2 *l2, u_char typ, u_char cr, u_char pf) 1071enquiry_cr(struct layer2 *l2, u_char typ, u_char cr, u_char pf)
1070{ 1072{
1071 struct sk_buff *skb; 1073 struct sk_buff *skb;
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index e5a20f9542d1..37a2de18cfd0 100644
--- a/drivers/isdn/mISDN/socket.c
+++ b/drivers/isdn/mISDN/socket.c
@@ -18,7 +18,7 @@
18#include <linux/mISDNif.h> 18#include <linux/mISDNif.h>
19#include "core.h" 19#include "core.h"
20 20
21static int *debug; 21static u_int *debug;
22 22
23static struct proto mISDN_proto = { 23static struct proto mISDN_proto = {
24 .name = "misdn", 24 .name = "misdn",
diff --git a/drivers/isdn/mISDN/stack.c b/drivers/isdn/mISDN/stack.c
index 54cfddcc4784..d55b14ae4e99 100644
--- a/drivers/isdn/mISDN/stack.c
+++ b/drivers/isdn/mISDN/stack.c
@@ -36,7 +36,7 @@ _queue_message(struct mISDNstack *st, struct sk_buff *skb)
36 } 36 }
37} 37}
38 38
39int 39static int
40mISDN_queue_message(struct mISDNchannel *ch, struct sk_buff *skb) 40mISDN_queue_message(struct mISDNchannel *ch, struct sk_buff *skb)
41{ 41{
42 _queue_message(ch->st, skb); 42 _queue_message(ch->st, skb);
diff --git a/drivers/isdn/mISDN/tei.c b/drivers/isdn/mISDN/tei.c
index 6fbae42127bf..5c43d19e7c11 100644
--- a/drivers/isdn/mISDN/tei.c
+++ b/drivers/isdn/mISDN/tei.c
@@ -393,7 +393,7 @@ dl_unit_data(struct manager *mgr, struct sk_buff *skb)
393 return 0; 393 return 0;
394} 394}
395 395
396unsigned int 396static unsigned int
397random_ri(void) 397random_ri(void)
398{ 398{
399 u16 x; 399 u16 x;
@@ -1287,7 +1287,7 @@ create_teimanager(struct mISDNdevice *dev)
1287 if (!mgr) 1287 if (!mgr)
1288 return -ENOMEM; 1288 return -ENOMEM;
1289 INIT_LIST_HEAD(&mgr->layer2); 1289 INIT_LIST_HEAD(&mgr->layer2);
1290 mgr->lock = __RW_LOCK_UNLOCKED(mgr->lock); 1290 rwlock_init(&mgr->lock);
1291 skb_queue_head_init(&mgr->sendq); 1291 skb_queue_head_init(&mgr->sendq);
1292 mgr->nextid = 1; 1292 mgr->nextid = 1;
1293 mgr->lastid = MISDN_ID_NONE; 1293 mgr->lastid = MISDN_ID_NONE;
diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c
index 875fabe16e36..f2b32186d4a1 100644
--- a/drivers/isdn/mISDN/timerdev.c
+++ b/drivers/isdn/mISDN/timerdev.c
@@ -23,8 +23,9 @@
23#include <linux/miscdevice.h> 23#include <linux/miscdevice.h>
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/mISDNif.h> 25#include <linux/mISDNif.h>
26#include "core.h"
26 27
27static int *debug; 28static u_int *debug;
28 29
29 30
30struct mISDNtimerdev { 31struct mISDNtimerdev {
@@ -85,7 +86,7 @@ mISDN_close(struct inode *ino, struct file *filep)
85} 86}
86 87
87static ssize_t 88static ssize_t
88mISDN_read(struct file *filep, char *buf, size_t count, loff_t *off) 89mISDN_read(struct file *filep, char __user *buf, size_t count, loff_t *off)
89{ 90{
90 struct mISDNtimerdev *dev = filep->private_data; 91 struct mISDNtimerdev *dev = filep->private_data;
91 struct mISDNtimer *timer; 92 struct mISDNtimer *timer;
@@ -115,7 +116,7 @@ mISDN_read(struct file *filep, char *buf, size_t count, loff_t *off)
115 timer = (struct mISDNtimer *)dev->expired.next; 116 timer = (struct mISDNtimer *)dev->expired.next;
116 list_del(&timer->list); 117 list_del(&timer->list);
117 spin_unlock_irqrestore(&dev->lock, flags); 118 spin_unlock_irqrestore(&dev->lock, flags);
118 if (put_user(timer->id, (int *)buf)) 119 if (put_user(timer->id, (int __user *)buf))
119 ret = -EFAULT; 120 ret = -EFAULT;
120 else 121 else
121 ret = sizeof(int); 122 ret = sizeof(int);
@@ -274,7 +275,7 @@ static struct miscdevice mISDNtimer = {
274}; 275};
275 276
276int 277int
277mISDN_inittimer(int *deb) 278mISDN_inittimer(u_int *deb)
278{ 279{
279 int err; 280 int err;
280 281