summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/sc/debug.c
blob: 3a814de931bb9e2b7c11671adc83af4a92bdf553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
 *  $Id: debug.c,v 1.2 1996/11/20 17:49:50 fritz Exp $
 *  Copyright (C) 1996  SpellCaster Telecommunications Inc.
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *  For more information, please contact gpl-info@spellcast.com or write:
 *
 *     SpellCaster Telecommunications Inc.
 *     5621 Finch Avenue East, Unit #3
 *     Scarborough, Ontario  Canada
 *     M1B 2T9
 *     +1 (416) 297-8565
 *     +1 (416) 297-6433 Facsimile
 */
#include <linux/kernel.h>

#define NULL	0x0

#if LINUX_VERSION_CODE < 66363	/* Linux 1.3.59 there was a change to interrupts */
	#define REQUEST_IRQ(a,b,c,d,e) request_irq(a,b,c,d)
	#define FREE_IRQ(a,b) free_irq(a)
#else
	#define REQUEST_IRQ(a,b,c,d,e) request_irq(a,b,c,d,e)
	#define FREE_IRQ(a,b) free_irq(a,b)
#endif

inline char *strcpy(char *, const char *);

int dbg_level = 0;
static char dbg_funcname[255];

void dbg_endfunc(void)
{
	if (dbg_level) {
		printk("<-- Leaving function %s\n", dbg_funcname);
		strcpy(dbg_funcname, "");
	}
}

void dbg_func(char *func)
{
	strcpy(dbg_funcname, func);
	if(dbg_level)
		printk("--> Entering function %s\n", dbg_funcname);
}

inline char *strcpy(char *dest, const char *src)
{
	char *i = dest;
	char *j = (char *) src;

	while(*j) {
		*i = *j;
		i++; j++;
	}
	*(++i) = NULL;
	return dest;
}

inline void pullphone(char *dn, char *str)
{
	int i = 0;

	while(dn[i] != ',')
		str[i] = dn[i++];
	str[i] = 0x0;
}