Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
248c1097
Commit
248c1097
authored
Apr 30, 2002
by
Kai Germaschewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ISDN cleanup: drivers/isdn/capi s/__u{32,16,8}/u{32,16,8}/
parent
9dbf0015
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
141 additions
and
141 deletions
+141
-141
drivers/isdn/capi/capidrv.c
drivers/isdn/capi/capidrv.c
+69
-69
drivers/isdn/capi/capiutil.c
drivers/isdn/capi/capiutil.c
+30
-30
drivers/isdn/capi/kcapi.c
drivers/isdn/capi/kcapi.c
+42
-42
No files found.
drivers/isdn/capi/capidrv.c
View file @
248c1097
...
@@ -49,7 +49,7 @@ struct capidrv_contr {
...
@@ -49,7 +49,7 @@ struct capidrv_contr {
struct
capidrv_contr
*
next
;
struct
capidrv_contr
*
next
;
__
u32
contrnr
;
u32
contrnr
;
char
name
[
20
];
char
name
[
20
];
/*
/*
...
@@ -62,14 +62,14 @@ struct capidrv_contr {
...
@@ -62,14 +62,14 @@ struct capidrv_contr {
* LISTEN state
* LISTEN state
*/
*/
int
state
;
int
state
;
__
u32
cipmask
;
u32
cipmask
;
__
u32
cipmask2
;
u32
cipmask2
;
struct
timer_list
listentimer
;
struct
timer_list
listentimer
;
/*
/*
* ID of capi message sent
* ID of capi message sent
*/
*/
__
u16
msgid
;
u16
msgid
;
/*
/*
* B-Channels
* B-Channels
...
@@ -77,36 +77,36 @@ struct capidrv_contr {
...
@@ -77,36 +77,36 @@ struct capidrv_contr {
int
nbchan
;
int
nbchan
;
struct
capidrv_bchan
{
struct
capidrv_bchan
{
struct
capidrv_contr
*
contr
;
struct
capidrv_contr
*
contr
;
__
u8
msn
[
ISDN_MSNLEN
];
u8
msn
[
ISDN_MSNLEN
];
int
l2
;
int
l2
;
int
l3
;
int
l3
;
__
u8
num
[
ISDN_MSNLEN
];
u8
num
[
ISDN_MSNLEN
];
__
u8
mynum
[
ISDN_MSNLEN
];
u8
mynum
[
ISDN_MSNLEN
];
int
si1
;
int
si1
;
int
si2
;
int
si2
;
int
incoming
;
int
incoming
;
int
disconnecting
;
int
disconnecting
;
struct
capidrv_plci
{
struct
capidrv_plci
{
struct
capidrv_plci
*
next
;
struct
capidrv_plci
*
next
;
__
u32
plci
;
u32
plci
;
__
u32
ncci
;
/* ncci for CONNECT_ACTIVE_IND */
u32
ncci
;
/* ncci for CONNECT_ACTIVE_IND */
__
u16
msgid
;
/* to identfy CONNECT_CONF */
u16
msgid
;
/* to identfy CONNECT_CONF */
int
chan
;
int
chan
;
int
state
;
int
state
;
int
leasedline
;
int
leasedline
;
struct
capidrv_ncci
{
struct
capidrv_ncci
{
struct
capidrv_ncci
*
next
;
struct
capidrv_ncci
*
next
;
struct
capidrv_plci
*
plcip
;
struct
capidrv_plci
*
plcip
;
__
u32
ncci
;
u32
ncci
;
__
u16
msgid
;
/* to identfy CONNECT_B3_CONF */
u16
msgid
;
/* to identfy CONNECT_B3_CONF */
int
chan
;
int
chan
;
int
state
;
int
state
;
int
oldstate
;
int
oldstate
;
/* */
/* */
__
u16
datahandle
;
u16
datahandle
;
struct
ncci_datahandle_queue
{
struct
ncci_datahandle_queue
{
struct
ncci_datahandle_queue
*
next
;
struct
ncci_datahandle_queue
*
next
;
__
u16
datahandle
;
u16
datahandle
;
int
len
;
int
len
;
}
*
ackqueue
;
}
*
ackqueue
;
}
*
ncci_list
;
}
*
ncci_list
;
...
@@ -117,15 +117,15 @@ struct capidrv_contr {
...
@@ -117,15 +117,15 @@ struct capidrv_contr {
struct
capidrv_plci
*
plci_list
;
struct
capidrv_plci
*
plci_list
;
/* for q931 data */
/* for q931 data */
__
u8
q931_buf
[
4096
];
u8
q931_buf
[
4096
];
__
u8
*
q931_read
;
u8
*
q931_read
;
__
u8
*
q931_write
;
u8
*
q931_write
;
__
u8
*
q931_end
;
u8
*
q931_end
;
};
};
struct
capidrv_data
{
struct
capidrv_data
{
__
u16
appid
;
u16
appid
;
int
ncontr
;
int
ncontr
;
struct
capidrv_contr
*
contr_list
;
struct
capidrv_contr
*
contr_list
;
...
@@ -149,11 +149,11 @@ static spinlock_t global_lock = SPIN_LOCK_UNLOCKED;
...
@@ -149,11 +149,11 @@ static spinlock_t global_lock = SPIN_LOCK_UNLOCKED;
static
struct
capi_interface
*
capifuncs
;
static
struct
capi_interface
*
capifuncs
;
static
void
handle_dtrace_data
(
capidrv_contr
*
card
,
static
void
handle_dtrace_data
(
capidrv_contr
*
card
,
int
send
,
int
level2
,
__u8
*
data
,
__
u16
len
);
int
send
,
int
level2
,
u8
*
data
,
u16
len
);
/* -------- convert functions ---------------------------------------- */
/* -------- convert functions ---------------------------------------- */
static
inline
__
u32
b1prot
(
int
l2
,
int
l3
)
static
inline
u32
b1prot
(
int
l2
,
int
l3
)
{
{
switch
(
l2
)
{
switch
(
l2
)
{
case
ISDN_PROTO_L2_X75I
:
case
ISDN_PROTO_L2_X75I
:
...
@@ -176,7 +176,7 @@ static inline __u32 b1prot(int l2, int l3)
...
@@ -176,7 +176,7 @@ static inline __u32 b1prot(int l2, int l3)
}
}
}
}
static
inline
__
u32
b2prot
(
int
l2
,
int
l3
)
static
inline
u32
b2prot
(
int
l2
,
int
l3
)
{
{
switch
(
l2
)
{
switch
(
l2
)
{
case
ISDN_PROTO_L2_X75I
:
case
ISDN_PROTO_L2_X75I
:
...
@@ -196,7 +196,7 @@ static inline __u32 b2prot(int l2, int l3)
...
@@ -196,7 +196,7 @@ static inline __u32 b2prot(int l2, int l3)
}
}
}
}
static
inline
__
u32
b3prot
(
int
l2
,
int
l3
)
static
inline
u32
b3prot
(
int
l2
,
int
l3
)
{
{
switch
(
l2
)
{
switch
(
l2
)
{
case
ISDN_PROTO_L2_X75I
:
case
ISDN_PROTO_L2_X75I
:
...
@@ -215,7 +215,7 @@ static inline __u32 b3prot(int l2, int l3)
...
@@ -215,7 +215,7 @@ static inline __u32 b3prot(int l2, int l3)
}
}
}
}
static
_cstruct
b1config_async_v110
(
__
u16
rate
)
static
_cstruct
b1config_async_v110
(
u16
rate
)
{
{
/* CAPI-Spec "B1 Configuration" */
/* CAPI-Spec "B1 Configuration" */
static
unsigned
char
buf
[
9
];
static
unsigned
char
buf
[
9
];
...
@@ -247,9 +247,9 @@ static _cstruct b1config(int l2, int l3)
...
@@ -247,9 +247,9 @@ static _cstruct b1config(int l2, int l3)
}
}
}
}
static
inline
__u16
si2cip
(
__u8
si1
,
__
u8
si2
)
static
inline
u16
si2cip
(
u8
si1
,
u8
si2
)
{
{
static
const
__
u8
cip
[
17
][
5
]
=
static
const
u8
cip
[
17
][
5
]
=
{
{
/* 0 1 2 3 4 */
/* 0 1 2 3 4 */
{
0
,
0
,
0
,
0
,
0
},
/*0 */
{
0
,
0
,
0
,
0
,
0
},
/*0 */
...
@@ -275,12 +275,12 @@ static inline __u16 si2cip(__u8 si1, __u8 si2)
...
@@ -275,12 +275,12 @@ static inline __u16 si2cip(__u8 si1, __u8 si2)
if
(
si2
>
4
)
if
(
si2
>
4
)
si2
=
0
;
si2
=
0
;
return
(
__
u16
)
cip
[
si1
][
si2
];
return
(
u16
)
cip
[
si1
][
si2
];
}
}
static
inline
__u8
cip2si1
(
__
u16
cipval
)
static
inline
u8
cip2si1
(
u16
cipval
)
{
{
static
const
__
u8
si
[
32
]
=
static
const
u8
si
[
32
]
=
{
7
,
1
,
7
,
7
,
1
,
1
,
7
,
7
,
/*0-7 */
{
7
,
1
,
7
,
7
,
1
,
1
,
7
,
7
,
/*0-7 */
7
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
/*8-15 */
7
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
/*8-15 */
1
,
2
,
4
,
10
,
9
,
9
,
15
,
7
,
/*16-23 */
1
,
2
,
4
,
10
,
9
,
9
,
15
,
7
,
/*16-23 */
...
@@ -291,9 +291,9 @@ static inline __u8 cip2si1(__u16 cipval)
...
@@ -291,9 +291,9 @@ static inline __u8 cip2si1(__u16 cipval)
return
si
[
cipval
];
return
si
[
cipval
];
}
}
static
inline
__u8
cip2si2
(
__
u16
cipval
)
static
inline
u8
cip2si2
(
u16
cipval
)
{
{
static
const
__
u8
si
[
32
]
=
static
const
u8
si
[
32
]
=
{
0
,
0
,
0
,
0
,
2
,
3
,
0
,
0
,
/*0-7 */
{
0
,
0
,
0
,
0
,
2
,
3
,
0
,
0
,
/*0-7 */
0
,
3
,
0
,
0
,
0
,
0
,
0
,
0
,
/*8-15 */
0
,
3
,
0
,
0
,
0
,
0
,
0
,
0
,
/*8-15 */
1
,
2
,
0
,
0
,
9
,
0
,
0
,
0
,
/*16-23 */
1
,
2
,
0
,
0
,
9
,
0
,
0
,
0
,
/*16-23 */
...
@@ -320,7 +320,7 @@ static inline capidrv_contr *findcontrbydriverid(int driverid)
...
@@ -320,7 +320,7 @@ static inline capidrv_contr *findcontrbydriverid(int driverid)
return
p
;
return
p
;
}
}
static
capidrv_contr
*
findcontrbynumber
(
__
u32
contr
)
static
capidrv_contr
*
findcontrbynumber
(
u32
contr
)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
capidrv_contr
*
p
=
global
.
contr_list
;
capidrv_contr
*
p
=
global
.
contr_list
;
...
@@ -357,7 +357,7 @@ static capidrv_plci *new_plci(capidrv_contr * card, int chan)
...
@@ -357,7 +357,7 @@ static capidrv_plci *new_plci(capidrv_contr * card, int chan)
return
plcip
;
return
plcip
;
}
}
static
capidrv_plci
*
find_plci_by_plci
(
capidrv_contr
*
card
,
__
u32
plci
)
static
capidrv_plci
*
find_plci_by_plci
(
capidrv_contr
*
card
,
u32
plci
)
{
{
capidrv_plci
*
p
;
capidrv_plci
*
p
;
for
(
p
=
card
->
plci_list
;
p
;
p
=
p
->
next
)
for
(
p
=
card
->
plci_list
;
p
;
p
=
p
->
next
)
...
@@ -366,7 +366,7 @@ static capidrv_plci *find_plci_by_plci(capidrv_contr * card, __u32 plci)
...
@@ -366,7 +366,7 @@ static capidrv_plci *find_plci_by_plci(capidrv_contr * card, __u32 plci)
return
0
;
return
0
;
}
}
static
capidrv_plci
*
find_plci_by_msgid
(
capidrv_contr
*
card
,
__
u16
msgid
)
static
capidrv_plci
*
find_plci_by_msgid
(
capidrv_contr
*
card
,
u16
msgid
)
{
{
capidrv_plci
*
p
;
capidrv_plci
*
p
;
for
(
p
=
card
->
plci_list
;
p
;
p
=
p
->
next
)
for
(
p
=
card
->
plci_list
;
p
;
p
=
p
->
next
)
...
@@ -375,7 +375,7 @@ static capidrv_plci *find_plci_by_msgid(capidrv_contr * card, __u16 msgid)
...
@@ -375,7 +375,7 @@ static capidrv_plci *find_plci_by_msgid(capidrv_contr * card, __u16 msgid)
return
0
;
return
0
;
}
}
static
capidrv_plci
*
find_plci_by_ncci
(
capidrv_contr
*
card
,
__
u32
ncci
)
static
capidrv_plci
*
find_plci_by_ncci
(
capidrv_contr
*
card
,
u32
ncci
)
{
{
capidrv_plci
*
p
;
capidrv_plci
*
p
;
for
(
p
=
card
->
plci_list
;
p
;
p
=
p
->
next
)
for
(
p
=
card
->
plci_list
;
p
;
p
=
p
->
next
)
...
@@ -406,7 +406,7 @@ static void free_plci(capidrv_contr * card, capidrv_plci * plcip)
...
@@ -406,7 +406,7 @@ static void free_plci(capidrv_contr * card, capidrv_plci * plcip)
static
inline
capidrv_ncci
*
new_ncci
(
capidrv_contr
*
card
,
static
inline
capidrv_ncci
*
new_ncci
(
capidrv_contr
*
card
,
capidrv_plci
*
plcip
,
capidrv_plci
*
plcip
,
__
u32
ncci
)
u32
ncci
)
{
{
capidrv_ncci
*
nccip
;
capidrv_ncci
*
nccip
;
...
@@ -430,7 +430,7 @@ static inline capidrv_ncci *new_ncci(capidrv_contr * card,
...
@@ -430,7 +430,7 @@ static inline capidrv_ncci *new_ncci(capidrv_contr * card,
return
nccip
;
return
nccip
;
}
}
static
inline
capidrv_ncci
*
find_ncci
(
capidrv_contr
*
card
,
__
u32
ncci
)
static
inline
capidrv_ncci
*
find_ncci
(
capidrv_contr
*
card
,
u32
ncci
)
{
{
capidrv_plci
*
plcip
;
capidrv_plci
*
plcip
;
capidrv_ncci
*
p
;
capidrv_ncci
*
p
;
...
@@ -445,7 +445,7 @@ static inline capidrv_ncci *find_ncci(capidrv_contr * card, __u32 ncci)
...
@@ -445,7 +445,7 @@ static inline capidrv_ncci *find_ncci(capidrv_contr * card, __u32 ncci)
}
}
static
inline
capidrv_ncci
*
find_ncci_by_msgid
(
capidrv_contr
*
card
,
static
inline
capidrv_ncci
*
find_ncci_by_msgid
(
capidrv_contr
*
card
,
__u32
ncci
,
__
u16
msgid
)
u32
ncci
,
u16
msgid
)
{
{
capidrv_plci
*
plcip
;
capidrv_plci
*
plcip
;
capidrv_ncci
*
p
;
capidrv_ncci
*
p
;
...
@@ -474,7 +474,7 @@ static void free_ncci(capidrv_contr * card, struct capidrv_ncci *nccip)
...
@@ -474,7 +474,7 @@ static void free_ncci(capidrv_contr * card, struct capidrv_ncci *nccip)
}
}
static
int
capidrv_add_ack
(
struct
capidrv_ncci
*
nccip
,
static
int
capidrv_add_ack
(
struct
capidrv_ncci
*
nccip
,
__
u16
datahandle
,
int
len
)
u16
datahandle
,
int
len
)
{
{
struct
ncci_datahandle_queue
*
n
,
**
pp
;
struct
ncci_datahandle_queue
*
n
,
**
pp
;
...
@@ -492,7 +492,7 @@ static int capidrv_add_ack(struct capidrv_ncci *nccip,
...
@@ -492,7 +492,7 @@ static int capidrv_add_ack(struct capidrv_ncci *nccip,
return
0
;
return
0
;
}
}
static
int
capidrv_del_ack
(
struct
capidrv_ncci
*
nccip
,
__
u16
datahandle
)
static
int
capidrv_del_ack
(
struct
capidrv_ncci
*
nccip
,
u16
datahandle
)
{
{
struct
ncci_datahandle_queue
**
pp
,
*
p
;
struct
ncci_datahandle_queue
**
pp
,
*
p
;
int
len
;
int
len
;
...
@@ -798,9 +798,9 @@ static void handle_controller(_cmsg * cmsg)
...
@@ -798,9 +798,9 @@ static void handle_controller(_cmsg * cmsg)
if
(
cmsg
->
ManuID
==
0x214D5641
if
(
cmsg
->
ManuID
==
0x214D5641
&&
cmsg
->
Class
==
0
&&
cmsg
->
Class
==
0
&&
cmsg
->
Function
==
1
)
{
&&
cmsg
->
Function
==
1
)
{
__
u8
*
data
=
cmsg
->
ManuData
+
3
;
u8
*
data
=
cmsg
->
ManuData
+
3
;
__
u16
len
=
cmsg
->
ManuData
[
0
];
u16
len
=
cmsg
->
ManuData
[
0
];
__
u16
layer
;
u16
layer
;
int
direction
;
int
direction
;
if
(
len
==
255
)
{
if
(
len
==
255
)
{
len
=
(
cmsg
->
ManuData
[
1
]
|
(
cmsg
->
ManuData
[
2
]
<<
8
));
len
=
(
cmsg
->
ManuData
[
1
]
|
(
cmsg
->
ManuData
[
2
]
<<
8
));
...
@@ -1123,10 +1123,10 @@ static void handle_plci(_cmsg * cmsg)
...
@@ -1123,10 +1123,10 @@ static void handle_plci(_cmsg * cmsg)
cmd
.
arg
=
plcip
->
chan
;
cmd
.
arg
=
plcip
->
chan
;
sprintf
(
cmd
.
parm
.
num
,
"%lu"
,
sprintf
(
cmd
.
parm
.
num
,
"%lu"
,
(
unsigned
long
)
(
unsigned
long
)
((
__
u32
)
cmsg
->
InfoElement
[
1
]
((
u32
)
cmsg
->
InfoElement
[
1
]
|
((
__
u32
)
(
cmsg
->
InfoElement
[
2
])
<<
8
)
|
((
u32
)
(
cmsg
->
InfoElement
[
2
])
<<
8
)
|
((
__
u32
)
(
cmsg
->
InfoElement
[
3
])
<<
16
)
|
((
u32
)
(
cmsg
->
InfoElement
[
3
])
<<
16
)
|
((
__
u32
)
(
cmsg
->
InfoElement
[
4
])
<<
24
)));
|
((
u32
)
(
cmsg
->
InfoElement
[
4
])
<<
24
)));
card
->
interface
.
statcallb
(
&
cmd
);
card
->
interface
.
statcallb
(
&
cmd
);
break
;
break
;
}
}
...
@@ -1373,7 +1373,7 @@ static void handle_data(_cmsg * cmsg, struct sk_buff *skb)
...
@@ -1373,7 +1373,7 @@ static void handle_data(_cmsg * cmsg, struct sk_buff *skb)
static
_cmsg
s_cmsg
;
static
_cmsg
s_cmsg
;
static
void
capidrv_signal
(
__
u16
applid
,
void
*
dummy
)
static
void
capidrv_signal
(
u16
applid
,
void
*
dummy
)
{
{
struct
sk_buff
*
skb
=
0
;
struct
sk_buff
*
skb
=
0
;
...
@@ -1415,9 +1415,9 @@ static void capidrv_signal(__u16 applid, void *dummy)
...
@@ -1415,9 +1415,9 @@ static void capidrv_signal(__u16 applid, void *dummy)
} while (0)
} while (0)
static
void
handle_dtrace_data
(
capidrv_contr
*
card
,
static
void
handle_dtrace_data
(
capidrv_contr
*
card
,
int
send
,
int
level2
,
__u8
*
data
,
__
u16
len
)
int
send
,
int
level2
,
u8
*
data
,
u16
len
)
{
{
__
u8
*
p
,
*
end
;
u8
*
p
,
*
end
;
isdn_ctrl
cmd
;
isdn_ctrl
cmd
;
if
(
!
len
)
{
if
(
!
len
)
{
...
@@ -1439,7 +1439,7 @@ static void handle_dtrace_data(capidrv_contr *card,
...
@@ -1439,7 +1439,7 @@ static void handle_dtrace_data(capidrv_contr *card,
}
}
for
(
p
=
data
,
end
=
data
+
len
;
p
<
end
;
p
++
)
{
for
(
p
=
data
,
end
=
data
+
len
;
p
<
end
;
p
++
)
{
__
u8
w
;
u8
w
;
PUTBYTE_TO_STATUS
(
card
,
' '
);
PUTBYTE_TO_STATUS
(
card
,
' '
);
w
=
(
*
p
>>
4
)
&
0xf
;
w
=
(
*
p
>>
4
)
&
0xf
;
PUTBYTE_TO_STATUS
(
card
,
(
w
<
10
)
?
'0'
+
w
:
'A'
-
10
+
w
);
PUTBYTE_TO_STATUS
(
card
,
(
w
<
10
)
?
'0'
+
w
:
'A'
-
10
+
w
);
...
@@ -1539,7 +1539,7 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep)
...
@@ -1539,7 +1539,7 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep)
return
0
;
return
0
;
}
}
static
int
FVteln2capi20
(
char
*
teln
,
__
u8
AdditionalInfo
[
1
+
2
+
2
+
31
])
static
int
FVteln2capi20
(
char
*
teln
,
u8
AdditionalInfo
[
1
+
2
+
2
+
31
])
{
{
unsigned
long
bmask
;
unsigned
long
bmask
;
int
active
;
int
active
;
...
@@ -1569,7 +1569,7 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card)
...
@@ -1569,7 +1569,7 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card)
isdn_ctrl
cmd
;
isdn_ctrl
cmd
;
struct
capidrv_bchan
*
bchan
;
struct
capidrv_bchan
*
bchan
;
struct
capidrv_plci
*
plcip
;
struct
capidrv_plci
*
plcip
;
__
u8
AdditionalInfo
[
1
+
2
+
2
+
31
];
u8
AdditionalInfo
[
1
+
2
+
2
+
31
];
int
rc
,
isleasedline
=
0
;
int
rc
,
isleasedline
=
0
;
if
(
c
->
command
==
ISDN_CMD_IOCTL
)
if
(
c
->
command
==
ISDN_CMD_IOCTL
)
...
@@ -1577,8 +1577,8 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card)
...
@@ -1577,8 +1577,8 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card)
switch
(
c
->
command
)
{
switch
(
c
->
command
)
{
case
ISDN_CMD_DIAL
:{
case
ISDN_CMD_DIAL
:{
__
u8
calling
[
ISDN_MSNLEN
+
3
];
u8
calling
[
ISDN_MSNLEN
+
3
];
__
u8
called
[
ISDN_MSNLEN
+
2
];
u8
called
[
ISDN_MSNLEN
+
2
];
if
(
debugmode
)
if
(
debugmode
)
printk
(
KERN_DEBUG
"capidrv-%d: ISDN_CMD_DIAL(ch=%ld,
\"
%s,%d,%d,%s
\"
)
\n
"
,
printk
(
KERN_DEBUG
"capidrv-%d: ISDN_CMD_DIAL(ch=%ld,
\"
%s,%d,%d,%s
\"
)
\n
"
,
...
@@ -1870,8 +1870,8 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb)
...
@@ -1870,8 +1870,8 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb)
capidrv_ncci
*
nccip
;
capidrv_ncci
*
nccip
;
int
len
=
skb
->
len
;
int
len
=
skb
->
len
;
size_t
msglen
;
size_t
msglen
;
__
u16
errcode
;
u16
errcode
;
__
u16
datahandle
;
u16
datahandle
;
if
(
!
card
)
{
if
(
!
card
)
{
printk
(
KERN_ERR
"capidrv: if_sendbuf called with invalid driverId %d!
\n
"
,
printk
(
KERN_ERR
"capidrv: if_sendbuf called with invalid driverId %d!
\n
"
,
...
@@ -1891,7 +1891,7 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb)
...
@@ -1891,7 +1891,7 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb)
datahandle
=
nccip
->
datahandle
;
datahandle
=
nccip
->
datahandle
;
capi_fill_DATA_B3_REQ
(
&
sendcmsg
,
global
.
appid
,
card
->
msgid
++
,
capi_fill_DATA_B3_REQ
(
&
sendcmsg
,
global
.
appid
,
card
->
msgid
++
,
nccip
->
ncci
,
/* adr */
nccip
->
ncci
,
/* adr */
(
__
u32
)
skb
->
data
,
/* Data */
(
u32
)
skb
->
data
,
/* Data */
skb
->
len
,
/* DataLength */
skb
->
len
,
/* DataLength */
datahandle
,
/* DataHandle */
datahandle
,
/* DataHandle */
0
/* Flags */
0
/* Flags */
...
@@ -1937,11 +1937,11 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb)
...
@@ -1937,11 +1937,11 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb)
}
}
}
}
static
int
if_readstat
(
__
u8
*
buf
,
int
len
,
int
user
,
int
id
,
int
channel
)
static
int
if_readstat
(
u8
*
buf
,
int
len
,
int
user
,
int
id
,
int
channel
)
{
{
capidrv_contr
*
card
=
findcontrbydriverid
(
id
);
capidrv_contr
*
card
=
findcontrbydriverid
(
id
);
int
count
;
int
count
;
__
u8
*
p
;
u8
*
p
;
if
(
!
card
)
{
if
(
!
card
)
{
printk
(
KERN_ERR
"capidrv: if_readstat called with invalid driverId %d!
\n
"
,
printk
(
KERN_ERR
"capidrv: if_readstat called with invalid driverId %d!
\n
"
,
...
@@ -1963,11 +1963,11 @@ static int if_readstat(__u8 *buf, int len, int user, int id, int channel)
...
@@ -1963,11 +1963,11 @@ static int if_readstat(__u8 *buf, int len, int user, int id, int channel)
static
void
enable_dchannel_trace
(
capidrv_contr
*
card
)
static
void
enable_dchannel_trace
(
capidrv_contr
*
card
)
{
{
__
u8
manufacturer
[
CAPI_MANUFACTURER_LEN
];
u8
manufacturer
[
CAPI_MANUFACTURER_LEN
];
capi_version
version
;
capi_version
version
;
__
u16
contr
=
card
->
contrnr
;
u16
contr
=
card
->
contrnr
;
__
u16
errcode
;
u16
errcode
;
__
u16
avmversion
[
3
];
u16
avmversion
[
3
];
errcode
=
(
*
capifuncs
->
capi_get_manufacturer
)(
contr
,
manufacturer
);
errcode
=
(
*
capifuncs
->
capi_get_manufacturer
)(
contr
,
manufacturer
);
if
(
errcode
!=
CAPI_NOERROR
)
{
if
(
errcode
!=
CAPI_NOERROR
)
{
...
@@ -2037,7 +2037,7 @@ static void listentimerfunc(unsigned long x)
...
@@ -2037,7 +2037,7 @@ static void listentimerfunc(unsigned long x)
}
}
static
int
capidrv_addcontr
(
__
u16
contr
,
struct
capi_profile
*
profp
)
static
int
capidrv_addcontr
(
u16
contr
,
struct
capi_profile
*
profp
)
{
{
capidrv_contr
*
card
;
capidrv_contr
*
card
;
long
flags
;
long
flags
;
...
@@ -2135,7 +2135,7 @@ static int capidrv_addcontr(__u16 contr, struct capi_profile *profp)
...
@@ -2135,7 +2135,7 @@ static int capidrv_addcontr(__u16 contr, struct capi_profile *profp)
return
0
;
return
0
;
}
}
static
int
capidrv_delcontr
(
__
u16
contr
)
static
int
capidrv_delcontr
(
u16
contr
)
{
{
capidrv_contr
**
pp
,
*
card
;
capidrv_contr
**
pp
,
*
card
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -2218,7 +2218,7 @@ static int capidrv_delcontr(__u16 contr)
...
@@ -2218,7 +2218,7 @@ static int capidrv_delcontr(__u16 contr)
}
}
static
void
lower_callback
(
unsigned
int
cmd
,
__
u32
contr
,
void
*
data
)
static
void
lower_callback
(
unsigned
int
cmd
,
u32
contr
,
void
*
data
)
{
{
switch
(
cmd
)
{
switch
(
cmd
)
{
...
@@ -2303,8 +2303,8 @@ static int __init capidrv_init(void)
...
@@ -2303,8 +2303,8 @@ static int __init capidrv_init(void)
capi_profile
profile
;
capi_profile
profile
;
char
rev
[
32
];
char
rev
[
32
];
char
*
p
;
char
*
p
;
__
u32
ncontr
,
contr
;
u32
ncontr
,
contr
;
__
u16
errcode
;
u16
errcode
;
MOD_INC_USE_COUNT
;
MOD_INC_USE_COUNT
;
...
...
drivers/isdn/capi/capiutil.c
View file @
248c1097
...
@@ -27,12 +27,12 @@ MODULE_LICENSE("GPL");
...
@@ -27,12 +27,12 @@ MODULE_LICENSE("GPL");
/* from CAPI2.0 DDK AVM Berlin GmbH */
/* from CAPI2.0 DDK AVM Berlin GmbH */
#ifndef CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON
#ifndef CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON
char
*
capi_info2str
(
__
u16
reason
)
char
*
capi_info2str
(
u16
reason
)
{
{
return
".."
;
return
".."
;
}
}
#else
#else
char
*
capi_info2str
(
__
u16
reason
)
char
*
capi_info2str
(
u16
reason
)
{
{
switch
(
reason
)
{
switch
(
reason
)
{
...
@@ -422,14 +422,14 @@ static unsigned char *cpars[] =
...
@@ -422,14 +422,14 @@ static unsigned char *cpars[] =
/*-------------------------------------------------------*/
/*-------------------------------------------------------*/
#define byteTLcpy(x,y) *(
__u8 *)(x)=*(__
u8 *)(y);
#define byteTLcpy(x,y) *(
u8 *)(x)=*(
u8 *)(y);
#define wordTLcpy(x,y) *(
__u16 *)(x)=*(__
u16 *)(y);
#define wordTLcpy(x,y) *(
u16 *)(x)=*(
u16 *)(y);
#define dwordTLcpy(x,y) memcpy(x,y,4);
#define dwordTLcpy(x,y) memcpy(x,y,4);
#define structTLcpy(x,y,l) memcpy (x,y,l)
#define structTLcpy(x,y,l) memcpy (x,y,l)
#define structTLcpyovl(x,y,l) memmove (x,y,l)
#define structTLcpyovl(x,y,l) memmove (x,y,l)
#define byteTRcpy(x,y) *(
__u8 *)(y)=*(__
u8 *)(x);
#define byteTRcpy(x,y) *(
u8 *)(y)=*(
u8 *)(x);
#define wordTRcpy(x,y) *(
__u16 *)(y)=*(__
u16 *)(x);
#define wordTRcpy(x,y) *(
u16 *)(y)=*(
u16 *)(x);
#define dwordTRcpy(x,y) memcpy(y,x,4);
#define dwordTRcpy(x,y) memcpy(y,x,4);
#define structTRcpy(x,y,l) memcpy (y,x,l)
#define structTRcpy(x,y,l) memcpy (y,x,l)
#define structTRcpyovl(x,y,l) memmove (y,x,l)
#define structTRcpyovl(x,y,l) memmove (y,x,l)
...
@@ -449,7 +449,7 @@ static unsigned command_2_index(unsigned c, unsigned sc)
...
@@ -449,7 +449,7 @@ static unsigned command_2_index(unsigned c, unsigned sc)
/*-------------------------------------------------------*/
/*-------------------------------------------------------*/
#define TYP (cdef[cmsg->par[cmsg->p]].typ)
#define TYP (cdef[cmsg->par[cmsg->p]].typ)
#define OFF (((
__
u8 *)cmsg)+cdef[cmsg->par[cmsg->p]].off)
#define OFF (((u8 *)cmsg)+cdef[cmsg->par[cmsg->p]].off)
static
void
jumpcstruct
(
_cmsg
*
cmsg
)
static
void
jumpcstruct
(
_cmsg
*
cmsg
)
{
{
...
@@ -486,7 +486,7 @@ static void pars_2_message(_cmsg * cmsg)
...
@@ -486,7 +486,7 @@ static void pars_2_message(_cmsg * cmsg)
cmsg
->
l
+=
4
;
cmsg
->
l
+=
4
;
break
;
break
;
case
_CSTRUCT
:
case
_CSTRUCT
:
if
(
*
(
__
u8
**
)
OFF
==
0
)
{
if
(
*
(
u8
**
)
OFF
==
0
)
{
*
(
cmsg
->
m
+
cmsg
->
l
)
=
'\0'
;
*
(
cmsg
->
m
+
cmsg
->
l
)
=
'\0'
;
cmsg
->
l
++
;
cmsg
->
l
++
;
}
else
if
(
**
(
_cstruct
*
)
OFF
!=
0xff
)
{
}
else
if
(
**
(
_cstruct
*
)
OFF
!=
0xff
)
{
...
@@ -494,8 +494,8 @@ static void pars_2_message(_cmsg * cmsg)
...
@@ -494,8 +494,8 @@ static void pars_2_message(_cmsg * cmsg)
cmsg
->
l
+=
1
+
**
(
_cstruct
*
)
OFF
;
cmsg
->
l
+=
1
+
**
(
_cstruct
*
)
OFF
;
}
else
{
}
else
{
_cstruct
s
=
*
(
_cstruct
*
)
OFF
;
_cstruct
s
=
*
(
_cstruct
*
)
OFF
;
structTLcpy
(
cmsg
->
m
+
cmsg
->
l
,
s
,
3
+
*
(
__
u16
*
)
(
s
+
1
));
structTLcpy
(
cmsg
->
m
+
cmsg
->
l
,
s
,
3
+
*
(
u16
*
)
(
s
+
1
));
cmsg
->
l
+=
3
+
*
(
__
u16
*
)
(
s
+
1
);
cmsg
->
l
+=
3
+
*
(
u16
*
)
(
s
+
1
);
}
}
break
;
break
;
case
_CMSTRUCT
:
case
_CMSTRUCT
:
...
@@ -514,7 +514,7 @@ static void pars_2_message(_cmsg * cmsg)
...
@@ -514,7 +514,7 @@ static void pars_2_message(_cmsg * cmsg)
pars_2_message
(
cmsg
);
pars_2_message
(
cmsg
);
_ls
=
cmsg
->
l
-
_l
-
1
;
_ls
=
cmsg
->
l
-
_l
-
1
;
if
(
_ls
<
255
)
if
(
_ls
<
255
)
(
cmsg
->
m
+
_l
)[
0
]
=
(
__
u8
)
_ls
;
(
cmsg
->
m
+
_l
)[
0
]
=
(
u8
)
_ls
;
else
{
else
{
structTLcpyovl
(
cmsg
->
m
+
_l
+
3
,
cmsg
->
m
+
_l
+
1
,
_ls
);
structTLcpyovl
(
cmsg
->
m
+
_l
+
3
,
cmsg
->
m
+
_l
+
1
,
_ls
);
(
cmsg
->
m
+
_l
)[
0
]
=
0xff
;
(
cmsg
->
m
+
_l
)[
0
]
=
0xff
;
...
@@ -527,7 +527,7 @@ static void pars_2_message(_cmsg * cmsg)
...
@@ -527,7 +527,7 @@ static void pars_2_message(_cmsg * cmsg)
}
}
/*-------------------------------------------------------*/
/*-------------------------------------------------------*/
unsigned
capi_cmsg2message
(
_cmsg
*
cmsg
,
__
u8
*
msg
)
unsigned
capi_cmsg2message
(
_cmsg
*
cmsg
,
u8
*
msg
)
{
{
cmsg
->
m
=
msg
;
cmsg
->
m
=
msg
;
cmsg
->
l
=
8
;
cmsg
->
l
=
8
;
...
@@ -564,12 +564,12 @@ static void message_2_pars(_cmsg * cmsg)
...
@@ -564,12 +564,12 @@ static void message_2_pars(_cmsg * cmsg)
cmsg
->
l
+=
4
;
cmsg
->
l
+=
4
;
break
;
break
;
case
_CSTRUCT
:
case
_CSTRUCT
:
*
(
__
u8
**
)
OFF
=
cmsg
->
m
+
cmsg
->
l
;
*
(
u8
**
)
OFF
=
cmsg
->
m
+
cmsg
->
l
;
if
(
cmsg
->
m
[
cmsg
->
l
]
!=
0xff
)
if
(
cmsg
->
m
[
cmsg
->
l
]
!=
0xff
)
cmsg
->
l
+=
1
+
cmsg
->
m
[
cmsg
->
l
];
cmsg
->
l
+=
1
+
cmsg
->
m
[
cmsg
->
l
];
else
else
cmsg
->
l
+=
3
+
*
(
__
u16
*
)
(
cmsg
->
m
+
cmsg
->
l
+
1
);
cmsg
->
l
+=
3
+
*
(
u16
*
)
(
cmsg
->
m
+
cmsg
->
l
+
1
);
break
;
break
;
case
_CMSTRUCT
:
case
_CMSTRUCT
:
/*----- Metastruktur 0 -----*/
/*----- Metastruktur 0 -----*/
...
@@ -590,7 +590,7 @@ static void message_2_pars(_cmsg * cmsg)
...
@@ -590,7 +590,7 @@ static void message_2_pars(_cmsg * cmsg)
}
}
/*-------------------------------------------------------*/
/*-------------------------------------------------------*/
unsigned
capi_message2cmsg
(
_cmsg
*
cmsg
,
__
u8
*
msg
)
unsigned
capi_message2cmsg
(
_cmsg
*
cmsg
,
u8
*
msg
)
{
{
memset
(
cmsg
,
0
,
sizeof
(
_cmsg
));
memset
(
cmsg
,
0
,
sizeof
(
_cmsg
));
cmsg
->
m
=
msg
;
cmsg
->
m
=
msg
;
...
@@ -610,9 +610,9 @@ unsigned capi_message2cmsg(_cmsg * cmsg, __u8 * msg)
...
@@ -610,9 +610,9 @@ unsigned capi_message2cmsg(_cmsg * cmsg, __u8 * msg)
}
}
/*-------------------------------------------------------*/
/*-------------------------------------------------------*/
unsigned
capi_cmsg_header
(
_cmsg
*
cmsg
,
__
u16
_ApplId
,
unsigned
capi_cmsg_header
(
_cmsg
*
cmsg
,
u16
_ApplId
,
__u8
_Command
,
__
u8
_Subcommand
,
u8
_Command
,
u8
_Subcommand
,
__u16
_Messagenumber
,
__
u32
_Controller
)
u16
_Messagenumber
,
u32
_Controller
)
{
{
memset
(
cmsg
,
0
,
sizeof
(
_cmsg
));
memset
(
cmsg
,
0
,
sizeof
(
_cmsg
));
cmsg
->
ApplId
=
_ApplId
;
cmsg
->
ApplId
=
_ApplId
;
...
@@ -708,7 +708,7 @@ static char *mnames[] =
...
@@ -708,7 +708,7 @@ static char *mnames[] =
"MANUFACTURER_RESP"
"MANUFACTURER_RESP"
};
};
char
*
capi_cmd2str
(
__u8
cmd
,
__
u8
subcmd
)
char
*
capi_cmd2str
(
u8
cmd
,
u8
subcmd
)
{
{
return
mnames
[
command_2_index
(
cmd
,
subcmd
)];
return
mnames
[
command_2_index
(
cmd
,
subcmd
)];
}
}
...
@@ -785,7 +785,7 @@ static void bufprint(char *fmt,...)
...
@@ -785,7 +785,7 @@ static void bufprint(char *fmt,...)
p
+=
strlen
(
p
);
p
+=
strlen
(
p
);
}
}
static
void
printstructlen
(
__
u8
*
m
,
unsigned
len
)
static
void
printstructlen
(
u8
*
m
,
unsigned
len
)
{
{
unsigned
hex
=
0
;
unsigned
hex
=
0
;
for
(;
len
;
len
--
,
m
++
)
for
(;
len
;
len
--
,
m
++
)
...
@@ -805,14 +805,14 @@ static void printstructlen(__u8 * m, unsigned len)
...
@@ -805,14 +805,14 @@ static void printstructlen(__u8 * m, unsigned len)
bufprint
(
">"
);
bufprint
(
">"
);
}
}
static
void
printstruct
(
__
u8
*
m
)
static
void
printstruct
(
u8
*
m
)
{
{
unsigned
len
;
unsigned
len
;
if
(
m
[
0
]
!=
0xff
)
{
if
(
m
[
0
]
!=
0xff
)
{
len
=
m
[
0
];
len
=
m
[
0
];
m
+=
1
;
m
+=
1
;
}
else
{
}
else
{
len
=
((
__
u16
*
)
(
m
+
1
))[
0
];
len
=
((
u16
*
)
(
m
+
1
))[
0
];
m
+=
3
;
m
+=
3
;
}
}
printstructlen
(
m
,
len
);
printstructlen
(
m
,
len
);
...
@@ -833,15 +833,15 @@ static void protocol_message_2_pars(_cmsg * cmsg, int level)
...
@@ -833,15 +833,15 @@ static void protocol_message_2_pars(_cmsg * cmsg, int level)
switch
(
TYP
)
{
switch
(
TYP
)
{
case
_CBYTE
:
case
_CBYTE
:
bufprint
(
"%-*s = 0x%x
\n
"
,
slen
,
NAME
,
*
(
__
u8
*
)
(
cmsg
->
m
+
cmsg
->
l
));
bufprint
(
"%-*s = 0x%x
\n
"
,
slen
,
NAME
,
*
(
u8
*
)
(
cmsg
->
m
+
cmsg
->
l
));
cmsg
->
l
++
;
cmsg
->
l
++
;
break
;
break
;
case
_CWORD
:
case
_CWORD
:
bufprint
(
"%-*s = 0x%x
\n
"
,
slen
,
NAME
,
*
(
__
u16
*
)
(
cmsg
->
m
+
cmsg
->
l
));
bufprint
(
"%-*s = 0x%x
\n
"
,
slen
,
NAME
,
*
(
u16
*
)
(
cmsg
->
m
+
cmsg
->
l
));
cmsg
->
l
+=
2
;
cmsg
->
l
+=
2
;
break
;
break
;
case
_CDWORD
:
case
_CDWORD
:
bufprint
(
"%-*s = 0x%lx
\n
"
,
slen
,
NAME
,
*
(
__
u32
*
)
(
cmsg
->
m
+
cmsg
->
l
));
bufprint
(
"%-*s = 0x%lx
\n
"
,
slen
,
NAME
,
*
(
u32
*
)
(
cmsg
->
m
+
cmsg
->
l
));
cmsg
->
l
+=
4
;
cmsg
->
l
+=
4
;
break
;
break
;
case
_CSTRUCT
:
case
_CSTRUCT
:
...
@@ -854,7 +854,7 @@ static void protocol_message_2_pars(_cmsg * cmsg, int level)
...
@@ -854,7 +854,7 @@ static void protocol_message_2_pars(_cmsg * cmsg, int level)
if
(
cmsg
->
m
[
cmsg
->
l
]
!=
0xff
)
if
(
cmsg
->
m
[
cmsg
->
l
]
!=
0xff
)
cmsg
->
l
+=
1
+
cmsg
->
m
[
cmsg
->
l
];
cmsg
->
l
+=
1
+
cmsg
->
m
[
cmsg
->
l
];
else
else
cmsg
->
l
+=
3
+
*
(
__
u16
*
)
(
cmsg
->
m
+
cmsg
->
l
+
1
);
cmsg
->
l
+=
3
+
*
(
u16
*
)
(
cmsg
->
m
+
cmsg
->
l
+
1
);
break
;
break
;
...
@@ -877,7 +877,7 @@ static void protocol_message_2_pars(_cmsg * cmsg, int level)
...
@@ -877,7 +877,7 @@ static void protocol_message_2_pars(_cmsg * cmsg, int level)
}
}
}
}
/*-------------------------------------------------------*/
/*-------------------------------------------------------*/
char
*
capi_message2str
(
__
u8
*
msg
)
char
*
capi_message2str
(
u8
*
msg
)
{
{
_cmsg
cmsg
;
_cmsg
cmsg
;
...
@@ -909,9 +909,9 @@ char *capi_cmsg2str(_cmsg * cmsg)
...
@@ -909,9 +909,9 @@ char *capi_cmsg2str(_cmsg * cmsg)
cmsg
->
p
=
0
;
cmsg
->
p
=
0
;
bufprint
(
"%s ID=%03d #0x%04x LEN=%04d
\n
"
,
bufprint
(
"%s ID=%03d #0x%04x LEN=%04d
\n
"
,
mnames
[
command_2_index
(
cmsg
->
Command
,
cmsg
->
Subcommand
)],
mnames
[
command_2_index
(
cmsg
->
Command
,
cmsg
->
Subcommand
)],
((
__
u16
*
)
cmsg
->
m
)[
1
],
((
u16
*
)
cmsg
->
m
)[
1
],
((
__
u16
*
)
cmsg
->
m
)[
3
],
((
u16
*
)
cmsg
->
m
)[
3
],
((
__
u16
*
)
cmsg
->
m
)[
0
]);
((
u16
*
)
cmsg
->
m
)[
0
]);
protocol_message_2_pars
(
cmsg
,
1
);
protocol_message_2_pars
(
cmsg
,
1
);
return
buf
;
return
buf
;
}
}
...
...
drivers/isdn/capi/kcapi.c
View file @
248c1097
...
@@ -54,14 +54,14 @@ MODULE_PARM(showcapimsgs, "i");
...
@@ -54,14 +54,14 @@ MODULE_PARM(showcapimsgs, "i");
struct
msgidqueue
{
struct
msgidqueue
{
struct
msgidqueue
*
next
;
struct
msgidqueue
*
next
;
__
u16
msgid
;
u16
msgid
;
};
};
struct
capi_ncci
{
struct
capi_ncci
{
struct
capi_ncci
*
next
;
struct
capi_ncci
*
next
;
__
u16
applid
;
u16
applid
;
__
u32
ncci
;
u32
ncci
;
__
u32
winsize
;
u32
winsize
;
int
nmsg
;
int
nmsg
;
struct
msgidqueue
*
msgidqueue
;
struct
msgidqueue
*
msgidqueue
;
struct
msgidqueue
*
msgidlast
;
struct
msgidqueue
*
msgidlast
;
...
@@ -70,11 +70,11 @@ struct capi_ncci {
...
@@ -70,11 +70,11 @@ struct capi_ncci {
};
};
struct
capi_appl
{
struct
capi_appl
{
__
u16
applid
;
u16
applid
;
capi_register_params
rparam
;
capi_register_params
rparam
;
int
releasing
;
int
releasing
;
void
*
param
;
void
*
param
;
void
(
*
signal
)
(
__
u16
applid
,
void
*
param
);
void
(
*
signal
)
(
u16
applid
,
void
*
param
);
struct
sk_buff_head
recv_queue
;
struct
sk_buff_head
recv_queue
;
int
nncci
;
int
nncci
;
struct
capi_ncci
*
nccilist
;
struct
capi_ncci
*
nccilist
;
...
@@ -88,9 +88,9 @@ struct capi_appl {
...
@@ -88,9 +88,9 @@ struct capi_appl {
struct
capi_notifier
{
struct
capi_notifier
{
struct
capi_notifier
*
next
;
struct
capi_notifier
*
next
;
unsigned
int
cmd
;
unsigned
int
cmd
;
__
u32
controller
;
u32
controller
;
__
u16
applid
;
u16
applid
;
__
u32
ncci
;
u32
ncci
;
};
};
/* ------------------------------------------------------------- */
/* ------------------------------------------------------------- */
...
@@ -136,7 +136,7 @@ static char *cardstate2str(unsigned short cardstate)
...
@@ -136,7 +136,7 @@ static char *cardstate2str(unsigned short cardstate)
}
}
}
}
static
inline
int
capi_cmd_valid
(
__
u8
cmd
)
static
inline
int
capi_cmd_valid
(
u8
cmd
)
{
{
switch
(
cmd
)
{
switch
(
cmd
)
{
case
CAPI_ALERT
:
case
CAPI_ALERT
:
...
@@ -159,7 +159,7 @@ static inline int capi_cmd_valid(__u8 cmd)
...
@@ -159,7 +159,7 @@ static inline int capi_cmd_valid(__u8 cmd)
return
0
;
return
0
;
}
}
static
inline
int
capi_subcmd_valid
(
__
u8
subcmd
)
static
inline
int
capi_subcmd_valid
(
u8
subcmd
)
{
{
switch
(
subcmd
)
{
switch
(
subcmd
)
{
case
CAPI_REQ
:
case
CAPI_REQ
:
...
@@ -511,8 +511,8 @@ static inline struct capi_notifier *notify_dequeue(void)
...
@@ -511,8 +511,8 @@ static inline struct capi_notifier *notify_dequeue(void)
return
np
;
return
np
;
}
}
static
int
notify_push
(
unsigned
int
cmd
,
__
u32
controller
,
static
int
notify_push
(
unsigned
int
cmd
,
u32
controller
,
__u16
applid
,
__
u32
ncci
)
u16
applid
,
u32
ncci
)
{
{
struct
capi_notifier
*
np
;
struct
capi_notifier
*
np
;
...
@@ -541,7 +541,7 @@ static int notify_push(unsigned int cmd, __u32 controller,
...
@@ -541,7 +541,7 @@ static int notify_push(unsigned int cmd, __u32 controller,
/* -------- KCI_CONTRUP --------------------------------------- */
/* -------- KCI_CONTRUP --------------------------------------- */
static
void
notify_up
(
__
u32
contr
)
static
void
notify_up
(
u32
contr
)
{
{
struct
capi_interface_user
*
p
;
struct
capi_interface_user
*
p
;
...
@@ -556,7 +556,7 @@ static void notify_up(__u32 contr)
...
@@ -556,7 +556,7 @@ static void notify_up(__u32 contr)
/* -------- KCI_CONTRDOWN ------------------------------------- */
/* -------- KCI_CONTRDOWN ------------------------------------- */
static
void
notify_down
(
__
u32
contr
)
static
void
notify_down
(
u32
contr
)
{
{
struct
capi_interface_user
*
p
;
struct
capi_interface_user
*
p
;
printk
(
KERN_NOTICE
"kcapi: notify down contr %d
\n
"
,
contr
);
printk
(
KERN_NOTICE
"kcapi: notify down contr %d
\n
"
,
contr
);
...
@@ -570,7 +570,7 @@ static void notify_down(__u32 contr)
...
@@ -570,7 +570,7 @@ static void notify_down(__u32 contr)
/* -------- KCI_NCCIUP ---------------------------------------- */
/* -------- KCI_NCCIUP ---------------------------------------- */
static
void
notify_ncciup
(
__u32
contr
,
__u16
applid
,
__
u32
ncci
)
static
void
notify_ncciup
(
u32
contr
,
u16
applid
,
u32
ncci
)
{
{
struct
capi_interface_user
*
p
;
struct
capi_interface_user
*
p
;
struct
capi_ncciinfo
n
;
struct
capi_ncciinfo
n
;
...
@@ -587,7 +587,7 @@ static void notify_ncciup(__u32 contr, __u16 applid, __u32 ncci)
...
@@ -587,7 +587,7 @@ static void notify_ncciup(__u32 contr, __u16 applid, __u32 ncci)
/* -------- KCI_NCCIDOWN -------------------------------------- */
/* -------- KCI_NCCIDOWN -------------------------------------- */
static
void
notify_nccidown
(
__u32
contr
,
__u16
applid
,
__
u32
ncci
)
static
void
notify_nccidown
(
u32
contr
,
u16
applid
,
u32
ncci
)
{
{
struct
capi_interface_user
*
p
;
struct
capi_interface_user
*
p
;
struct
capi_ncciinfo
n
;
struct
capi_ncciinfo
n
;
...
@@ -650,7 +650,7 @@ static inline void mq_init(struct capi_ncci * np)
...
@@ -650,7 +650,7 @@ static inline void mq_init(struct capi_ncci * np)
}
}
}
}
static
inline
int
mq_enqueue
(
struct
capi_ncci
*
np
,
__
u16
msgid
)
static
inline
int
mq_enqueue
(
struct
capi_ncci
*
np
,
u16
msgid
)
{
{
struct
msgidqueue
*
mq
;
struct
msgidqueue
*
mq
;
if
((
mq
=
np
->
msgidfree
)
==
0
)
if
((
mq
=
np
->
msgidfree
)
==
0
)
...
@@ -667,7 +667,7 @@ static inline int mq_enqueue(struct capi_ncci * np, __u16 msgid)
...
@@ -667,7 +667,7 @@ static inline int mq_enqueue(struct capi_ncci * np, __u16 msgid)
return
1
;
return
1
;
}
}
static
inline
int
mq_dequeue
(
struct
capi_ncci
*
np
,
__
u16
msgid
)
static
inline
int
mq_dequeue
(
struct
capi_ncci
*
np
,
u16
msgid
)
{
{
struct
msgidqueue
**
pp
;
struct
msgidqueue
**
pp
;
for
(
pp
=
&
np
->
msgidqueue
;
*
pp
;
pp
=
&
(
*
pp
)
->
next
)
{
for
(
pp
=
&
np
->
msgidqueue
;
*
pp
;
pp
=
&
(
*
pp
)
->
next
)
{
...
@@ -685,11 +685,11 @@ static inline int mq_dequeue(struct capi_ncci * np, __u16 msgid)
...
@@ -685,11 +685,11 @@ static inline int mq_dequeue(struct capi_ncci * np, __u16 msgid)
return
0
;
return
0
;
}
}
static
void
controllercb_appl_registered
(
struct
capi_ctr
*
card
,
__
u16
appl
)
static
void
controllercb_appl_registered
(
struct
capi_ctr
*
card
,
u16
appl
)
{
{
}
}
static
void
controllercb_appl_released
(
struct
capi_ctr
*
card
,
__
u16
appl
)
static
void
controllercb_appl_released
(
struct
capi_ctr
*
card
,
u16
appl
)
{
{
struct
capi_ncci
**
pp
,
**
nextpp
;
struct
capi_ncci
**
pp
,
**
nextpp
;
for
(
pp
=
&
APPL
(
appl
)
->
nccilist
;
*
pp
;
pp
=
nextpp
)
{
for
(
pp
=
&
APPL
(
appl
)
->
nccilist
;
*
pp
;
pp
=
nextpp
)
{
...
@@ -716,7 +716,7 @@ static void controllercb_appl_released(struct capi_ctr * card, __u16 appl)
...
@@ -716,7 +716,7 @@ static void controllercb_appl_released(struct capi_ctr * card, __u16 appl)
*/
*/
static
void
controllercb_new_ncci
(
struct
capi_ctr
*
card
,
static
void
controllercb_new_ncci
(
struct
capi_ctr
*
card
,
__u16
appl
,
__u32
ncci
,
__
u32
winsize
)
u16
appl
,
u32
ncci
,
u32
winsize
)
{
{
struct
capi_ncci
*
np
;
struct
capi_ncci
*
np
;
if
(
!
VALID_APPLID
(
appl
))
{
if
(
!
VALID_APPLID
(
appl
))
{
...
@@ -745,7 +745,7 @@ static void controllercb_new_ncci(struct capi_ctr * card,
...
@@ -745,7 +745,7 @@ static void controllercb_new_ncci(struct capi_ctr * card,
}
}
static
void
controllercb_free_ncci
(
struct
capi_ctr
*
card
,
static
void
controllercb_free_ncci
(
struct
capi_ctr
*
card
,
__u16
appl
,
__
u32
ncci
)
u16
appl
,
u32
ncci
)
{
{
struct
capi_ncci
**
pp
;
struct
capi_ncci
**
pp
;
if
(
!
VALID_APPLID
(
appl
))
{
if
(
!
VALID_APPLID
(
appl
))
{
...
@@ -767,7 +767,7 @@ static void controllercb_free_ncci(struct capi_ctr * card,
...
@@ -767,7 +767,7 @@ static void controllercb_free_ncci(struct capi_ctr * card,
}
}
static
struct
capi_ncci
*
find_ncci
(
struct
capi_appl
*
app
,
__
u32
ncci
)
static
struct
capi_ncci
*
find_ncci
(
struct
capi_appl
*
app
,
u32
ncci
)
{
{
struct
capi_ncci
*
np
;
struct
capi_ncci
*
np
;
for
(
np
=
app
->
nccilist
;
np
;
np
=
np
->
next
)
{
for
(
np
=
app
->
nccilist
;
np
;
np
=
np
->
next
)
{
...
@@ -784,7 +784,7 @@ static void recv_handler(void *dummy)
...
@@ -784,7 +784,7 @@ static void recv_handler(void *dummy)
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
while
((
skb
=
skb_dequeue
(
&
recv_queue
))
!=
0
)
{
while
((
skb
=
skb_dequeue
(
&
recv_queue
))
!=
0
)
{
__
u16
appl
=
CAPIMSG_APPID
(
skb
->
data
);
u16
appl
=
CAPIMSG_APPID
(
skb
->
data
);
struct
capi_ncci
*
np
;
struct
capi_ncci
*
np
;
if
(
!
VALID_APPLID
(
appl
))
{
if
(
!
VALID_APPLID
(
appl
))
{
printk
(
KERN_ERR
"kcapi: recv_handler: applid %d ? (%s)
\n
"
,
printk
(
KERN_ERR
"kcapi: recv_handler: applid %d ? (%s)
\n
"
,
...
@@ -817,10 +817,10 @@ static void recv_handler(void *dummy)
...
@@ -817,10 +817,10 @@ static void recv_handler(void *dummy)
}
}
static
void
controllercb_handle_capimsg
(
struct
capi_ctr
*
card
,
static
void
controllercb_handle_capimsg
(
struct
capi_ctr
*
card
,
__
u16
appl
,
struct
sk_buff
*
skb
)
u16
appl
,
struct
sk_buff
*
skb
)
{
{
int
showctl
=
0
;
int
showctl
=
0
;
__
u8
cmd
,
subcmd
;
u8
cmd
,
subcmd
;
if
(
card
->
cardstate
!=
CARD_RUNNING
)
{
if
(
card
->
cardstate
!=
CARD_RUNNING
)
{
printk
(
KERN_INFO
"kcapi: controller %d not active, got: %s"
,
printk
(
KERN_INFO
"kcapi: controller %d not active, got: %s"
,
...
@@ -862,7 +862,7 @@ static void controllercb_handle_capimsg(struct capi_ctr * card,
...
@@ -862,7 +862,7 @@ static void controllercb_handle_capimsg(struct capi_ctr * card,
static
void
controllercb_ready
(
struct
capi_ctr
*
card
)
static
void
controllercb_ready
(
struct
capi_ctr
*
card
)
{
{
__
u16
appl
;
u16
appl
;
card
->
cardstate
=
CARD_RUNNING
;
card
->
cardstate
=
CARD_RUNNING
;
...
@@ -880,7 +880,7 @@ static void controllercb_ready(struct capi_ctr * card)
...
@@ -880,7 +880,7 @@ static void controllercb_ready(struct capi_ctr * card)
static
void
controllercb_reseted
(
struct
capi_ctr
*
card
)
static
void
controllercb_reseted
(
struct
capi_ctr
*
card
)
{
{
__
u16
appl
;
u16
appl
;
if
(
card
->
cardstate
==
CARD_FREE
)
if
(
card
->
cardstate
==
CARD_FREE
)
return
;
return
;
...
@@ -1088,7 +1088,7 @@ void detach_capi_driver(struct capi_driver *driver)
...
@@ -1088,7 +1088,7 @@ void detach_capi_driver(struct capi_driver *driver)
/* -------- CAPI2.0 Interface ---------------------------------- */
/* -------- CAPI2.0 Interface ---------------------------------- */
/* ------------------------------------------------------------- */
/* ------------------------------------------------------------- */
static
__
u16
capi_isinstalled
(
void
)
static
u16
capi_isinstalled
(
void
)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
CAPI_MAXCONTR
;
i
++
)
{
for
(
i
=
0
;
i
<
CAPI_MAXCONTR
;
i
++
)
{
...
@@ -1098,7 +1098,7 @@ static __u16 capi_isinstalled(void)
...
@@ -1098,7 +1098,7 @@ static __u16 capi_isinstalled(void)
return
CAPI_REGNOTINSTALLED
;
return
CAPI_REGNOTINSTALLED
;
}
}
static
__u16
capi_register
(
capi_register_params
*
rparam
,
__
u16
*
applidp
)
static
u16
capi_register
(
capi_register_params
*
rparam
,
u16
*
applidp
)
{
{
int
appl
;
int
appl
;
int
i
;
int
i
;
...
@@ -1131,7 +1131,7 @@ static __u16 capi_register(capi_register_params * rparam, __u16 * applidp)
...
@@ -1131,7 +1131,7 @@ static __u16 capi_register(capi_register_params * rparam, __u16 * applidp)
return
CAPI_NOERROR
;
return
CAPI_NOERROR
;
}
}
static
__u16
capi_release
(
__
u16
applid
)
static
u16
capi_release
(
u16
applid
)
{
{
int
i
;
int
i
;
...
@@ -1154,12 +1154,12 @@ static __u16 capi_release(__u16 applid)
...
@@ -1154,12 +1154,12 @@ static __u16 capi_release(__u16 applid)
return
CAPI_NOERROR
;
return
CAPI_NOERROR
;
}
}
static
__u16
capi_put_message
(
__
u16
applid
,
struct
sk_buff
*
skb
)
static
u16
capi_put_message
(
u16
applid
,
struct
sk_buff
*
skb
)
{
{
struct
capi_ncci
*
np
;
struct
capi_ncci
*
np
;
__
u32
contr
;
u32
contr
;
int
showctl
=
0
;
int
showctl
=
0
;
__
u8
cmd
,
subcmd
;
u8
cmd
,
subcmd
;
if
(
ncards
==
0
)
if
(
ncards
==
0
)
return
CAPI_REGNOTINSTALLED
;
return
CAPI_REGNOTINSTALLED
;
...
@@ -1212,7 +1212,7 @@ static __u16 capi_put_message(__u16 applid, struct sk_buff *skb)
...
@@ -1212,7 +1212,7 @@ static __u16 capi_put_message(__u16 applid, struct sk_buff *skb)
return
CAPI_NOERROR
;
return
CAPI_NOERROR
;
}
}
static
__u16
capi_get_message
(
__
u16
applid
,
struct
sk_buff
**
msgp
)
static
u16
capi_get_message
(
u16
applid
,
struct
sk_buff
**
msgp
)
{
{
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
...
@@ -1224,8 +1224,8 @@ static __u16 capi_get_message(__u16 applid, struct sk_buff **msgp)
...
@@ -1224,8 +1224,8 @@ static __u16 capi_get_message(__u16 applid, struct sk_buff **msgp)
return
CAPI_NOERROR
;
return
CAPI_NOERROR
;
}
}
static
__u16
capi_set_signal
(
__
u16
applid
,
static
u16
capi_set_signal
(
u16
applid
,
void
(
*
signal
)
(
__
u16
applid
,
void
*
param
),
void
(
*
signal
)
(
u16
applid
,
void
*
param
),
void
*
param
)
void
*
param
)
{
{
if
(
!
VALID_APPLID
(
applid
))
if
(
!
VALID_APPLID
(
applid
))
...
@@ -1235,7 +1235,7 @@ static __u16 capi_set_signal(__u16 applid,
...
@@ -1235,7 +1235,7 @@ static __u16 capi_set_signal(__u16 applid,
return
CAPI_NOERROR
;
return
CAPI_NOERROR
;
}
}
static
__u16
capi_get_manufacturer
(
__u32
contr
,
__
u8
buf
[
CAPI_MANUFACTURER_LEN
])
static
u16
capi_get_manufacturer
(
u32
contr
,
u8
buf
[
CAPI_MANUFACTURER_LEN
])
{
{
if
(
contr
==
0
)
{
if
(
contr
==
0
)
{
strncpy
(
buf
,
capi_manufakturer
,
CAPI_MANUFACTURER_LEN
);
strncpy
(
buf
,
capi_manufakturer
,
CAPI_MANUFACTURER_LEN
);
...
@@ -1248,7 +1248,7 @@ static __u16 capi_get_manufacturer(__u32 contr, __u8 buf[CAPI_MANUFACTURER_LEN])
...
@@ -1248,7 +1248,7 @@ static __u16 capi_get_manufacturer(__u32 contr, __u8 buf[CAPI_MANUFACTURER_LEN])
return
CAPI_NOERROR
;
return
CAPI_NOERROR
;
}
}
static
__u16
capi_get_version
(
__
u32
contr
,
struct
capi_version
*
verp
)
static
u16
capi_get_version
(
u32
contr
,
struct
capi_version
*
verp
)
{
{
if
(
contr
==
0
)
{
if
(
contr
==
0
)
{
*
verp
=
driver_version
;
*
verp
=
driver_version
;
...
@@ -1261,7 +1261,7 @@ static __u16 capi_get_version(__u32 contr, struct capi_version *verp)
...
@@ -1261,7 +1261,7 @@ static __u16 capi_get_version(__u32 contr, struct capi_version *verp)
return
CAPI_NOERROR
;
return
CAPI_NOERROR
;
}
}
static
__u16
capi_get_serial
(
__u32
contr
,
__
u8
serial
[
CAPI_SERIAL_LEN
])
static
u16
capi_get_serial
(
u32
contr
,
u8
serial
[
CAPI_SERIAL_LEN
])
{
{
if
(
contr
==
0
)
{
if
(
contr
==
0
)
{
strncpy
(
serial
,
driver_serial
,
CAPI_SERIAL_LEN
);
strncpy
(
serial
,
driver_serial
,
CAPI_SERIAL_LEN
);
...
@@ -1274,7 +1274,7 @@ static __u16 capi_get_serial(__u32 contr, __u8 serial[CAPI_SERIAL_LEN])
...
@@ -1274,7 +1274,7 @@ static __u16 capi_get_serial(__u32 contr, __u8 serial[CAPI_SERIAL_LEN])
return
CAPI_NOERROR
;
return
CAPI_NOERROR
;
}
}
static
__u16
capi_get_profile
(
__
u32
contr
,
struct
capi_profile
*
profp
)
static
u16
capi_get_profile
(
u32
contr
,
struct
capi_profile
*
profp
)
{
{
if
(
contr
==
0
)
{
if
(
contr
==
0
)
{
profp
->
ncontroller
=
ncards
;
profp
->
ncontroller
=
ncards
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment