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
nexedi
linux
Commits
3acd2f2c
Commit
3acd2f2c
authored
Apr 30, 2002
by
Kai Germaschewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ISDN cleanup: drivers/isdn/hardware/avm s/__u{32,16,8}/u{32,16,8}/
parent
248c1097
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
104 deletions
+104
-104
drivers/isdn/hardware/avm/avmcard.h
drivers/isdn/hardware/avm/avmcard.h
+7
-7
drivers/isdn/hardware/avm/b1.c
drivers/isdn/hardware/avm/b1.c
+14
-14
drivers/isdn/hardware/avm/b1dma.c
drivers/isdn/hardware/avm/b1dma.c
+39
-39
drivers/isdn/hardware/avm/c4.c
drivers/isdn/hardware/avm/c4.c
+40
-40
drivers/isdn/hardware/avm/t1isa.c
drivers/isdn/hardware/avm/t1isa.c
+4
-4
No files found.
drivers/isdn/hardware/avm/avmcard.h
View file @
3acd2f2c
...
...
@@ -41,12 +41,12 @@ enum avmcardtype {
typedef
struct
avmcard_dmabuf
{
long
size
;
__
u8
*
dmabuf
;
u8
*
dmabuf
;
dma_addr_t
dmaaddr
;
}
avmcard_dmabuf
;
typedef
struct
avmcard_dmainfo
{
__
u32
recvlen
;
u32
recvlen
;
avmcard_dmabuf
recvbuf
;
avmcard_dmabuf
sendbuf
;
...
...
@@ -71,7 +71,7 @@ typedef struct avmcard {
int
interrupt
;
void
*
mbase
;
volatile
__
u32
csr
;
volatile
u32
csr
;
avmcard_dmainfo
*
dma
;
struct
avmctrl_info
{
...
...
@@ -542,9 +542,9 @@ int b1_loaded(avmcard *card);
int
b1_load_firmware
(
struct
capi_ctr
*
ctrl
,
capiloaddata
*
data
);
void
b1_reset_ctr
(
struct
capi_ctr
*
ctrl
);
void
b1_register_appl
(
struct
capi_ctr
*
ctrl
,
__
u16
appl
,
void
b1_register_appl
(
struct
capi_ctr
*
ctrl
,
u16
appl
,
capi_register_params
*
rp
);
void
b1_release_appl
(
struct
capi_ctr
*
ctrl
,
__
u16
appl
);
void
b1_release_appl
(
struct
capi_ctr
*
ctrl
,
u16
appl
);
void
b1_send_message
(
struct
capi_ctr
*
ctrl
,
struct
sk_buff
*
skb
);
void
b1_parse_version
(
avmctrl_info
*
card
);
void
b1_handle_interrupt
(
avmcard
*
card
);
...
...
@@ -567,9 +567,9 @@ int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data);
void
b1dma_reset_ctr
(
struct
capi_ctr
*
ctrl
);
void
b1dma_remove_ctr
(
struct
capi_ctr
*
ctrl
);
void
b1dma_register_appl
(
struct
capi_ctr
*
ctrl
,
__
u16
appl
,
u16
appl
,
capi_register_params
*
rp
);
void
b1dma_release_appl
(
struct
capi_ctr
*
ctrl
,
__
u16
appl
);
void
b1dma_release_appl
(
struct
capi_ctr
*
ctrl
,
u16
appl
);
void
b1dma_send_message
(
struct
capi_ctr
*
ctrl
,
struct
sk_buff
*
skb
);
int
b1dmactl_read_proc
(
char
*
page
,
char
**
start
,
off_t
off
,
int
count
,
int
*
eof
,
struct
capi_ctr
*
ctrl
);
...
...
drivers/isdn/hardware/avm/b1.c
View file @
3acd2f2c
...
...
@@ -297,7 +297,7 @@ void b1_reset_ctr(struct capi_ctr *ctrl)
}
void
b1_register_appl
(
struct
capi_ctr
*
ctrl
,
__
u16
appl
,
u16
appl
,
capi_register_params
*
rp
)
{
avmctrl_info
*
cinfo
=
(
avmctrl_info
*
)(
ctrl
->
driverdata
);
...
...
@@ -323,7 +323,7 @@ void b1_register_appl(struct capi_ctr *ctrl,
ctrl
->
appl_registered
(
ctrl
,
appl
);
}
void
b1_release_appl
(
struct
capi_ctr
*
ctrl
,
__
u16
appl
)
void
b1_release_appl
(
struct
capi_ctr
*
ctrl
,
u16
appl
)
{
avmctrl_info
*
cinfo
=
(
avmctrl_info
*
)(
ctrl
->
driverdata
);
avmcard
*
card
=
cinfo
->
card
;
...
...
@@ -343,14 +343,14 @@ void b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
avmcard
*
card
=
cinfo
->
card
;
unsigned
int
port
=
card
->
port
;
unsigned
long
flags
;
__
u16
len
=
CAPIMSG_LEN
(
skb
->
data
);
__
u8
cmd
=
CAPIMSG_COMMAND
(
skb
->
data
);
__
u8
subcmd
=
CAPIMSG_SUBCOMMAND
(
skb
->
data
);
u16
len
=
CAPIMSG_LEN
(
skb
->
data
);
u8
cmd
=
CAPIMSG_COMMAND
(
skb
->
data
);
u8
subcmd
=
CAPIMSG_SUBCOMMAND
(
skb
->
data
);
save_flags
(
flags
);
cli
();
if
(
CAPICMD
(
cmd
,
subcmd
)
==
CAPI_DATA_B3_REQ
)
{
__
u16
dlen
=
CAPIMSG_DATALEN
(
skb
->
data
);
u16
dlen
=
CAPIMSG_DATALEN
(
skb
->
data
);
b1_put_byte
(
port
,
SEND_DATA_B3_REQ
);
b1_put_slice
(
port
,
skb
->
data
,
len
);
b1_put_slice
(
port
,
skb
->
data
+
len
,
dlen
);
...
...
@@ -369,8 +369,8 @@ void b1_parse_version(avmctrl_info *cinfo)
struct
capi_ctr
*
ctrl
=
cinfo
->
capi_ctrl
;
avmcard
*
card
=
cinfo
->
card
;
capi_profile
*
profp
;
__
u8
*
dversion
;
__
u8
flag
;
u8
*
dversion
;
u8
flag
;
int
i
,
j
;
for
(
j
=
0
;
j
<
AVM_MAXVERSION
;
j
++
)
...
...
@@ -394,7 +394,7 @@ void b1_parse_version(avmctrl_info *cinfo)
profp
=
&
ctrl
->
profile
;
flag
=
((
__
u8
*
)(
profp
->
manu
))[
1
];
flag
=
((
u8
*
)(
profp
->
manu
))[
1
];
switch
(
flag
)
{
case
0
:
if
(
cinfo
->
version
[
VER_CARDTYPE
])
strcpy
(
cinfo
->
cardname
,
cinfo
->
version
[
VER_CARDTYPE
]);
...
...
@@ -410,7 +410,7 @@ void b1_parse_version(avmctrl_info *cinfo)
printk
(
KERN_NOTICE
"%s: card %d
\"
%s
\"
ready.
\n
"
,
card
->
name
,
ctrl
->
cnr
,
cinfo
->
cardname
);
flag
=
((
__
u8
*
)(
profp
->
manu
))[
3
];
flag
=
((
u8
*
)(
profp
->
manu
))[
3
];
if
(
flag
)
printk
(
KERN_NOTICE
"%s: card %d Protocol:%s%s%s%s%s%s%s
\n
"
,
card
->
name
,
...
...
@@ -424,7 +424,7 @@ void b1_parse_version(avmctrl_info *cinfo)
(
flag
&
0x40
)
?
" 1TR6"
:
""
);
flag
=
((
__
u8
*
)(
profp
->
manu
))[
5
];
flag
=
((
u8
*
)(
profp
->
manu
))[
5
];
if
(
flag
)
printk
(
KERN_NOTICE
"%s: card %d Linetype:%s%s%s%s
\n
"
,
card
->
name
,
...
...
@@ -574,7 +574,7 @@ int b1ctl_read_proc(char *page, char **start, off_t off,
{
avmctrl_info
*
cinfo
=
(
avmctrl_info
*
)(
ctrl
->
driverdata
);
avmcard
*
card
=
cinfo
->
card
;
__
u8
flag
;
u8
flag
;
int
len
=
0
;
char
*
s
;
...
...
@@ -604,7 +604,7 @@ int b1ctl_read_proc(char *page, char **start, off_t off,
len
+=
sprintf
(
page
+
len
,
"%-16s %s
\n
"
,
"ver_serial"
,
s
);
if
(
card
->
cardtype
!=
avm_m1
)
{
flag
=
((
__
u8
*
)(
ctrl
->
profile
.
manu
))[
3
];
flag
=
((
u8
*
)(
ctrl
->
profile
.
manu
))[
3
];
if
(
flag
)
len
+=
sprintf
(
page
+
len
,
"%-16s%s%s%s%s%s%s%s
\n
"
,
"protocol"
,
...
...
@@ -618,7 +618,7 @@ int b1ctl_read_proc(char *page, char **start, off_t off,
);
}
if
(
card
->
cardtype
!=
avm_m1
)
{
flag
=
((
__
u8
*
)(
ctrl
->
profile
.
manu
))[
5
];
flag
=
((
u8
*
)(
ctrl
->
profile
.
manu
))[
5
];
if
(
flag
)
len
+=
sprintf
(
page
+
len
,
"%-16s%s%s%s%s
\n
"
,
"linetype"
,
...
...
drivers/isdn/hardware/avm/b1dma.c
View file @
3acd2f2c
...
...
@@ -130,41 +130,41 @@ static int b1dma_fromlink(avmcard *card, void *buf, unsigned int len)
return
0
;
}
static
int
WriteReg
(
avmcard
*
card
,
__u32
reg
,
__
u8
val
)
static
int
WriteReg
(
avmcard
*
card
,
u32
reg
,
u8
val
)
{
__
u8
cmd
=
0x00
;
u8
cmd
=
0x00
;
if
(
b1dma_tolink
(
card
,
&
cmd
,
1
)
==
0
&&
b1dma_tolink
(
card
,
&
reg
,
4
)
==
0
)
{
__
u32
tmp
=
val
;
u32
tmp
=
val
;
return
b1dma_tolink
(
card
,
&
tmp
,
4
);
}
return
-
1
;
}
static
__u8
ReadReg
(
avmcard
*
card
,
__
u32
reg
)
static
u8
ReadReg
(
avmcard
*
card
,
u32
reg
)
{
__
u8
cmd
=
0x01
;
u8
cmd
=
0x01
;
if
(
b1dma_tolink
(
card
,
&
cmd
,
1
)
==
0
&&
b1dma_tolink
(
card
,
&
reg
,
4
)
==
0
)
{
__
u32
tmp
;
u32
tmp
;
if
(
b1dma_fromlink
(
card
,
&
tmp
,
4
)
==
0
)
return
(
__
u8
)
tmp
;
return
(
u8
)
tmp
;
}
return
0xff
;
}
/* ------------------------------------------------------------- */
static
inline
void
_put_byte
(
void
**
pp
,
__
u8
val
)
static
inline
void
_put_byte
(
void
**
pp
,
u8
val
)
{
__
u8
*
s
=
*
pp
;
u8
*
s
=
*
pp
;
*
s
++
=
val
;
*
pp
=
s
;
}
static
inline
void
_put_word
(
void
**
pp
,
__
u32
val
)
static
inline
void
_put_word
(
void
**
pp
,
u32
val
)
{
__
u8
*
s
=
*
pp
;
u8
*
s
=
*
pp
;
*
s
++
=
val
&
0xff
;
*
s
++
=
(
val
>>
8
)
&
0xff
;
*
s
++
=
(
val
>>
16
)
&
0xff
;
...
...
@@ -180,19 +180,19 @@ static inline void _put_slice(void **pp, unsigned char *dp, unsigned int len)
_put_byte
(
pp
,
*
dp
++
);
}
static
inline
__
u8
_get_byte
(
void
**
pp
)
static
inline
u8
_get_byte
(
void
**
pp
)
{
__
u8
*
s
=
*
pp
;
__
u8
val
;
u8
*
s
=
*
pp
;
u8
val
;
val
=
*
s
++
;
*
pp
=
s
;
return
val
;
}
static
inline
__
u32
_get_word
(
void
**
pp
)
static
inline
u32
_get_word
(
void
**
pp
)
{
__
u8
*
s
=
*
pp
;
__
u32
val
;
u8
*
s
=
*
pp
;
u32
val
;
val
=
*
s
++
;
val
|=
(
*
s
++
<<
8
);
val
|=
(
*
s
++
<<
16
);
...
...
@@ -201,7 +201,7 @@ static inline __u32 _get_word(void **pp)
return
val
;
}
static
inline
__
u32
_get_slice
(
void
**
pp
,
unsigned
char
*
dp
)
static
inline
u32
_get_slice
(
void
**
pp
,
unsigned
char
*
dp
)
{
unsigned
int
len
,
i
;
...
...
@@ -357,9 +357,9 @@ static void b1dma_dispatch_tx(avmcard *card)
avmcard_dmainfo
*
dma
=
card
->
dma
;
unsigned
long
flags
;
struct
sk_buff
*
skb
;
__
u8
cmd
,
subcmd
;
__
u16
len
;
__
u32
txlen
;
u8
cmd
,
subcmd
;
u16
len
;
u32
txlen
;
int
inint
;
void
*
p
;
...
...
@@ -391,7 +391,7 @@ static void b1dma_dispatch_tx(avmcard *card)
p
=
dma
->
sendbuf
.
dmabuf
;
if
(
CAPICMD
(
cmd
,
subcmd
)
==
CAPI_DATA_B3_REQ
)
{
__
u16
dlen
=
CAPIMSG_DATALEN
(
skb
->
data
);
u16
dlen
=
CAPIMSG_DATALEN
(
skb
->
data
);
_put_byte
(
&
p
,
SEND_DATA_B3_REQ
);
_put_slice
(
&
p
,
skb
->
data
,
len
);
_put_slice
(
&
p
,
skb
->
data
+
len
,
dlen
);
...
...
@@ -399,7 +399,7 @@ static void b1dma_dispatch_tx(avmcard *card)
_put_byte
(
&
p
,
SEND_MESSAGE
);
_put_slice
(
&
p
,
skb
->
data
,
len
);
}
txlen
=
(
__u8
*
)
p
-
(
__
u8
*
)
dma
->
sendbuf
.
dmabuf
;
txlen
=
(
u8
*
)
p
-
(
u8
*
)
dma
->
sendbuf
.
dmabuf
;
#ifdef CONFIG_B1DMA_DEBUG
printk
(
KERN_DEBUG
"tx(%d): put msg len=%d
\n
"
,
inint
,
txlen
);
...
...
@@ -447,7 +447,7 @@ static void queue_pollack(avmcard *card)
_put_byte
(
&
p
,
0
);
_put_byte
(
&
p
,
0
);
_put_byte
(
&
p
,
SEND_POLLACK
);
skb_put
(
skb
,
(
__u8
*
)
p
-
(
__
u8
*
)
skb
->
data
);
skb_put
(
skb
,
(
u8
*
)
p
-
(
u8
*
)
skb
->
data
);
skb_queue_tail
(
&
card
->
dma
->
send_queue
,
skb
);
b1dma_dispatch_tx
(
card
);
...
...
@@ -462,8 +462,8 @@ static void b1dma_handle_rx(avmcard *card)
struct
capi_ctr
*
ctrl
=
cinfo
->
capi_ctrl
;
struct
sk_buff
*
skb
;
void
*
p
=
dma
->
recvbuf
.
dmabuf
+
4
;
__
u32
ApplId
,
MsgLen
,
DataB3Len
,
NCCI
,
WindowSize
;
__
u8
b1cmd
=
_get_byte
(
&
p
);
u32
ApplId
,
MsgLen
,
DataB3Len
,
NCCI
,
WindowSize
;
u8
b1cmd
=
_get_byte
(
&
p
);
#ifdef CONFIG_B1DMA_DEBUG
printk
(
KERN_DEBUG
"rx: 0x%x %lu
\n
"
,
b1cmd
,
(
unsigned
long
)
dma
->
recvlen
);
...
...
@@ -585,8 +585,8 @@ static void b1dma_handle_rx(avmcard *card)
static
void
b1dma_handle_interrupt
(
avmcard
*
card
)
{
__
u32
status
=
b1dmainmeml
(
card
->
mbase
+
AMCC_INTCSR
);
__
u32
newcsr
;
u32
status
=
b1dmainmeml
(
card
->
mbase
+
AMCC_INTCSR
);
u32
newcsr
;
if
((
status
&
ANY_S5933_INT
)
==
0
)
return
;
...
...
@@ -598,9 +598,9 @@ static void b1dma_handle_interrupt(avmcard *card)
if
((
status
&
RX_TC_INT
)
!=
0
)
{
struct
avmcard_dmainfo
*
dma
=
card
->
dma
;
__
u32
rxlen
;
u32
rxlen
;
if
(
card
->
dma
->
recvlen
==
0
)
{
dma
->
recvlen
=
*
((
__
u32
*
)
dma
->
recvbuf
.
dmabuf
);
dma
->
recvlen
=
*
((
u32
*
)
dma
->
recvbuf
.
dmabuf
);
rxlen
=
(
dma
->
recvlen
+
3
)
&
~
3
;
b1dmaoutmeml
(
card
->
mbase
+
AMCC_RXPTR
,
dma
->
recvbuf
.
dmaaddr
+
4
);
...
...
@@ -695,7 +695,7 @@ static void b1dma_send_init(avmcard *card)
_put_word
(
&
p
,
CAPI_MAXAPPL
);
_put_word
(
&
p
,
AVM_NCCI_PER_CHANNEL
*
30
);
_put_word
(
&
p
,
card
->
cardnr
-
1
);
skb_put
(
skb
,
(
__u8
*
)
p
-
(
__
u8
*
)
skb
->
data
);
skb_put
(
skb
,
(
u8
*
)
p
-
(
u8
*
)
skb
->
data
);
skb_queue_tail
(
&
card
->
dma
->
send_queue
,
skb
);
b1dma_dispatch_tx
(
card
);
...
...
@@ -772,7 +772,7 @@ void b1dma_reset_ctr(struct capi_ctr *ctrl)
void
b1dma_register_appl
(
struct
capi_ctr
*
ctrl
,
__
u16
appl
,
u16
appl
,
capi_register_params
*
rp
)
{
avmctrl_info
*
cinfo
=
(
avmctrl_info
*
)(
ctrl
->
driverdata
);
...
...
@@ -801,7 +801,7 @@ void b1dma_register_appl(struct capi_ctr *ctrl,
_put_word
(
&
p
,
nconn
);
_put_word
(
&
p
,
rp
->
datablkcnt
);
_put_word
(
&
p
,
rp
->
datablklen
);
skb_put
(
skb
,
(
__u8
*
)
p
-
(
__
u8
*
)
skb
->
data
);
skb_put
(
skb
,
(
u8
*
)
p
-
(
u8
*
)
skb
->
data
);
skb_queue_tail
(
&
card
->
dma
->
send_queue
,
skb
);
b1dma_dispatch_tx
(
card
);
...
...
@@ -811,7 +811,7 @@ void b1dma_register_appl(struct capi_ctr *ctrl,
/* ------------------------------------------------------------- */
void
b1dma_release_appl
(
struct
capi_ctr
*
ctrl
,
__
u16
appl
)
void
b1dma_release_appl
(
struct
capi_ctr
*
ctrl
,
u16
appl
)
{
avmctrl_info
*
cinfo
=
(
avmctrl_info
*
)(
ctrl
->
driverdata
);
avmcard
*
card
=
cinfo
->
card
;
...
...
@@ -830,7 +830,7 @@ void b1dma_release_appl(struct capi_ctr *ctrl, __u16 appl)
_put_byte
(
&
p
,
SEND_RELEASE
);
_put_word
(
&
p
,
appl
);
skb_put
(
skb
,
(
__u8
*
)
p
-
(
__
u8
*
)
skb
->
data
);
skb_put
(
skb
,
(
u8
*
)
p
-
(
u8
*
)
skb
->
data
);
skb_queue_tail
(
&
card
->
dma
->
send_queue
,
skb
);
b1dma_dispatch_tx
(
card
);
}
...
...
@@ -853,10 +853,10 @@ int b1dmactl_read_proc(char *page, char **start, off_t off,
avmctrl_info
*
cinfo
=
(
avmctrl_info
*
)(
ctrl
->
driverdata
);
avmcard
*
card
=
cinfo
->
card
;
unsigned
long
flags
;
__
u8
flag
;
u8
flag
;
int
len
=
0
;
char
*
s
;
__
u32
txoff
,
txlen
,
rxoff
,
rxlen
,
csr
;
u32
txoff
,
txlen
,
rxoff
,
rxlen
,
csr
;
len
+=
sprintf
(
page
+
len
,
"%-16s %s
\n
"
,
"name"
,
card
->
name
);
len
+=
sprintf
(
page
+
len
,
"%-16s 0x%x
\n
"
,
"io"
,
card
->
port
);
...
...
@@ -883,7 +883,7 @@ int b1dmactl_read_proc(char *page, char **start, off_t off,
len
+=
sprintf
(
page
+
len
,
"%-16s %s
\n
"
,
"ver_serial"
,
s
);
if
(
card
->
cardtype
!=
avm_m1
)
{
flag
=
((
__
u8
*
)(
ctrl
->
profile
.
manu
))[
3
];
flag
=
((
u8
*
)(
ctrl
->
profile
.
manu
))[
3
];
if
(
flag
)
len
+=
sprintf
(
page
+
len
,
"%-16s%s%s%s%s%s%s%s
\n
"
,
"protocol"
,
...
...
@@ -897,7 +897,7 @@ int b1dmactl_read_proc(char *page, char **start, off_t off,
);
}
if
(
card
->
cardtype
!=
avm_m1
)
{
flag
=
((
__
u8
*
)(
ctrl
->
profile
.
manu
))[
5
];
flag
=
((
u8
*
)(
ctrl
->
profile
.
manu
))[
5
];
if
(
flag
)
len
+=
sprintf
(
page
+
len
,
"%-16s%s%s%s%s
\n
"
,
"linetype"
,
...
...
drivers/isdn/hardware/avm/c4.c
View file @
3acd2f2c
...
...
@@ -193,14 +193,14 @@ static int c4_peek(avmcard *card, unsigned long off, unsigned long *valuep)
static
int
c4_load_t4file
(
avmcard
*
card
,
capiloaddatapart
*
t4file
)
{
__
u32
val
;
u32
val
;
unsigned
char
*
dp
;
int
left
,
retval
;
__
u32
loadoff
=
0
;
u32
loadoff
=
0
;
dp
=
t4file
->
data
;
left
=
t4file
->
len
;
while
(
left
>=
sizeof
(
__
u32
))
{
while
(
left
>=
sizeof
(
u32
))
{
if
(
t4file
->
user
)
{
retval
=
copy_from_user
(
&
val
,
dp
,
sizeof
(
val
));
if
(
retval
)
...
...
@@ -213,9 +213,9 @@ static int c4_load_t4file(avmcard *card, capiloaddatapart * t4file)
card
->
name
);
return
-
EIO
;
}
left
-=
sizeof
(
__
u32
);
dp
+=
sizeof
(
__
u32
);
loadoff
+=
sizeof
(
__
u32
);
left
-=
sizeof
(
u32
);
dp
+=
sizeof
(
u32
);
loadoff
+=
sizeof
(
u32
);
}
if
(
left
)
{
val
=
0
;
...
...
@@ -237,16 +237,16 @@ static int c4_load_t4file(avmcard *card, capiloaddatapart * t4file)
/* ------------------------------------------------------------- */
static
inline
void
_put_byte
(
void
**
pp
,
__
u8
val
)
static
inline
void
_put_byte
(
void
**
pp
,
u8
val
)
{
__
u8
*
s
=
*
pp
;
u8
*
s
=
*
pp
;
*
s
++
=
val
;
*
pp
=
s
;
}
static
inline
void
_put_word
(
void
**
pp
,
__
u32
val
)
static
inline
void
_put_word
(
void
**
pp
,
u32
val
)
{
__
u8
*
s
=
*
pp
;
u8
*
s
=
*
pp
;
*
s
++
=
val
&
0xff
;
*
s
++
=
(
val
>>
8
)
&
0xff
;
*
s
++
=
(
val
>>
16
)
&
0xff
;
...
...
@@ -262,19 +262,19 @@ static inline void _put_slice(void **pp, unsigned char *dp, unsigned int len)
_put_byte
(
pp
,
*
dp
++
);
}
static
inline
__
u8
_get_byte
(
void
**
pp
)
static
inline
u8
_get_byte
(
void
**
pp
)
{
__
u8
*
s
=
*
pp
;
__
u8
val
;
u8
*
s
=
*
pp
;
u8
val
;
val
=
*
s
++
;
*
pp
=
s
;
return
val
;
}
static
inline
__
u32
_get_word
(
void
**
pp
)
static
inline
u32
_get_word
(
void
**
pp
)
{
__
u8
*
s
=
*
pp
;
__
u32
val
;
u8
*
s
=
*
pp
;
u32
val
;
val
=
*
s
++
;
val
|=
(
*
s
++
<<
8
);
val
|=
(
*
s
++
<<
16
);
...
...
@@ -283,7 +283,7 @@ static inline __u32 _get_word(void **pp)
return
val
;
}
static
inline
__
u32
_get_slice
(
void
**
pp
,
unsigned
char
*
dp
)
static
inline
u32
_get_slice
(
void
**
pp
,
unsigned
char
*
dp
)
{
unsigned
int
len
,
i
;
...
...
@@ -411,9 +411,9 @@ static void c4_dispatch_tx(avmcard *card)
avmcard_dmainfo
*
dma
=
card
->
dma
;
unsigned
long
flags
;
struct
sk_buff
*
skb
;
__
u8
cmd
,
subcmd
;
__
u16
len
;
__
u32
txlen
;
u8
cmd
,
subcmd
;
u16
len
;
u32
txlen
;
void
*
p
;
save_flags
(
flags
);
...
...
@@ -442,7 +442,7 @@ static void c4_dispatch_tx(avmcard *card)
p
=
dma
->
sendbuf
.
dmabuf
;
if
(
CAPICMD
(
cmd
,
subcmd
)
==
CAPI_DATA_B3_REQ
)
{
__
u16
dlen
=
CAPIMSG_DATALEN
(
skb
->
data
);
u16
dlen
=
CAPIMSG_DATALEN
(
skb
->
data
);
_put_byte
(
&
p
,
SEND_DATA_B3_REQ
);
_put_slice
(
&
p
,
skb
->
data
,
len
);
_put_slice
(
&
p
,
skb
->
data
+
len
,
dlen
);
...
...
@@ -450,7 +450,7 @@ static void c4_dispatch_tx(avmcard *card)
_put_byte
(
&
p
,
SEND_MESSAGE
);
_put_slice
(
&
p
,
skb
->
data
,
len
);
}
txlen
=
(
__u8
*
)
p
-
(
__
u8
*
)
dma
->
sendbuf
.
dmabuf
;
txlen
=
(
u8
*
)
p
-
(
u8
*
)
dma
->
sendbuf
.
dmabuf
;
#ifdef CONFIG_C4_DEBUG
printk
(
KERN_DEBUG
"%s: tx put msg len=%d
\n
"
,
card
->
name
,
txlen
);
#endif
...
...
@@ -496,7 +496,7 @@ static void queue_pollack(avmcard *card)
_put_byte
(
&
p
,
0
);
_put_byte
(
&
p
,
0
);
_put_byte
(
&
p
,
SEND_POLLACK
);
skb_put
(
skb
,
(
__u8
*
)
p
-
(
__
u8
*
)
skb
->
data
);
skb_put
(
skb
,
(
u8
*
)
p
-
(
u8
*
)
skb
->
data
);
skb_queue_tail
(
&
card
->
dma
->
send_queue
,
skb
);
c4_dispatch_tx
(
card
);
...
...
@@ -511,9 +511,9 @@ static void c4_handle_rx(avmcard *card)
avmctrl_info
*
cinfo
;
struct
sk_buff
*
skb
;
void
*
p
=
dma
->
recvbuf
.
dmabuf
;
__
u32
ApplId
,
MsgLen
,
DataB3Len
,
NCCI
,
WindowSize
;
__
u8
b1cmd
=
_get_byte
(
&
p
);
__
u32
cidx
;
u32
ApplId
,
MsgLen
,
DataB3Len
,
NCCI
,
WindowSize
;
u8
b1cmd
=
_get_byte
(
&
p
);
u32
cidx
;
#ifdef CONFIG_C4_DEBUG
...
...
@@ -674,7 +674,7 @@ static void c4_handle_rx(avmcard *card)
static
void
c4_handle_interrupt
(
avmcard
*
card
)
{
__
u32
status
=
c4inmeml
(
card
->
mbase
+
DOORBELL
);
u32
status
=
c4inmeml
(
card
->
mbase
+
DOORBELL
);
if
(
status
&
DBELL_RESET_HOST
)
{
int
i
;
...
...
@@ -760,13 +760,13 @@ static void c4_send_init(avmcard *card)
_put_word
(
&
p
,
CAPI_MAXAPPL
);
_put_word
(
&
p
,
AVM_NCCI_PER_CHANNEL
*
30
);
_put_word
(
&
p
,
card
->
cardnr
-
1
);
skb_put
(
skb
,
(
__u8
*
)
p
-
(
__
u8
*
)
skb
->
data
);
skb_put
(
skb
,
(
u8
*
)
p
-
(
u8
*
)
skb
->
data
);
skb_queue_tail
(
&
card
->
dma
->
send_queue
,
skb
);
c4_dispatch_tx
(
card
);
}
static
int
queue_sendconfigword
(
avmcard
*
card
,
__
u32
val
)
static
int
queue_sendconfigword
(
avmcard
*
card
,
u32
val
)
{
struct
sk_buff
*
skb
;
void
*
p
;
...
...
@@ -782,7 +782,7 @@ static int queue_sendconfigword(avmcard *card, __u32 val)
_put_byte
(
&
p
,
0
);
_put_byte
(
&
p
,
SEND_CONFIG
);
_put_word
(
&
p
,
val
);
skb_put
(
skb
,
(
__u8
*
)
p
-
(
__
u8
*
)
skb
->
data
);
skb_put
(
skb
,
(
u8
*
)
p
-
(
u8
*
)
skb
->
data
);
skb_queue_tail
(
&
card
->
dma
->
send_queue
,
skb
);
c4_dispatch_tx
(
card
);
...
...
@@ -808,7 +808,7 @@ static int queue_sendconfig(avmcard *card, char cval[4])
_put_byte
(
&
p
,
cval
[
1
]);
_put_byte
(
&
p
,
cval
[
2
]);
_put_byte
(
&
p
,
cval
[
3
]);
skb_put
(
skb
,
(
__u8
*
)
p
-
(
__
u8
*
)
skb
->
data
);
skb_put
(
skb
,
(
u8
*
)
p
-
(
u8
*
)
skb
->
data
);
skb_queue_tail
(
&
card
->
dma
->
send_queue
,
skb
);
c4_dispatch_tx
(
card
);
...
...
@@ -817,7 +817,7 @@ static int queue_sendconfig(avmcard *card, char cval[4])
static
int
c4_send_config
(
avmcard
*
card
,
capiloaddatapart
*
config
)
{
__
u8
val
[
4
];
u8
val
[
4
];
unsigned
char
*
dp
;
int
left
,
retval
;
...
...
@@ -828,7 +828,7 @@ static int c4_send_config(avmcard *card, capiloaddatapart * config)
dp
=
config
->
data
;
left
=
config
->
len
;
while
(
left
>=
sizeof
(
__
u32
))
{
while
(
left
>=
sizeof
(
u32
))
{
if
(
config
->
user
)
{
retval
=
copy_from_user
(
val
,
dp
,
sizeof
(
val
));
if
(
retval
)
...
...
@@ -954,7 +954,7 @@ static void c4_remove_ctr(struct capi_ctr *ctrl)
void
c4_register_appl
(
struct
capi_ctr
*
ctrl
,
__
u16
appl
,
u16
appl
,
capi_register_params
*
rp
)
{
avmctrl_info
*
cinfo
=
(
avmctrl_info
*
)(
ctrl
->
driverdata
);
...
...
@@ -985,7 +985,7 @@ void c4_register_appl(struct capi_ctr *ctrl,
_put_word
(
&
p
,
nconn
);
_put_word
(
&
p
,
rp
->
datablkcnt
);
_put_word
(
&
p
,
rp
->
datablklen
);
skb_put
(
skb
,
(
__u8
*
)
p
-
(
__
u8
*
)
skb
->
data
);
skb_put
(
skb
,
(
u8
*
)
p
-
(
u8
*
)
skb
->
data
);
skb_queue_tail
(
&
card
->
dma
->
send_queue
,
skb
);
c4_dispatch_tx
(
card
);
...
...
@@ -996,7 +996,7 @@ void c4_register_appl(struct capi_ctr *ctrl,
/* ------------------------------------------------------------- */
void
c4_release_appl
(
struct
capi_ctr
*
ctrl
,
__
u16
appl
)
void
c4_release_appl
(
struct
capi_ctr
*
ctrl
,
u16
appl
)
{
avmctrl_info
*
cinfo
=
(
avmctrl_info
*
)(
ctrl
->
driverdata
);
avmcard
*
card
=
cinfo
->
card
;
...
...
@@ -1016,7 +1016,7 @@ void c4_release_appl(struct capi_ctr *ctrl, __u16 appl)
_put_byte
(
&
p
,
SEND_RELEASE
);
_put_word
(
&
p
,
appl
);
skb_put
(
skb
,
(
__u8
*
)
p
-
(
__
u8
*
)
skb
->
data
);
skb_put
(
skb
,
(
u8
*
)
p
-
(
u8
*
)
skb
->
data
);
skb_queue_tail
(
&
card
->
dma
->
send_queue
,
skb
);
c4_dispatch_tx
(
card
);
}
...
...
@@ -1056,7 +1056,7 @@ static int c4_read_proc(char *page, char **start, off_t off,
{
avmctrl_info
*
cinfo
=
(
avmctrl_info
*
)(
ctrl
->
driverdata
);
avmcard
*
card
=
cinfo
->
card
;
__
u8
flag
;
u8
flag
;
int
len
=
0
;
char
*
s
;
...
...
@@ -1085,7 +1085,7 @@ static int c4_read_proc(char *page, char **start, off_t off,
len
+=
sprintf
(
page
+
len
,
"%-16s %s
\n
"
,
"ver_serial"
,
s
);
if
(
card
->
cardtype
!=
avm_m1
)
{
flag
=
((
__
u8
*
)(
ctrl
->
profile
.
manu
))[
3
];
flag
=
((
u8
*
)(
ctrl
->
profile
.
manu
))[
3
];
if
(
flag
)
len
+=
sprintf
(
page
+
len
,
"%-16s%s%s%s%s%s%s%s
\n
"
,
"protocol"
,
...
...
@@ -1099,7 +1099,7 @@ static int c4_read_proc(char *page, char **start, off_t off,
);
}
if
(
card
->
cardtype
!=
avm_m1
)
{
flag
=
((
__
u8
*
)(
ctrl
->
profile
.
manu
))[
5
];
flag
=
((
u8
*
)(
ctrl
->
profile
.
manu
))[
5
];
if
(
flag
)
len
+=
sprintf
(
page
+
len
,
"%-16s%s%s%s%s
\n
"
,
"linetype"
,
...
...
drivers/isdn/hardware/avm/t1isa.c
View file @
3acd2f2c
...
...
@@ -484,14 +484,14 @@ static void t1isa_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
avmcard
*
card
=
cinfo
->
card
;
unsigned
int
port
=
card
->
port
;
unsigned
long
flags
;
__
u16
len
=
CAPIMSG_LEN
(
skb
->
data
);
__
u8
cmd
=
CAPIMSG_COMMAND
(
skb
->
data
);
__
u8
subcmd
=
CAPIMSG_SUBCOMMAND
(
skb
->
data
);
u16
len
=
CAPIMSG_LEN
(
skb
->
data
);
u8
cmd
=
CAPIMSG_COMMAND
(
skb
->
data
);
u8
subcmd
=
CAPIMSG_SUBCOMMAND
(
skb
->
data
);
save_flags
(
flags
);
cli
();
if
(
CAPICMD
(
cmd
,
subcmd
)
==
CAPI_DATA_B3_REQ
)
{
__
u16
dlen
=
CAPIMSG_DATALEN
(
skb
->
data
);
u16
dlen
=
CAPIMSG_DATALEN
(
skb
->
data
);
b1_put_byte
(
port
,
SEND_DATA_B3_REQ
);
t1_put_slice
(
port
,
skb
->
data
,
len
);
t1_put_slice
(
port
,
skb
->
data
+
len
,
dlen
);
...
...
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