aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/isdn/sc/Makefile2
-rw-r--r--drivers/isdn/sc/command.c88
-rw-r--r--drivers/isdn/sc/debug.c46
-rw-r--r--drivers/isdn/sc/init.c21
-rw-r--r--drivers/isdn/sc/interrupt.c2
-rw-r--r--drivers/isdn/sc/ioctl.c5
-rw-r--r--drivers/isdn/sc/packet.c16
-rw-r--r--drivers/isdn/sc/shmem.c2
-rw-r--r--drivers/isdn/sc/timer.c18
9 files changed, 27 insertions, 173 deletions
diff --git a/drivers/isdn/sc/Makefile b/drivers/isdn/sc/Makefile
index 9cc474cd0c44..0f2b7d602ac0 100644
--- a/drivers/isdn/sc/Makefile
+++ b/drivers/isdn/sc/Makefile
@@ -6,5 +6,5 @@ obj-$(CONFIG_ISDN_DRV_SC) += sc.o
6 6
7# Multipart objects. 7# Multipart objects.
8 8
9sc-y := shmem.o init.o debug.o packet.o command.o event.o \ 9sc-y := shmem.o init.o packet.o command.o event.o \
10 ioctl.o interrupt.o message.o timer.o 10 ioctl.o interrupt.o message.o timer.o
diff --git a/drivers/isdn/sc/command.c b/drivers/isdn/sc/command.c
index b2c4eac7cef5..19f2fcf0ae4a 100644
--- a/drivers/isdn/sc/command.c
+++ b/drivers/isdn/sc/command.c
@@ -22,14 +22,14 @@
22#include "card.h" 22#include "card.h"
23#include "scioc.h" 23#include "scioc.h"
24 24
25int dial(int card, unsigned long channel, setup_parm setup); 25static int dial(int card, unsigned long channel, setup_parm setup);
26int hangup(int card, unsigned long channel); 26static int hangup(int card, unsigned long channel);
27int answer(int card, unsigned long channel); 27static int answer(int card, unsigned long channel);
28int clreaz(int card, unsigned long channel); 28static int clreaz(int card, unsigned long channel);
29int seteaz(int card, unsigned long channel, char *); 29static int seteaz(int card, unsigned long channel, char *);
30int setl2(int card, unsigned long arg); 30static int setl2(int card, unsigned long arg);
31int setl3(int card, unsigned long arg); 31static int setl3(int card, unsigned long arg);
32int acceptb(int card, unsigned long channel); 32static int acceptb(int card, unsigned long channel);
33 33
34extern int cinst; 34extern int cinst;
35extern board *sc_adapter[]; 35extern board *sc_adapter[];
@@ -148,56 +148,6 @@ int command(isdn_ctrl *cmd)
148} 148}
149 149
150/* 150/*
151 * Confirm our ability to communicate with the board. This test assumes no
152 * other message activity is present
153 */
154int loopback(int card)
155{
156
157 int status;
158 static char testmsg[] = "Test Message";
159 RspMessage rspmsg;
160
161 if(!IS_VALID_CARD(card)) {
162 pr_debug("Invalid param: %d is not a valid card id\n", card);
163 return -ENODEV;
164 }
165
166 pr_debug("%s: Sending loopback message\n",
167 sc_adapter[card]->devicename);
168
169 /*
170 * Send the loopback message to confirm that memory transfer is
171 * operational
172 */
173 status = send_and_receive(card, CMPID, cmReqType1,
174 cmReqClass0,
175 cmReqMsgLpbk,
176 0,
177 (unsigned char) strlen(testmsg),
178 (unsigned char *)testmsg,
179 &rspmsg, SAR_TIMEOUT);
180
181
182 if (!status) {
183 pr_debug("%s: Loopback message successfully sent\n",
184 sc_adapter[card]->devicename);
185 if(strcmp(rspmsg.msg_data.byte_array, testmsg)) {
186 pr_debug("%s: Loopback return != sent\n",
187 sc_adapter[card]->devicename);
188 return -EIO;
189 }
190 return 0;
191 }
192 else {
193 pr_debug("%s: Send loopback message failed\n",
194 sc_adapter[card]->devicename);
195 return -EIO;
196 }
197
198}
199
200/*
201 * start the onboard firmware 151 * start the onboard firmware
202 */ 152 */
203int startproc(int card) 153int startproc(int card)
@@ -222,16 +172,10 @@ int startproc(int card)
222} 172}
223 173
224 174
225int loadproc(int card, char *data)
226{
227 return -1;
228}
229
230
231/* 175/*
232 * Dials the number passed in 176 * Dials the number passed in
233 */ 177 */
234int dial(int card, unsigned long channel, setup_parm setup) 178static int dial(int card, unsigned long channel, setup_parm setup)
235{ 179{
236 int status; 180 int status;
237 char Phone[48]; 181 char Phone[48];
@@ -261,7 +205,7 @@ int dial(int card, unsigned long channel, setup_parm setup)
261/* 205/*
262 * Answer an incoming call 206 * Answer an incoming call
263 */ 207 */
264int answer(int card, unsigned long channel) 208static int answer(int card, unsigned long channel)
265{ 209{
266 if(!IS_VALID_CARD(card)) { 210 if(!IS_VALID_CARD(card)) {
267 pr_debug("Invalid param: %d is not a valid card id\n", card); 211 pr_debug("Invalid param: %d is not a valid card id\n", card);
@@ -282,7 +226,7 @@ int answer(int card, unsigned long channel)
282/* 226/*
283 * Hangup up the call on specified channel 227 * Hangup up the call on specified channel
284 */ 228 */
285int hangup(int card, unsigned long channel) 229static int hangup(int card, unsigned long channel)
286{ 230{
287 int status; 231 int status;
288 232
@@ -305,7 +249,7 @@ int hangup(int card, unsigned long channel)
305/* 249/*
306 * Set the layer 2 protocol (X.25, HDLC, Raw) 250 * Set the layer 2 protocol (X.25, HDLC, Raw)
307 */ 251 */
308int setl2(int card, unsigned long arg) 252static int setl2(int card, unsigned long arg)
309{ 253{
310 int status =0; 254 int status =0;
311 int protocol,channel; 255 int protocol,channel;
@@ -340,7 +284,7 @@ int setl2(int card, unsigned long arg)
340/* 284/*
341 * Set the layer 3 protocol 285 * Set the layer 3 protocol
342 */ 286 */
343int setl3(int card, unsigned long channel) 287static int setl3(int card, unsigned long channel)
344{ 288{
345 int protocol = channel >> 8; 289 int protocol = channel >> 8;
346 290
@@ -355,7 +299,7 @@ int setl3(int card, unsigned long channel)
355 return 0; 299 return 0;
356} 300}
357 301
358int acceptb(int card, unsigned long channel) 302static int acceptb(int card, unsigned long channel)
359{ 303{
360 if(!IS_VALID_CARD(card)) { 304 if(!IS_VALID_CARD(card)) {
361 pr_debug("Invalid param: %d is not a valid card id\n", card); 305 pr_debug("Invalid param: %d is not a valid card id\n", card);
@@ -374,7 +318,7 @@ int acceptb(int card, unsigned long channel)
374 return 0; 318 return 0;
375} 319}
376 320
377int clreaz(int card, unsigned long arg) 321static int clreaz(int card, unsigned long arg)
378{ 322{
379 if(!IS_VALID_CARD(card)) { 323 if(!IS_VALID_CARD(card)) {
380 pr_debug("Invalid param: %d is not a valid card id\n", card); 324 pr_debug("Invalid param: %d is not a valid card id\n", card);
@@ -388,7 +332,7 @@ int clreaz(int card, unsigned long arg)
388 return 0; 332 return 0;
389} 333}
390 334
391int seteaz(int card, unsigned long arg, char *num) 335static int seteaz(int card, unsigned long arg, char *num)
392{ 336{
393 if(!IS_VALID_CARD(card)) { 337 if(!IS_VALID_CARD(card)) {
394 pr_debug("Invalid param: %d is not a valid card id\n", card); 338 pr_debug("Invalid param: %d is not a valid card id\n", card);
diff --git a/drivers/isdn/sc/debug.c b/drivers/isdn/sc/debug.c
deleted file mode 100644
index 1a992a75868b..000000000000
--- a/drivers/isdn/sc/debug.c
+++ /dev/null
@@ -1,46 +0,0 @@
1/* $Id: debug.c,v 1.5.6.1 2001/09/23 22:24:59 kai Exp $
2 *
3 * Copyright (C) 1996 SpellCaster Telecommunications Inc.
4 *
5 * This software may be used and distributed according to the terms
6 * of the GNU General Public License, incorporated herein by reference.
7 *
8 * For more information, please contact gpl-info@spellcast.com or write:
9 *
10 * SpellCaster Telecommunications Inc.
11 * 5621 Finch Avenue East, Unit #3
12 * Scarborough, Ontario Canada
13 * M1B 2T9
14 * +1 (416) 297-8565
15 * +1 (416) 297-6433 Facsimile
16 */
17
18#include <linux/kernel.h>
19#include <linux/string.h>
20
21int dbg_level = 0;
22static char dbg_funcname[255];
23
24void dbg_endfunc(void)
25{
26 if (dbg_level) {
27 printk("<-- Leaving function %s\n", dbg_funcname);
28 strcpy(dbg_funcname, "");
29 }
30}
31
32void dbg_func(char *func)
33{
34 strcpy(dbg_funcname, func);
35 if(dbg_level)
36 printk("--> Entering function %s\n", dbg_funcname);
37}
38
39inline void pullphone(char *dn, char *str)
40{
41 int i = 0;
42
43 while(dn[i] != ',')
44 str[i] = dn[i], i++;
45 str[i] = 0x0;
46}
diff --git a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c
index efefedea37b9..40b0df04ed9f 100644
--- a/drivers/isdn/sc/init.c
+++ b/drivers/isdn/sc/init.c
@@ -20,9 +20,9 @@ board *sc_adapter[MAX_CARDS];
20int cinst; 20int cinst;
21 21
22static char devname[] = "scX"; 22static char devname[] = "scX";
23const char version[] = "2.0b1"; 23static const char version[] = "2.0b1";
24 24
25const char *boardname[] = { "DataCommute/BRI", "DataCommute/PRI", "TeleCommute/BRI" }; 25static const char *boardname[] = { "DataCommute/BRI", "DataCommute/PRI", "TeleCommute/BRI" };
26 26
27/* insmod set parameters */ 27/* insmod set parameters */
28static unsigned int io[] = {0,0,0,0}; 28static unsigned int io[] = {0,0,0,0};
@@ -35,26 +35,13 @@ module_param_array(irq, int, NULL, 0);
35module_param_array(ram, int, NULL, 0); 35module_param_array(ram, int, NULL, 0);
36module_param(do_reset, bool, 0); 36module_param(do_reset, bool, 0);
37 37
38static int sup_irq[] = { 11, 10, 9, 5, 12, 14, 7, 3, 4, 6 };
39#define MAX_IRQS 10
40
41extern irqreturn_t interrupt_handler(int, void *, struct pt_regs *); 38extern irqreturn_t interrupt_handler(int, void *, struct pt_regs *);
42extern int sndpkt(int, int, int, struct sk_buff *); 39extern int sndpkt(int, int, int, struct sk_buff *);
43extern int command(isdn_ctrl *); 40extern int command(isdn_ctrl *);
44extern int indicate_status(int, int, ulong, char*); 41extern int indicate_status(int, int, ulong, char*);
45extern int reset(int); 42extern int reset(int);
46 43
47int identify_board(unsigned long, unsigned int); 44static int identify_board(unsigned long, unsigned int);
48
49int irq_supported(int irq_x)
50{
51 int i;
52 for(i=0 ; i < MAX_IRQS ; i++) {
53 if(sup_irq[i] == irq_x)
54 return 1;
55 }
56 return 0;
57}
58 45
59static int __init sc_init(void) 46static int __init sc_init(void)
60{ 47{
@@ -454,7 +441,7 @@ static void __exit sc_exit(void)
454 pr_info("SpellCaster ISA ISDN Adapter Driver Unloaded.\n"); 441 pr_info("SpellCaster ISA ISDN Adapter Driver Unloaded.\n");
455} 442}
456 443
457int identify_board(unsigned long rambase, unsigned int iobase) 444static int identify_board(unsigned long rambase, unsigned int iobase)
458{ 445{
459 unsigned int pgport; 446 unsigned int pgport;
460 unsigned long sig; 447 unsigned long sig;
diff --git a/drivers/isdn/sc/interrupt.c b/drivers/isdn/sc/interrupt.c
index e5e164aca7fa..8631d338d69a 100644
--- a/drivers/isdn/sc/interrupt.c
+++ b/drivers/isdn/sc/interrupt.c
@@ -31,7 +31,7 @@ extern void rcvpkt(int, RspMessage *);
31extern int cinst; 31extern int cinst;
32extern board *sc_adapter[]; 32extern board *sc_adapter[];
33 33
34int get_card_from_irq(int irq) 34static int get_card_from_irq(int irq)
35{ 35{
36 int i; 36 int i;
37 37
diff --git a/drivers/isdn/sc/ioctl.c b/drivers/isdn/sc/ioctl.c
index 1371a990416a..3314a5a19854 100644
--- a/drivers/isdn/sc/ioctl.c
+++ b/drivers/isdn/sc/ioctl.c
@@ -14,7 +14,6 @@
14 14
15extern int indicate_status(int, int, unsigned long, char *); 15extern int indicate_status(int, int, unsigned long, char *);
16extern int startproc(int); 16extern int startproc(int);
17extern int loadproc(int, char *record);
18extern int reset(int); 17extern int reset(int);
19extern int send_and_receive(int, unsigned int, unsigned char,unsigned char, 18extern int send_and_receive(int, unsigned int, unsigned char,unsigned char,
20 unsigned char,unsigned char, 19 unsigned char,unsigned char,
@@ -23,7 +22,7 @@ extern int send_and_receive(int, unsigned int, unsigned char,unsigned char,
23extern board *sc_adapter[]; 22extern board *sc_adapter[];
24 23
25 24
26int GetStatus(int card, boardInfo *); 25static int GetStatus(int card, boardInfo *);
27 26
28/* 27/*
29 * Process private IOCTL messages (typically from scctrl) 28 * Process private IOCTL messages (typically from scctrl)
@@ -428,7 +427,7 @@ int sc_ioctl(int card, scs_ioctl *data)
428 return 0; 427 return 0;
429} 428}
430 429
431int GetStatus(int card, boardInfo *bi) 430static int GetStatus(int card, boardInfo *bi)
432{ 431{
433 RspMessage rcvmsg; 432 RspMessage rcvmsg;
434 int i, status; 433 int i, status;
diff --git a/drivers/isdn/sc/packet.c b/drivers/isdn/sc/packet.c
index 8e3fac3ba1a1..f50defc38ae5 100644
--- a/drivers/isdn/sc/packet.c
+++ b/drivers/isdn/sc/packet.c
@@ -213,19 +213,3 @@ int setup_buffers(int card, int c)
213 return 0; 213 return 0;
214} 214}
215 215
216int print_skb(int card,char *skb_p, int len){
217 int i,data;
218 pr_debug("%s: data at 0x%x len: 0x%x\n", sc_adapter[card]->devicename,
219 skb_p,len);
220 for(i=1;i<=len;i++,skb_p++){
221 data = (int) (0xff & (*skb_p));
222 pr_debug("%s: data = 0x%x", sc_adapter[card]->devicename,data);
223 if(!(i%4))
224 pr_debug(" ");
225 if(!(i%32))
226 pr_debug("\n");
227 }
228 pr_debug("\n");
229 return 0;
230}
231
diff --git a/drivers/isdn/sc/shmem.c b/drivers/isdn/sc/shmem.c
index 7bc2dfad0775..24854826ca45 100644
--- a/drivers/isdn/sc/shmem.c
+++ b/drivers/isdn/sc/shmem.c
@@ -108,6 +108,7 @@ void memcpy_fromshmem(int card, void *dest, const void *src, size_t n)
108 sc_adapter[card]->rambase + ((unsigned long) src %0x4000), (unsigned long) dest); */ 108 sc_adapter[card]->rambase + ((unsigned long) src %0x4000), (unsigned long) dest); */
109} 109}
110 110
111#if 0
111void memset_shmem(int card, void *dest, int c, size_t n) 112void memset_shmem(int card, void *dest, int c, size_t n)
112{ 113{
113 unsigned long flags; 114 unsigned long flags;
@@ -141,3 +142,4 @@ void memset_shmem(int card, void *dest, int c, size_t n)
141 ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80); 142 ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80);
142 spin_unlock_irqrestore(&sc_adapter[card]->lock, flags); 143 spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
143} 144}
145#endif /* 0 */
diff --git a/drivers/isdn/sc/timer.c b/drivers/isdn/sc/timer.c
index 710d0f47ca35..aced19aac5a2 100644
--- a/drivers/isdn/sc/timer.c
+++ b/drivers/isdn/sc/timer.c
@@ -32,7 +32,7 @@ extern int sendmessage(int, unsigned int, unsigned int, unsigned int,
32/* 32/*
33 * Write the proper values into the I/O ports following a reset 33 * Write the proper values into the I/O ports following a reset
34 */ 34 */
35void setup_ports(int card) 35static void setup_ports(int card)
36{ 36{
37 37
38 outb((sc_adapter[card]->rambase >> 12), sc_adapter[card]->ioport[EXP_BASE]); 38 outb((sc_adapter[card]->rambase >> 12), sc_adapter[card]->ioport[EXP_BASE]);
@@ -129,19 +129,3 @@ void check_phystat(unsigned long data)
129 ceReqPhyStatus,0,0,NULL); 129 ceReqPhyStatus,0,0,NULL);
130} 130}
131 131
132/*
133 * When in trace mode, this callback is used to swap the working shared
134 * RAM page to the trace page(s) and process all received messages. It
135 * must be called often enough to get all of the messages out of RAM before
136 * it loops around.
137 * Trace messages are \n terminated strings.
138 * We output the messages in 64 byte chunks through readstat. Each chunk
139 * is scanned for a \n followed by a time stamp. If the timerstamp is older
140 * than the current time, scanning stops and the page and offset are recorded
141 * as the starting point the next time the trace timer is called. The final
142 * step is to restore the working page and reset the timer.
143 */
144void trace_timer(unsigned long data)
145{
146 /* not implemented */
147}