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
f496c9bb
Commit
f496c9bb
authored
Nov 23, 2002
by
Kai Germaschewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ISDN/HiSax: Share fill_fifo() for B-Channels
Something else which can be nicely shared amongst various drivers...
parent
c0dcd234
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
157 deletions
+72
-157
drivers/isdn/hisax/avm_pci.c
drivers/isdn/hisax/avm_pci.c
+11
-32
drivers/isdn/hisax/diva.c
drivers/isdn/hisax/diva.c
+5
-32
drivers/isdn/hisax/ipacx.c
drivers/isdn/hisax/ipacx.c
+9
-31
drivers/isdn/hisax/isdnl1.h
drivers/isdn/hisax/isdnl1.h
+35
-0
drivers/isdn/hisax/jade_irq.c
drivers/isdn/hisax/jade_irq.c
+8
-35
drivers/isdn/hisax/w6692.c
drivers/isdn/hisax/w6692.c
+4
-27
No files found.
drivers/isdn/hisax/avm_pci.c
View file @
f496c9bb
...
...
@@ -316,35 +316,24 @@ static inline void
hdlc_fill_fifo
(
struct
BCState
*
bcs
)
{
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
int
count
,
cnt
=
0
;
int
count
,
more
,
cnt
=
0
;
int
fifo_size
=
32
;
u
_
char
*
p
;
u
_
int
*
ptr
;
u
nsigned
char
*
p
;
u
nsigned
int
*
ptr
;
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
debugl1
(
cs
,
"hdlc_fill_fifo"
);
if
(
!
bcs
->
tx_skb
)
return
;
if
(
bcs
->
tx_skb
->
len
<=
0
)
p
=
xmit_fill_fifo_b
(
bcs
,
fifo_size
,
&
count
,
&
more
);
if
(
!
p
)
return
;
bcs
->
hw
.
hdlc
.
ctrl
.
sr
.
cmd
&=
~
HDLC_CMD_XME
;
if
(
bcs
->
tx_skb
->
len
>
fifo_size
)
{
count
=
fifo_size
;
}
else
{
count
=
bcs
->
tx_skb
->
len
;
if
(
bcs
->
mode
!=
L1_MODE_TRANS
)
bcs
->
hw
.
hdlc
.
ctrl
.
sr
.
cmd
|=
HDLC_CMD_XME
;
}
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
debugl1
(
cs
,
"hdlc_fill_fifo %d/%ld"
,
count
,
bcs
->
tx_skb
->
len
);
ptr
=
(
u_int
*
)
p
=
bcs
->
tx_skb
->
data
;
skb_pull
(
bcs
->
tx_skb
,
count
);
bcs
->
tx_cnt
-=
count
;
bcs
->
count
+=
count
;
if
(
more
)
bcs
->
hw
.
hdlc
.
ctrl
.
sr
.
cmd
&=
~
HDLC_CMD_XME
;
else
bcs
->
hw
.
hdlc
.
ctrl
.
sr
.
cmd
|=
HDLC_CMD_XME
;
bcs
->
hw
.
hdlc
.
ctrl
.
sr
.
xml
=
((
count
==
fifo_size
)
?
0
:
count
);
write_ctrl
(
bcs
,
3
);
/* sets the correct index too */
if
(
cs
->
subtyp
==
AVM_FRITZ_PCI
)
{
ptr
=
(
unsigned
int
*
)
p
;
while
(
cnt
<
count
)
{
#ifdef __powerpc__
#ifdef CONFIG_APUS
...
...
@@ -363,16 +352,6 @@ hdlc_fill_fifo(struct BCState *bcs)
cnt
++
;
}
}
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
char
*
t
=
bcs
->
blog
;
if
(
cs
->
subtyp
==
AVM_FRITZ_PNP
)
p
=
(
u_char
*
)
ptr
;
t
+=
sprintf
(
t
,
"hdlc_fill_fifo %c cnt %d"
,
bcs
->
channel
?
'B'
:
'A'
,
count
);
QuickHex
(
t
,
p
,
count
);
debugl1
(
cs
,
bcs
->
blog
);
}
}
static
void
...
...
drivers/isdn/hisax/diva.c
View file @
f496c9bb
...
...
@@ -456,46 +456,19 @@ static void
Memhscx_fill_fifo
(
struct
BCState
*
bcs
)
{
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
int
more
,
count
,
cnt
;
int
more
,
count
;
int
fifo_size
=
test_bit
(
HW_IPAC
,
&
cs
->
HW_Flags
)
?
64
:
32
;
u_char
*
ptr
,
*
p
;
unsigned
long
flags
;
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
debugl1
(
cs
,
"hscx_fill_fifo"
);
unsigned
char
*
p
;
if
(
!
bcs
->
tx_skb
)
return
;
if
(
bcs
->
tx_skb
->
len
<=
0
)
p
=
xmit_fill_fifo_b
(
bcs
,
fifo_size
,
&
count
,
&
more
);
if
(
!
p
)
return
;
more
=
(
bcs
->
mode
==
L1_MODE_TRANS
)
?
1
:
0
;
if
(
bcs
->
tx_skb
->
len
>
fifo_size
)
{
more
=
!
0
;
count
=
fifo_size
;
}
else
count
=
bcs
->
tx_skb
->
len
;
cnt
=
count
;
MemwaitforXFW
(
cs
,
bcs
->
hw
.
hscx
.
hscx
);
spin_lock_irqsave
(
&
diva_lock
,
flags
);
p
=
ptr
=
bcs
->
tx_skb
->
data
;
skb_pull
(
bcs
->
tx_skb
,
count
);
bcs
->
tx_cnt
-=
count
;
bcs
->
count
+=
count
;
while
(
cnt
--
)
while
(
count
--
)
memwritereg
(
cs
->
hw
.
diva
.
cfg_reg
,
bcs
->
hw
.
hscx
.
hscx
?
0x40
:
0
,
*
p
++
);
MemWriteHSCXCMDR
(
cs
,
bcs
->
hw
.
hscx
.
hscx
,
more
?
0x8
:
0xa
);
spin_unlock_irqrestore
(
&
diva_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
char
*
t
=
bcs
->
blog
;
t
+=
sprintf
(
t
,
"hscx_fill_fifo %c cnt %d"
,
bcs
->
hw
.
hscx
.
hscx
?
'B'
:
'A'
,
count
);
QuickHex
(
t
,
ptr
,
count
);
debugl1
(
cs
,
bcs
->
blog
);
}
}
static
inline
void
...
...
drivers/isdn/hisax/ipacx.c
View file @
f496c9bb
...
...
@@ -597,41 +597,19 @@ bch_empty_fifo(struct BCState *bcs, int count)
void
ipacx_fill_fifo
(
struct
BCState
*
bcs
)
{
struct
IsdnCardState
*
cs
;
int
more
,
count
,
cnt
;
u_char
*
ptr
,
*
p
,
hscx
;
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
int
more
,
count
;
unsigned
char
hscx
=
bcs
->
hw
.
hscx
.
hscx
;
unsigned
char
*
p
;
cs
=
bcs
->
cs
;
if
(
(
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
)
debugl1
(
cs
,
"ipacx_fill_fifo()"
)
;
p
=
xmit_fill_fifo_b
(
bcs
,
B_FIFO_SIZE
,
&
count
,
&
more
)
;
if
(
!
p
)
return
;
if
(
!
bcs
->
tx_skb
)
return
;
if
(
bcs
->
tx_skb
->
len
<=
0
)
return
;
while
(
count
--
)
cs
->
BC_Write_Reg
(
cs
,
hscx
,
IPACX_XFIFOB
,
*
p
++
);
hscx
=
bcs
->
hw
.
hscx
.
hscx
;
more
=
(
bcs
->
mode
==
L1_MODE_TRANS
)
?
1
:
0
;
if
(
bcs
->
tx_skb
->
len
>
B_FIFO_SIZE
)
{
more
=
1
;
count
=
B_FIFO_SIZE
;
}
else
{
count
=
bcs
->
tx_skb
->
len
;
}
cnt
=
count
;
p
=
ptr
=
bcs
->
tx_skb
->
data
;
skb_pull
(
bcs
->
tx_skb
,
count
);
bcs
->
tx_cnt
-=
count
;
bcs
->
count
+=
count
;
while
(
cnt
--
)
cs
->
BC_Write_Reg
(
cs
,
hscx
,
IPACX_XFIFOB
,
*
p
++
);
cs
->
BC_Write_Reg
(
cs
,
hscx
,
IPACX_CMDRB
,
(
more
?
0x08
:
0x0a
));
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
char
*
t
=
bcs
->
blog
;
t
+=
sprintf
(
t
,
"chb_fill_fifo() B-%d cnt %d"
,
hscx
,
count
);
QuickHex
(
t
,
ptr
,
count
);
debugl1
(
cs
,
bcs
->
blog
);
}
}
//----------------------------------------------------------
...
...
drivers/isdn/hisax/isdnl1.h
View file @
f496c9bb
...
...
@@ -176,3 +176,38 @@ xmit_xdu_b(struct BCState *bcs, void (*reset_xmit)(struct BCState *bcs))
reset_xmit
(
bcs
);
}
}
static
inline
unsigned
char
*
xmit_fill_fifo_b
(
struct
BCState
*
bcs
,
int
fifo_size
,
int
*
count
,
int
*
more
)
{
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
debugl1
(
cs
,
__FUNCTION__
);
if
(
!
bcs
->
tx_skb
||
bcs
->
tx_skb
->
len
<=
0
)
{
WARN_ON
(
1
);
return
NULL
;
}
*
more
=
(
bcs
->
mode
==
L1_MODE_TRANS
);
if
(
bcs
->
tx_skb
->
len
>
fifo_size
)
{
*
more
=
1
;
*
count
=
fifo_size
;
}
else
{
*
count
=
bcs
->
tx_skb
->
len
;
}
skb_pull
(
bcs
->
tx_skb
,
*
count
);
bcs
->
tx_cnt
-=
*
count
;
bcs
->
count
+=
*
count
;
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
char
*
t
=
bcs
->
blog
;
t
+=
sprintf
(
t
,
"%s %c cnt %d"
,
__FUNCTION__
,
bcs
->
hw
.
hscx
.
hscx
?
'B'
:
'A'
,
*
count
);
QuickHex
(
t
,
bcs
->
tx_skb
->
data
,
*
count
);
debugl1
(
cs
,
bcs
->
blog
);
}
return
bcs
->
tx_skb
->
data
;
}
drivers/isdn/hisax/jade_irq.c
View file @
f496c9bb
...
...
@@ -49,7 +49,6 @@ jade_empty_fifo(struct BCState *bcs, int count)
{
u_char
*
ptr
;
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
unsigned
long
flags
;
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
debugl1
(
cs
,
"jade_empty_fifo"
);
...
...
@@ -63,10 +62,8 @@ jade_empty_fifo(struct BCState *bcs, int count)
}
ptr
=
bcs
->
hw
.
hscx
.
rcvbuf
+
bcs
->
hw
.
hscx
.
rcvidx
;
bcs
->
hw
.
hscx
.
rcvidx
+=
count
;
spin_lock_irqsave
(
&
jade_irq_lock
,
flags
);
READJADEFIFO
(
cs
,
bcs
->
hw
.
hscx
.
hscx
,
ptr
,
count
);
WriteJADECMDR
(
cs
,
bcs
->
hw
.
hscx
.
hscx
,
jade_HDLC_RCMD
,
jadeRCMD_RMC
);
spin_unlock_irqrestore
(
&
jade_irq_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
char
*
t
=
bcs
->
blog
;
...
...
@@ -83,41 +80,17 @@ jade_fill_fifo(struct BCState *bcs)
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
int
more
,
count
;
int
fifo_size
=
32
;
u_char
*
ptr
;
unsigned
long
flags
;
int
hscx
=
bcs
->
hw
.
hscx
.
hscx
;
unsigned
char
*
p
;
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
debugl1
(
cs
,
"jade_fill_fifo"
);
if
(
!
bcs
->
tx_skb
)
p
=
xmit_fill_fifo_b
(
bcs
,
fifo_size
,
&
count
,
&
more
);
if
(
!
p
)
return
;
if
(
bcs
->
tx_skb
->
len
<=
0
)
return
;
more
=
(
bcs
->
mode
==
L1_MODE_TRANS
)
?
1
:
0
;
if
(
bcs
->
tx_skb
->
len
>
fifo_size
)
{
more
=
!
0
;
count
=
fifo_size
;
}
else
count
=
bcs
->
tx_skb
->
len
;
waitforXFW
(
cs
,
bcs
->
hw
.
hscx
.
hscx
);
spin_lock_irqsave
(
&
jade_irq_lock
,
flags
);
ptr
=
bcs
->
tx_skb
->
data
;
skb_pull
(
bcs
->
tx_skb
,
count
);
bcs
->
tx_cnt
-=
count
;
bcs
->
count
+=
count
;
WRITEJADEFIFO
(
cs
,
bcs
->
hw
.
hscx
.
hscx
,
ptr
,
count
);
WriteJADECMDR
(
cs
,
bcs
->
hw
.
hscx
.
hscx
,
jade_HDLC_XCMD
,
more
?
jadeXCMD_XF
:
(
jadeXCMD_XF
|
jadeXCMD_XME
));
spin_unlock_irqrestore
(
&
jade_irq_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
char
*
t
=
bcs
->
blog
;
t
+=
sprintf
(
t
,
"jade_fill_fifo %c cnt %d"
,
bcs
->
hw
.
hscx
.
hscx
?
'B'
:
'A'
,
count
);
QuickHex
(
t
,
ptr
,
count
);
debugl1
(
cs
,
bcs
->
blog
);
}
waitforXFW
(
cs
,
hscx
);
WRITEJADEFIFO
(
cs
,
hscx
,
p
,
count
);
WriteJADECMDR
(
cs
,
hscx
,
jade_HDLC_XCMD
,
more
?
jadeXCMD_XF
:
(
jadeXCMD_XF
|
jadeXCMD_XME
));
}
...
...
drivers/isdn/hisax/w6692.c
View file @
f496c9bb
...
...
@@ -245,37 +245,14 @@ W6692B_fill_fifo(struct BCState *bcs)
{
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
int
more
,
count
;
u_char
*
ptr
;
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
debugl1
(
cs
,
"W6692B_fill_fifo"
);
unsigned
char
*
p
;
if
(
!
bcs
->
tx_skb
)
return
;
if
(
bcs
->
tx_skb
->
len
<=
0
)
p
=
xmit_fill_fifo_b
(
bcs
,
W_B_FIFO_THRESH
,
&
count
,
&
more
);
if
(
!
p
)
return
;
more
=
(
bcs
->
mode
==
L1_MODE_TRANS
)
?
1
:
0
;
if
(
bcs
->
tx_skb
->
len
>
W_B_FIFO_THRESH
)
{
more
=
!
0
;
count
=
W_B_FIFO_THRESH
;
}
else
count
=
bcs
->
tx_skb
->
len
;
ptr
=
bcs
->
tx_skb
->
data
;
skb_pull
(
bcs
->
tx_skb
,
count
);
bcs
->
tx_cnt
-=
count
;
bcs
->
count
+=
count
;
WRITEW6692BFIFO
(
cs
,
bcs
->
channel
,
ptr
,
count
);
WRITEW6692BFIFO
(
cs
,
bcs
->
channel
,
p
,
count
);
cs
->
BC_Write_Reg
(
cs
,
bcs
->
channel
,
W_B_CMDR
,
W_B_CMDR_RACT
|
W_B_CMDR_XMS
|
(
more
?
0
:
W_B_CMDR_XME
));
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
char
*
t
=
bcs
->
blog
;
t
+=
sprintf
(
t
,
"W6692B_fill_fifo %c cnt %d"
,
bcs
->
channel
+
'1'
,
count
);
QuickHex
(
t
,
ptr
,
count
);
debugl1
(
cs
,
bcs
->
blog
);
}
}
static
void
...
...
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