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
7c99c33b
Commit
7c99c33b
authored
Oct 28, 2002
by
Kai Germaschewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ISDN: Move HiSax to spinlocks instead of cli()
Patches by Frank Davis.
parent
3f38cab9
Changes
37
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
392 additions
and
470 deletions
+392
-470
drivers/isdn/hisax/asuscom.c
drivers/isdn/hisax/asuscom.c
+7
-8
drivers/isdn/hisax/avm_a1.c
drivers/isdn/hisax/avm_a1.c
+4
-4
drivers/isdn/hisax/avm_a1p.c
drivers/isdn/hisax/avm_a1p.c
+28
-36
drivers/isdn/hisax/avm_pci.c
drivers/isdn/hisax/avm_pci.c
+28
-36
drivers/isdn/hisax/bkm_a4t.c
drivers/isdn/hisax/bkm_a4t.c
+7
-8
drivers/isdn/hisax/bkm_a8.c
drivers/isdn/hisax/bkm_a8.c
+7
-9
drivers/isdn/hisax/callc.c
drivers/isdn/hisax/callc.c
+3
-3
drivers/isdn/hisax/config.c
drivers/isdn/hisax/config.c
+20
-25
drivers/isdn/hisax/diva.c
drivers/isdn/hisax/diva.c
+16
-20
drivers/isdn/hisax/elsa.c
drivers/isdn/hisax/elsa.c
+19
-24
drivers/isdn/hisax/elsa_ser.c
drivers/isdn/hisax/elsa_ser.c
+25
-30
drivers/isdn/hisax/enternow_pci.c
drivers/isdn/hisax/enternow_pci.c
+7
-8
drivers/isdn/hisax/gazel.c
drivers/isdn/hisax/gazel.c
+10
-12
drivers/isdn/hisax/icc.c
drivers/isdn/hisax/icc.c
+10
-12
drivers/isdn/hisax/ipacx.c
drivers/isdn/hisax/ipacx.c
+20
-26
drivers/isdn/hisax/isac.c
drivers/isdn/hisax/isac.c
+10
-12
drivers/isdn/hisax/isar.c
drivers/isdn/hisax/isar.c
+20
-26
drivers/isdn/hisax/isdnl2.c
drivers/isdn/hisax/isdnl2.c
+4
-5
drivers/isdn/hisax/isurf.c
drivers/isdn/hisax/isurf.c
+1
-0
drivers/isdn/hisax/ix1_micro.c
drivers/isdn/hisax/ix1_micro.c
+10
-12
drivers/isdn/hisax/jade.c
drivers/isdn/hisax/jade.c
+9
-10
drivers/isdn/hisax/jade_irq.c
drivers/isdn/hisax/jade_irq.c
+10
-12
drivers/isdn/hisax/l3dss1.c
drivers/isdn/hisax/l3dss1.c
+5
-6
drivers/isdn/hisax/l3ni1.c
drivers/isdn/hisax/l3ni1.c
+5
-6
drivers/isdn/hisax/mic.c
drivers/isdn/hisax/mic.c
+7
-8
drivers/isdn/hisax/netjet.c
drivers/isdn/hisax/netjet.c
+13
-16
drivers/isdn/hisax/niccy.c
drivers/isdn/hisax/niccy.c
+7
-8
drivers/isdn/hisax/nj_s.c
drivers/isdn/hisax/nj_s.c
+7
-7
drivers/isdn/hisax/nj_u.c
drivers/isdn/hisax/nj_u.c
+6
-7
drivers/isdn/hisax/s0box.c
drivers/isdn/hisax/s0box.c
+5
-6
drivers/isdn/hisax/saphir.c
drivers/isdn/hisax/saphir.c
+10
-12
drivers/isdn/hisax/sedlbauer.c
drivers/isdn/hisax/sedlbauer.c
+8
-9
drivers/isdn/hisax/sportster.c
drivers/isdn/hisax/sportster.c
+1
-0
drivers/isdn/hisax/teleint.c
drivers/isdn/hisax/teleint.c
+9
-10
drivers/isdn/hisax/teles0.c
drivers/isdn/hisax/teles0.c
+5
-4
drivers/isdn/hisax/teles3.c
drivers/isdn/hisax/teles3.c
+8
-8
drivers/isdn/hisax/w6692.c
drivers/isdn/hisax/w6692.c
+21
-25
No files found.
drivers/isdn/hisax/asuscom.c
View file @
7c99c33b
...
@@ -24,6 +24,7 @@ extern const char *CardType[];
...
@@ -24,6 +24,7 @@ extern const char *CardType[];
const
char
*
Asuscom_revision
=
"$Revision: 1.11.6.3 $"
;
const
char
*
Asuscom_revision
=
"$Revision: 1.11.6.3 $"
;
static
spinlock_t
asuscom_lock
=
SPIN_LOCK_UNLOCKED
;
#define byteout(addr,val) outb(val,addr)
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
#define bytein(addr) inb(addr)
...
@@ -46,13 +47,12 @@ static inline u_char
...
@@ -46,13 +47,12 @@ static inline u_char
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
{
{
register
u_char
ret
;
register
u_char
ret
;
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
asuscom_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
ret
=
bytein
(
adr
);
ret
=
bytein
(
adr
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
asuscom_lock
,
flags
);
return
(
ret
);
return
(
ret
);
}
}
...
@@ -69,13 +69,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
...
@@ -69,13 +69,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
static
inline
void
static
inline
void
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
asuscom_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
byteout
(
adr
,
data
);
byteout
(
adr
,
data
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
asuscom_lock
,
flags
);
}
}
static
inline
void
static
inline
void
...
...
drivers/isdn/hisax/avm_a1.c
View file @
7c99c33b
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
static
const
char
*
avm_revision
=
"$Revision: 2.13.6.2 $"
;
static
const
char
*
avm_revision
=
"$Revision: 2.13.6.2 $"
;
static
spinlock_t
avm_a1_lock
=
SPIN_LOCK_UNLOCKED
;
#define AVM_A1_STAT_ISAC 0x01
#define AVM_A1_STAT_ISAC 0x01
#define AVM_A1_STAT_HSCX 0x02
#define AVM_A1_STAT_HSCX 0x02
...
@@ -179,7 +180,7 @@ setup_avm_a1(struct IsdnCard *card)
...
@@ -179,7 +180,7 @@ setup_avm_a1(struct IsdnCard *card)
{
{
u_char
val
;
u_char
val
;
struct
IsdnCardState
*
cs
=
card
->
cs
;
struct
IsdnCardState
*
cs
=
card
->
cs
;
long
flags
;
unsigned
long
flags
;
char
tmp
[
64
];
char
tmp
[
64
];
strcpy
(
tmp
,
avm_revision
);
strcpy
(
tmp
,
avm_revision
);
...
@@ -254,9 +255,8 @@ setup_avm_a1(struct IsdnCard *card)
...
@@ -254,9 +255,8 @@ setup_avm_a1(struct IsdnCard *card)
release_ioregs
(
cs
,
0x1f
);
release_ioregs
(
cs
,
0x1f
);
return
(
0
);
return
(
0
);
}
}
s
ave_flags
(
flags
);
s
pin_lock_irqsave
(
&
avm_a1_lock
,
flags
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
,
0x0
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
,
0x0
);
sti
();
HZDELAY
(
HZ
/
5
+
1
);
HZDELAY
(
HZ
/
5
+
1
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
,
0x1
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
,
0x1
);
HZDELAY
(
HZ
/
5
+
1
);
HZDELAY
(
HZ
/
5
+
1
);
...
@@ -269,7 +269,7 @@ setup_avm_a1(struct IsdnCard *card)
...
@@ -269,7 +269,7 @@ setup_avm_a1(struct IsdnCard *card)
HZDELAY
(
HZ
/
5
+
1
);
HZDELAY
(
HZ
/
5
+
1
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
,
0x0
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
,
0x0
);
HZDELAY
(
HZ
/
5
+
1
);
HZDELAY
(
HZ
/
5
+
1
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_a1_lock
,
flags
);
val
=
bytein
(
cs
->
hw
.
avm
.
cfg_reg
);
val
=
bytein
(
cs
->
hw
.
avm
.
cfg_reg
);
printk
(
KERN_INFO
"AVM A1: Byte at %x is %x
\n
"
,
printk
(
KERN_INFO
"AVM A1: Byte at %x is %x
\n
"
,
...
...
drivers/isdn/hisax/avm_a1p.c
View file @
7c99c33b
...
@@ -57,116 +57,109 @@
...
@@ -57,116 +57,109 @@
#define bytein(addr) inb(addr)
#define bytein(addr) inb(addr)
static
const
char
*
avm_revision
=
"$Revision: 2.7.6.2 $"
;
static
const
char
*
avm_revision
=
"$Revision: 2.7.6.2 $"
;
static
spinlock_t
avm_a1p_lock
=
SPIN_LOCK_UNLOCKED
;
static
inline
u_char
static
inline
u_char
ReadISAC
(
struct
IsdnCardState
*
cs
,
u_char
offset
)
ReadISAC
(
struct
IsdnCardState
*
cs
,
u_char
offset
)
{
{
long
flags
;
unsigned
long
flags
;
u_char
ret
;
u_char
ret
;
offset
-=
0x20
;
offset
-=
0x20
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_a1p_lock
,
flags
);
cli
();
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
ISAC_REG_OFFSET
+
offset
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
ISAC_REG_OFFSET
+
offset
);
ret
=
bytein
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
);
ret
=
bytein
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_a1p_lock
,
flags
);
return
ret
;
return
ret
;
}
}
static
inline
void
static
inline
void
WriteISAC
(
struct
IsdnCardState
*
cs
,
u_char
offset
,
u_char
value
)
WriteISAC
(
struct
IsdnCardState
*
cs
,
u_char
offset
,
u_char
value
)
{
{
long
flags
;
unsigned
long
flags
;
offset
-=
0x20
;
offset
-=
0x20
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_a1p_lock
,
flags
);
cli
();
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
ISAC_REG_OFFSET
+
offset
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
ISAC_REG_OFFSET
+
offset
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
,
value
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
,
value
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_a1p_lock
,
flags
);
}
}
static
inline
void
static
inline
void
ReadISACfifo
(
struct
IsdnCardState
*
cs
,
u_char
*
data
,
int
size
)
ReadISACfifo
(
struct
IsdnCardState
*
cs
,
u_char
*
data
,
int
size
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_a1p_lock
,
flags
);
cli
();
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
ISAC_FIFO_OFFSET
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
ISAC_FIFO_OFFSET
);
insb
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
,
data
,
size
);
insb
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
,
data
,
size
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_a1p_lock
,
flags
);
}
}
static
inline
void
static
inline
void
WriteISACfifo
(
struct
IsdnCardState
*
cs
,
u_char
*
data
,
int
size
)
WriteISACfifo
(
struct
IsdnCardState
*
cs
,
u_char
*
data
,
int
size
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_a1p_lock
,
flags
);
cli
();
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
ISAC_FIFO_OFFSET
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
ISAC_FIFO_OFFSET
);
outsb
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
,
data
,
size
);
outsb
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
,
data
,
size
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_a1p_lock
,
flags
);
}
}
static
inline
u_char
static
inline
u_char
ReadHSCX
(
struct
IsdnCardState
*
cs
,
int
hscx
,
u_char
offset
)
ReadHSCX
(
struct
IsdnCardState
*
cs
,
int
hscx
,
u_char
offset
)
{
{
u_char
ret
;
u_char
ret
;
long
flags
;
unsigned
long
flags
;
offset
-=
0x20
;
offset
-=
0x20
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_a1p_lock
,
flags
);
cli
();
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
HSCX_REG_OFFSET
+
hscx
*
HSCX_CH_DIFF
+
offset
);
HSCX_REG_OFFSET
+
hscx
*
HSCX_CH_DIFF
+
offset
);
ret
=
bytein
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
);
ret
=
bytein
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_a1p_lock
,
flags
);
return
ret
;
return
ret
;
}
}
static
inline
void
static
inline
void
WriteHSCX
(
struct
IsdnCardState
*
cs
,
int
hscx
,
u_char
offset
,
u_char
value
)
WriteHSCX
(
struct
IsdnCardState
*
cs
,
int
hscx
,
u_char
offset
,
u_char
value
)
{
{
long
flags
;
unsigned
long
flags
;
offset
-=
0x20
;
offset
-=
0x20
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_a1p_lock
,
flags
);
cli
();
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
HSCX_REG_OFFSET
+
hscx
*
HSCX_CH_DIFF
+
offset
);
HSCX_REG_OFFSET
+
hscx
*
HSCX_CH_DIFF
+
offset
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
,
value
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
,
value
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_a1p_lock
,
flags
);
}
}
static
inline
void
static
inline
void
ReadHSCXfifo
(
struct
IsdnCardState
*
cs
,
int
hscx
,
u_char
*
data
,
int
size
)
ReadHSCXfifo
(
struct
IsdnCardState
*
cs
,
int
hscx
,
u_char
*
data
,
int
size
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_a1p_lock
,
flags
);
cli
();
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
HSCX_FIFO_OFFSET
+
hscx
*
HSCX_CH_DIFF
);
HSCX_FIFO_OFFSET
+
hscx
*
HSCX_CH_DIFF
);
insb
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
,
data
,
size
);
insb
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
,
data
,
size
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_a1p_lock
,
flags
);
}
}
static
inline
void
static
inline
void
WriteHSCXfifo
(
struct
IsdnCardState
*
cs
,
int
hscx
,
u_char
*
data
,
int
size
)
WriteHSCXfifo
(
struct
IsdnCardState
*
cs
,
int
hscx
,
u_char
*
data
,
int
size
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_a1p_lock
,
flags
);
cli
();
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ADDRREG_OFFSET
,
HSCX_FIFO_OFFSET
+
hscx
*
HSCX_CH_DIFF
);
HSCX_FIFO_OFFSET
+
hscx
*
HSCX_CH_DIFF
);
outsb
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
,
data
,
size
);
outsb
(
cs
->
hw
.
avm
.
cfg_reg
+
DATAREG_OFFSET
,
data
,
size
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_a1p_lock
,
flags
);
}
}
/*
/*
...
@@ -253,7 +246,7 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
...
@@ -253,7 +246,7 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
{
{
u_char
model
,
vers
;
u_char
model
,
vers
;
struct
IsdnCardState
*
cs
=
card
->
cs
;
struct
IsdnCardState
*
cs
=
card
->
cs
;
long
flags
;
unsigned
long
flags
;
char
tmp
[
64
];
char
tmp
[
64
];
...
@@ -267,9 +260,8 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
...
@@ -267,9 +260,8 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
cs
->
irq
=
card
->
para
[
0
];
cs
->
irq
=
card
->
para
[
0
];
s
ave_flags
(
flags
);
s
pin_lock_irqsave
(
&
avm_a1p_lock
,
flags
);
outb
(
cs
->
hw
.
avm
.
cfg_reg
+
ASL1_OFFSET
,
ASL1_W_ENABLE_S0
);
outb
(
cs
->
hw
.
avm
.
cfg_reg
+
ASL1_OFFSET
,
ASL1_W_ENABLE_S0
);
sti
();
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ASL0_OFFSET
,
0x00
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ASL0_OFFSET
,
0x00
);
HZDELAY
(
HZ
/
5
+
1
);
HZDELAY
(
HZ
/
5
+
1
);
...
@@ -279,7 +271,7 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
...
@@ -279,7 +271,7 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ASL0_OFFSET
,
ASL0_W_TDISABLE
|
ASL0_W_TRESET
);
byteout
(
cs
->
hw
.
avm
.
cfg_reg
+
ASL0_OFFSET
,
ASL0_W_TDISABLE
|
ASL0_W_TRESET
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_a1p_lock
,
flags
);
model
=
bytein
(
cs
->
hw
.
avm
.
cfg_reg
+
MODREG_OFFSET
);
model
=
bytein
(
cs
->
hw
.
avm
.
cfg_reg
+
MODREG_OFFSET
);
vers
=
bytein
(
cs
->
hw
.
avm
.
cfg_reg
+
VERREG_OFFSET
);
vers
=
bytein
(
cs
->
hw
.
avm
.
cfg_reg
+
VERREG_OFFSET
);
...
...
drivers/isdn/hisax/avm_pci.c
View file @
7c99c33b
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
static
const
char
*
avm_pci_rev
=
"$Revision: 1.22.6.6 $"
;
static
const
char
*
avm_pci_rev
=
"$Revision: 1.22.6.6 $"
;
static
spinlock_t
avm_pci_lock
=
SPIN_LOCK_UNLOCKED
;
#define AVM_FRITZ_PCI 1
#define AVM_FRITZ_PCI 1
#define AVM_FRITZ_PNP 2
#define AVM_FRITZ_PNP 2
...
@@ -80,13 +81,12 @@ ReadISAC(struct IsdnCardState *cs, u_char offset)
...
@@ -80,13 +81,12 @@ ReadISAC(struct IsdnCardState *cs, u_char offset)
{
{
register
u_char
idx
=
(
offset
>
0x2f
)
?
AVM_ISAC_REG_HIGH
:
AVM_ISAC_REG_LOW
;
register
u_char
idx
=
(
offset
>
0x2f
)
?
AVM_ISAC_REG_HIGH
:
AVM_ISAC_REG_LOW
;
register
u_char
val
;
register
u_char
val
;
register
long
flags
;
register
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_pci_lock
,
flags
);
cli
();
outb
(
idx
,
cs
->
hw
.
avm
.
cfg_reg
+
4
);
outb
(
idx
,
cs
->
hw
.
avm
.
cfg_reg
+
4
);
val
=
inb
(
cs
->
hw
.
avm
.
isac
+
(
offset
&
0xf
));
val
=
inb
(
cs
->
hw
.
avm
.
isac
+
(
offset
&
0xf
));
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_pci_lock
,
flags
);
return
(
val
);
return
(
val
);
}
}
...
@@ -94,13 +94,12 @@ static void
...
@@ -94,13 +94,12 @@ static void
WriteISAC
(
struct
IsdnCardState
*
cs
,
u_char
offset
,
u_char
value
)
WriteISAC
(
struct
IsdnCardState
*
cs
,
u_char
offset
,
u_char
value
)
{
{
register
u_char
idx
=
(
offset
>
0x2f
)
?
AVM_ISAC_REG_HIGH
:
AVM_ISAC_REG_LOW
;
register
u_char
idx
=
(
offset
>
0x2f
)
?
AVM_ISAC_REG_HIGH
:
AVM_ISAC_REG_LOW
;
register
long
flags
;
register
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_pci_lock
,
flags
);
cli
();
outb
(
idx
,
cs
->
hw
.
avm
.
cfg_reg
+
4
);
outb
(
idx
,
cs
->
hw
.
avm
.
cfg_reg
+
4
);
outb
(
value
,
cs
->
hw
.
avm
.
isac
+
(
offset
&
0xf
));
outb
(
value
,
cs
->
hw
.
avm
.
isac
+
(
offset
&
0xf
));
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_pci_lock
,
flags
);
}
}
static
void
static
void
...
@@ -122,13 +121,12 @@ ReadHDLCPCI(struct IsdnCardState *cs, int chan, u_char offset)
...
@@ -122,13 +121,12 @@ ReadHDLCPCI(struct IsdnCardState *cs, int chan, u_char offset)
{
{
register
u_int
idx
=
chan
?
AVM_HDLC_2
:
AVM_HDLC_1
;
register
u_int
idx
=
chan
?
AVM_HDLC_2
:
AVM_HDLC_1
;
register
u_int
val
;
register
u_int
val
;
register
long
flags
;
register
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_pci_lock
,
flags
);
cli
();
outl
(
idx
,
cs
->
hw
.
avm
.
cfg_reg
+
4
);
outl
(
idx
,
cs
->
hw
.
avm
.
cfg_reg
+
4
);
val
=
inl
(
cs
->
hw
.
avm
.
isac
+
offset
);
val
=
inl
(
cs
->
hw
.
avm
.
isac
+
offset
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_pci_lock
,
flags
);
return
(
val
);
return
(
val
);
}
}
...
@@ -136,13 +134,12 @@ static inline void
...
@@ -136,13 +134,12 @@ static inline void
WriteHDLCPCI
(
struct
IsdnCardState
*
cs
,
int
chan
,
u_char
offset
,
u_int
value
)
WriteHDLCPCI
(
struct
IsdnCardState
*
cs
,
int
chan
,
u_char
offset
,
u_int
value
)
{
{
register
u_int
idx
=
chan
?
AVM_HDLC_2
:
AVM_HDLC_1
;
register
u_int
idx
=
chan
?
AVM_HDLC_2
:
AVM_HDLC_1
;
register
long
flags
;
register
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_pci_lock
,
flags
);
cli
();
outl
(
idx
,
cs
->
hw
.
avm
.
cfg_reg
+
4
);
outl
(
idx
,
cs
->
hw
.
avm
.
cfg_reg
+
4
);
outl
(
value
,
cs
->
hw
.
avm
.
isac
+
offset
);
outl
(
value
,
cs
->
hw
.
avm
.
isac
+
offset
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_pci_lock
,
flags
);
}
}
static
inline
u_char
static
inline
u_char
...
@@ -150,13 +147,12 @@ ReadHDLCPnP(struct IsdnCardState *cs, int chan, u_char offset)
...
@@ -150,13 +147,12 @@ ReadHDLCPnP(struct IsdnCardState *cs, int chan, u_char offset)
{
{
register
u_char
idx
=
chan
?
AVM_HDLC_2
:
AVM_HDLC_1
;
register
u_char
idx
=
chan
?
AVM_HDLC_2
:
AVM_HDLC_1
;
register
u_char
val
;
register
u_char
val
;
register
long
flags
;
register
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_pci_lock
,
flags
);
cli
();
outb
(
idx
,
cs
->
hw
.
avm
.
cfg_reg
+
4
);
outb
(
idx
,
cs
->
hw
.
avm
.
cfg_reg
+
4
);
val
=
inb
(
cs
->
hw
.
avm
.
isac
+
offset
);
val
=
inb
(
cs
->
hw
.
avm
.
isac
+
offset
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_pci_lock
,
flags
);
return
(
val
);
return
(
val
);
}
}
...
@@ -164,13 +160,12 @@ static inline void
...
@@ -164,13 +160,12 @@ static inline void
WriteHDLCPnP
(
struct
IsdnCardState
*
cs
,
int
chan
,
u_char
offset
,
u_char
value
)
WriteHDLCPnP
(
struct
IsdnCardState
*
cs
,
int
chan
,
u_char
offset
,
u_char
value
)
{
{
register
u_char
idx
=
chan
?
AVM_HDLC_2
:
AVM_HDLC_1
;
register
u_char
idx
=
chan
?
AVM_HDLC_2
:
AVM_HDLC_1
;
register
long
flags
;
register
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_pci_lock
,
flags
);
cli
();
outb
(
idx
,
cs
->
hw
.
avm
.
cfg_reg
+
4
);
outb
(
idx
,
cs
->
hw
.
avm
.
cfg_reg
+
4
);
outb
(
value
,
cs
->
hw
.
avm
.
isac
+
offset
);
outb
(
value
,
cs
->
hw
.
avm
.
isac
+
offset
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_pci_lock
,
flags
);
}
}
static
u_char
static
u_char
...
@@ -390,11 +385,10 @@ hdlc_fill_fifo(struct BCState *bcs)
...
@@ -390,11 +385,10 @@ hdlc_fill_fifo(struct BCState *bcs)
static
void
static
void
fill_hdlc
(
struct
BCState
*
bcs
)
fill_hdlc
(
struct
BCState
*
bcs
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_pci_lock
,
flags
);
cli
();
hdlc_fill_fifo
(
bcs
);
hdlc_fill_fifo
(
bcs
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_pci_lock
,
flags
);
}
}
static
inline
void
static
inline
void
...
@@ -493,8 +487,7 @@ HDLC_irq_main(struct IsdnCardState *cs)
...
@@ -493,8 +487,7 @@ HDLC_irq_main(struct IsdnCardState *cs)
long
flags
;
long
flags
;
struct
BCState
*
bcs
;
struct
BCState
*
bcs
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_pci_lock
,
flags
);
cli
();
if
(
cs
->
subtyp
==
AVM_FRITZ_PCI
)
{
if
(
cs
->
subtyp
==
AVM_FRITZ_PCI
)
{
stat
=
ReadHDLCPCI
(
cs
,
0
,
HDLC_STATUS
);
stat
=
ReadHDLCPCI
(
cs
,
0
,
HDLC_STATUS
);
}
else
{
}
else
{
...
@@ -523,27 +516,26 @@ HDLC_irq_main(struct IsdnCardState *cs)
...
@@ -523,27 +516,26 @@ HDLC_irq_main(struct IsdnCardState *cs)
}
else
}
else
HDLC_irq
(
bcs
,
stat
);
HDLC_irq
(
bcs
,
stat
);
}
}
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_pci_lock
,
flags
);
}
}
void
void
hdlc_l2l1
(
struct
PStack
*
st
,
int
pr
,
void
*
arg
)
hdlc_l2l1
(
struct
PStack
*
st
,
int
pr
,
void
*
arg
)
{
{
struct
sk_buff
*
skb
=
arg
;
struct
sk_buff
*
skb
=
arg
;
long
flags
;
unsigned
long
flags
;
switch
(
pr
)
{
switch
(
pr
)
{
case
(
PH_DATA
|
REQUEST
):
case
(
PH_DATA
|
REQUEST
):
save_flags
(
flags
);
spin_lock_irqsave
(
&
avm_pci_lock
,
flags
);
cli
();
if
(
st
->
l1
.
bcs
->
tx_skb
)
{
if
(
st
->
l1
.
bcs
->
tx_skb
)
{
skb_queue_tail
(
&
st
->
l1
.
bcs
->
squeue
,
skb
);
skb_queue_tail
(
&
st
->
l1
.
bcs
->
squeue
,
skb
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_pci_lock
,
flags
);
}
else
{
}
else
{
st
->
l1
.
bcs
->
tx_skb
=
skb
;
st
->
l1
.
bcs
->
tx_skb
=
skb
;
test_and_set_bit
(
BC_FLG_BUSY
,
&
st
->
l1
.
bcs
->
Flag
);
test_and_set_bit
(
BC_FLG_BUSY
,
&
st
->
l1
.
bcs
->
Flag
);
st
->
l1
.
bcs
->
hw
.
hdlc
.
count
=
0
;
st
->
l1
.
bcs
->
hw
.
hdlc
.
count
=
0
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
avm_pci_lock
,
flags
);
st
->
l1
.
bcs
->
cs
->
BC_Send_Data
(
st
->
l1
.
bcs
);
st
->
l1
.
bcs
->
cs
->
BC_Send_Data
(
st
->
l1
.
bcs
);
}
}
break
;
break
;
...
...
drivers/isdn/hisax/bkm_a4t.c
View file @
7c99c33b
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "bkm_ax.h"
#include "bkm_ax.h"
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
static
spinlock_t
bkm_a4t_lock
=
SPIN_LOCK_UNLOCKED
;
const
char
*
bkm_a4t_revision
=
"$Revision: 1.13.6.6 $"
;
const
char
*
bkm_a4t_revision
=
"$Revision: 1.13.6.6 $"
;
...
@@ -29,16 +30,15 @@ static inline u_char
...
@@ -29,16 +30,15 @@ static inline u_char
readreg
(
unsigned
int
ale
,
unsigned
long
adr
,
u_char
off
)
readreg
(
unsigned
int
ale
,
unsigned
long
adr
,
u_char
off
)
{
{
register
u_int
ret
;
register
u_int
ret
;
long
flags
;
unsigned
long
flags
;
unsigned
int
*
po
=
(
unsigned
int
*
)
adr
;
/* Postoffice */
unsigned
int
*
po
=
(
unsigned
int
*
)
adr
;
/* Postoffice */
save_flags
(
flags
);
spin_lock_irqsave
(
&
bkm_a4t_lock
,
flags
);
cli
();
*
po
=
(
GCS_2
|
PO_WRITE
|
off
);
*
po
=
(
GCS_2
|
PO_WRITE
|
off
);
__WAITI20__
(
po
);
__WAITI20__
(
po
);
*
po
=
(
ale
|
PO_READ
);
*
po
=
(
ale
|
PO_READ
);
__WAITI20__
(
po
);
__WAITI20__
(
po
);
ret
=
*
po
;
ret
=
*
po
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
bkm_a4t_lock
,
flags
);
return
((
unsigned
char
)
ret
);
return
((
unsigned
char
)
ret
);
}
}
...
@@ -56,15 +56,14 @@ readfifo(unsigned int ale, unsigned long adr, u_char off, u_char * data, int siz
...
@@ -56,15 +56,14 @@ readfifo(unsigned int ale, unsigned long adr, u_char off, u_char * data, int siz
static
inline
void
static
inline
void
writereg
(
unsigned
int
ale
,
unsigned
long
adr
,
u_char
off
,
u_char
data
)
writereg
(
unsigned
int
ale
,
unsigned
long
adr
,
u_char
off
,
u_char
data
)
{
{
long
flags
;
unsigned
long
flags
;
unsigned
int
*
po
=
(
unsigned
int
*
)
adr
;
/* Postoffice */
unsigned
int
*
po
=
(
unsigned
int
*
)
adr
;
/* Postoffice */
save_flags
(
flags
);
spin_lock_irqsave
(
&
bkm_a4t_lock
,
flags
);
cli
();
*
po
=
(
GCS_2
|
PO_WRITE
|
off
);
*
po
=
(
GCS_2
|
PO_WRITE
|
off
);
__WAITI20__
(
po
);
__WAITI20__
(
po
);
*
po
=
(
ale
|
PO_WRITE
|
data
);
*
po
=
(
ale
|
PO_WRITE
|
data
);
__WAITI20__
(
po
);
__WAITI20__
(
po
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
bkm_a4t_lock
,
flags
);
}
}
...
...
drivers/isdn/hisax/bkm_a8.c
View file @
7c99c33b
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#define ATTEMPT_PCI_REMAPPING
/* Required for PLX rev 1 */
#define ATTEMPT_PCI_REMAPPING
/* Required for PLX rev 1 */
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
static
spinlock_t
bkm_a8_lock
=
SPIN_LOCK_UNLOCKED
;
const
char
sct_quadro_revision
[]
=
"$Revision: 1.14.6.7 $"
;
const
char
sct_quadro_revision
[]
=
"$Revision: 1.14.6.7 $"
;
static
const
char
*
sct_quadro_subtypes
[]
=
static
const
char
*
sct_quadro_subtypes
[]
=
...
@@ -45,12 +45,11 @@ static inline u_char
...
@@ -45,12 +45,11 @@ static inline u_char
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
{
{
register
u_char
ret
;
register
u_char
ret
;
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
bkm_a8_lock
,
flags
);
cli
();
wordout
(
ale
,
off
);
wordout
(
ale
,
off
);
ret
=
wordin
(
adr
)
&
0xFF
;
ret
=
wordin
(
adr
)
&
0xFF
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
bkm_a8_lock
,
flags
);
return
(
ret
);
return
(
ret
);
}
}
...
@@ -68,12 +67,11 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
...
@@ -68,12 +67,11 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
static
inline
void
static
inline
void
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
bkm_a8_lock
,
flags
);
cli
();
wordout
(
ale
,
off
);
wordout
(
ale
,
off
);
wordout
(
adr
,
data
);
wordout
(
adr
,
data
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
bkm_a8_lock
,
flags
);
}
}
static
inline
void
static
inline
void
...
...
drivers/isdn/hisax/callc.c
View file @
7c99c33b
...
@@ -37,6 +37,7 @@ static void release_b_st(struct Channel *chanp);
...
@@ -37,6 +37,7 @@ static void release_b_st(struct Channel *chanp);
static
struct
Fsm
callcfsm
;
static
struct
Fsm
callcfsm
;
static
int
chancount
;
static
int
chancount
;
static
spinlock_t
callc_lock
=
SPIN_LOCK_UNLOCKED
;
/* experimental REJECT after ALERTING for CALLBACK to beat the 4s delay */
/* experimental REJECT after ALERTING for CALLBACK to beat the 4s delay */
#define ALERT_REJECT 0
#define ALERT_REJECT 0
...
@@ -1803,8 +1804,7 @@ HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb)
...
@@ -1803,8 +1804,7 @@ HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb)
return
0
;
return
0
;
}
else
if
(
chanp
->
debug
&
0x800
)
}
else
if
(
chanp
->
debug
&
0x800
)
link_debug
(
chanp
,
1
,
"writebuf %d/%d/%d"
,
len
,
chanp
->
bcs
->
tx_cnt
,
MAX_DATA_MEM
);
link_debug
(
chanp
,
1
,
"writebuf %d/%d/%d"
,
len
,
chanp
->
bcs
->
tx_cnt
,
MAX_DATA_MEM
);
save_flags
(
flags
);
spin_lock_irqsave
(
&
callc_lock
,
flags
);
cli
();
nskb
=
skb_clone
(
skb
,
GFP_ATOMIC
);
nskb
=
skb_clone
(
skb
,
GFP_ATOMIC
);
if
(
nskb
)
{
if
(
nskb
)
{
nskb
->
truesize
=
nskb
->
len
;
nskb
->
truesize
=
nskb
->
len
;
...
@@ -1819,7 +1819,7 @@ HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb)
...
@@ -1819,7 +1819,7 @@ HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb)
dev_kfree_skb
(
skb
);
dev_kfree_skb
(
skb
);
}
else
}
else
len
=
0
;
len
=
0
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
callc_lock
,
flags
);
}
}
return
(
len
);
return
(
len
);
}
}
drivers/isdn/hisax/config.c
View file @
7c99c33b
...
@@ -99,6 +99,7 @@ const char *CardType[] = {
...
@@ -99,6 +99,7 @@ const char *CardType[] = {
};
};
void
HiSax_closecard
(
int
cardnr
);
void
HiSax_closecard
(
int
cardnr
);
static
spinlock_t
hisax_config_lock
=
SPIN_LOCK_UNLOCKED
;
#ifdef CONFIG_HISAX_ELSA
#ifdef CONFIG_HISAX_ELSA
#define DEFAULT_CARD ISDN_CTYPE_ELSA
#define DEFAULT_CARD ISDN_CTYPE_ELSA
...
@@ -708,14 +709,13 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt,
...
@@ -708,14 +709,13 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt,
{
{
/* if head == NULL the fmt contains the full info */
/* if head == NULL the fmt contains the full info */
long
flags
;
unsigned
long
flags
;
int
count
,
i
;
int
count
,
i
;
u_char
*
p
;
u_char
*
p
;
isdn_ctrl
ic
;
isdn_ctrl
ic
;
int
len
;
int
len
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
hisax_config_lock
,
flags
);
cli
();
p
=
tmpbuf
;
p
=
tmpbuf
;
if
(
head
)
{
if
(
head
)
{
p
+=
jiftime
(
p
,
jiffies
);
p
+=
jiftime
(
p
,
jiffies
);
...
@@ -732,13 +732,13 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt,
...
@@ -732,13 +732,13 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt,
if
(
!
cs
)
{
if
(
!
cs
)
{
printk
(
KERN_WARNING
"HiSax: No CardStatus for message %s"
,
printk
(
KERN_WARNING
"HiSax: No CardStatus for message %s"
,
p
);
p
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
hisax_config_lock
,
flags
);
return
;
return
;
}
}
if
(
len
>
HISAX_STATUS_BUFSIZE
)
{
if
(
len
>
HISAX_STATUS_BUFSIZE
)
{
printk
(
KERN_WARNING
"HiSax: status overflow %d/%d
\n
"
,
printk
(
KERN_WARNING
"HiSax: status overflow %d/%d
\n
"
,
len
,
HISAX_STATUS_BUFSIZE
);
len
,
HISAX_STATUS_BUFSIZE
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
hisax_config_lock
,
flags
);
return
;
return
;
}
}
count
=
len
;
count
=
len
;
...
@@ -767,7 +767,7 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt,
...
@@ -767,7 +767,7 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt,
count
++
;
count
++
;
}
}
#endif
#endif
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
hisax_config_lock
,
flags
);
if
(
count
)
{
if
(
count
)
{
ic
.
command
=
ISDN_STAT_STAVAIL
;
ic
.
command
=
ISDN_STAT_STAVAIL
;
ic
.
driver
=
cs
->
myid
;
ic
.
driver
=
cs
->
myid
;
...
@@ -787,16 +787,15 @@ void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...)
...
@@ -787,16 +787,15 @@ void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...)
int
ll_run
(
struct
IsdnCardState
*
cs
,
int
addfeatures
)
int
ll_run
(
struct
IsdnCardState
*
cs
,
int
addfeatures
)
{
{
long
flags
;
unsigned
long
flags
;
isdn_ctrl
ic
;
isdn_ctrl
ic
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
hisax_config_lock
,
flags
);
cli
();
ic
.
driver
=
cs
->
myid
;
ic
.
driver
=
cs
->
myid
;
ic
.
command
=
ISDN_STAT_RUN
;
ic
.
command
=
ISDN_STAT_RUN
;
cs
->
iif
.
features
|=
addfeatures
;
cs
->
iif
.
features
|=
addfeatures
;
cs
->
iif
.
statcallb
(
&
ic
);
cs
->
iif
.
statcallb
(
&
ic
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
hisax_config_lock
,
flags
);
return
0
;
return
0
;
}
}
...
@@ -857,28 +856,26 @@ static void closecard(int cardnr)
...
@@ -857,28 +856,26 @@ static void closecard(int cardnr)
static
int
__devinit
init_card
(
struct
IsdnCardState
*
cs
)
static
int
__devinit
init_card
(
struct
IsdnCardState
*
cs
)
{
{
int
irq_cnt
,
cnt
=
3
;
int
irq_cnt
,
cnt
=
3
;
long
flags
;
unsigned
long
flags
;
if
(
!
cs
->
irq
)
if
(
!
cs
->
irq
)
return
cs
->
cardmsg
(
cs
,
CARD_INIT
,
NULL
);
return
cs
->
cardmsg
(
cs
,
CARD_INIT
,
NULL
);
save_flags
(
flags
);
spin_lock_irqsave
(
&
hisax_config_lock
,
flags
);
cli
();
irq_cnt
=
kstat_irqs
(
cs
->
irq
);
irq_cnt
=
kstat_irqs
(
cs
->
irq
);
printk
(
KERN_INFO
"%s: IRQ %d count %d
\n
"
,
CardType
[
cs
->
typ
],
printk
(
KERN_INFO
"%s: IRQ %d count %d
\n
"
,
CardType
[
cs
->
typ
],
cs
->
irq
,
irq_cnt
);
cs
->
irq
,
irq_cnt
);
if
(
request_irq
(
cs
->
irq
,
cs
->
irq_func
,
cs
->
irq_flags
,
"HiSax"
,
cs
))
{
if
(
request_irq
(
cs
->
irq
,
cs
->
irq_func
,
cs
->
irq_flags
,
"HiSax"
,
cs
))
{
printk
(
KERN_WARNING
"HiSax: couldn't get interrupt %d
\n
"
,
printk
(
KERN_WARNING
"HiSax: couldn't get interrupt %d
\n
"
,
cs
->
irq
);
cs
->
irq
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
hisax_config_lock
,
flags
);
return
1
;
return
1
;
}
}
while
(
cnt
)
{
while
(
cnt
)
{
cs
->
cardmsg
(
cs
,
CARD_INIT
,
NULL
);
cs
->
cardmsg
(
cs
,
CARD_INIT
,
NULL
);
sti
();
set_current_state
(
TASK_UNINTERRUPTIBLE
);
set_current_state
(
TASK_UNINTERRUPTIBLE
);
/* Timeout 10ms */
/* Timeout 10ms */
schedule_timeout
((
10
*
HZ
)
/
1000
);
schedule_timeout
((
10
*
HZ
)
/
1000
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
hisax_config_lock
,
flags
);
printk
(
KERN_INFO
"%s: IRQ %d count %d
\n
"
,
printk
(
KERN_INFO
"%s: IRQ %d count %d
\n
"
,
CardType
[
cs
->
typ
],
cs
->
irq
,
kstat_irqs
(
cs
->
irq
));
CardType
[
cs
->
typ
],
cs
->
irq
,
kstat_irqs
(
cs
->
irq
));
if
(
kstat_irqs
(
cs
->
irq
)
==
irq_cnt
)
{
if
(
kstat_irqs
(
cs
->
irq
)
==
irq_cnt
)
{
...
@@ -897,19 +894,18 @@ static int __devinit init_card(struct IsdnCardState *cs)
...
@@ -897,19 +894,18 @@ static int __devinit init_card(struct IsdnCardState *cs)
return
0
;
return
0
;
}
}
}
}
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
hisax_config_lock
,
flags
);
return
3
;
return
3
;
}
}
static
int
__devinit
checkcard
(
int
cardnr
,
char
*
id
,
int
*
busy_flag
)
static
int
__devinit
checkcard
(
int
cardnr
,
char
*
id
,
int
*
busy_flag
)
{
{
long
flags
;
unsigned
long
flags
;
int
ret
=
0
;
int
ret
=
0
;
struct
IsdnCard
*
card
=
cards
+
cardnr
;
struct
IsdnCard
*
card
=
cards
+
cardnr
;
struct
IsdnCardState
*
cs
;
struct
IsdnCardState
*
cs
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
hisax_config_lock
,
flags
);
cli
();
cs
=
kmalloc
(
sizeof
(
struct
IsdnCardState
),
GFP_ATOMIC
);
cs
=
kmalloc
(
sizeof
(
struct
IsdnCardState
),
GFP_ATOMIC
);
if
(
!
cs
)
{
if
(
!
cs
)
{
printk
(
KERN_WARNING
printk
(
KERN_WARNING
...
@@ -1216,7 +1212,7 @@ static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
...
@@ -1216,7 +1212,7 @@ static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
kfree
(
cs
);
kfree
(
cs
);
card
->
cs
=
NULL
;
card
->
cs
=
NULL
;
out:
out:
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
hisax_config_lock
,
flags
);
return
ret
;
return
ret
;
}
}
...
@@ -1542,10 +1538,9 @@ static int __init HiSax_init(void)
...
@@ -1542,10 +1538,9 @@ static int __init HiSax_init(void)
static
void
__exit
HiSax_exit
(
void
)
static
void
__exit
HiSax_exit
(
void
)
{
{
int
cardnr
=
nrcards
-
1
;
int
cardnr
=
nrcards
-
1
;
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
hisax_config_lock
,
flags
);
cli
();
while
(
cardnr
>=
0
)
while
(
cardnr
>=
0
)
HiSax_closecard
(
cardnr
--
);
HiSax_closecard
(
cardnr
--
);
Isdnl1Free
();
Isdnl1Free
();
...
@@ -1553,7 +1548,7 @@ static void __exit HiSax_exit(void)
...
@@ -1553,7 +1548,7 @@ static void __exit HiSax_exit(void)
Isdnl2Free
();
Isdnl2Free
();
Isdnl3Free
();
Isdnl3Free
();
CallcFree
();
CallcFree
();
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
hisax_config_lock
,
flags
);
printk
(
KERN_INFO
"HiSax module removed
\n
"
);
printk
(
KERN_INFO
"HiSax module removed
\n
"
);
}
}
...
...
drivers/isdn/hisax/diva.c
View file @
7c99c33b
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
const
char
*
Diva_revision
=
"$Revision: 1.25.6.5 $"
;
const
char
*
Diva_revision
=
"$Revision: 1.25.6.5 $"
;
static
spinlock_t
diva_lock
=
SPIN_LOCK_UNLOCKED
;
#define byteout(addr,val) outb(val,addr)
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
#define bytein(addr) inb(addr)
...
@@ -85,13 +86,12 @@ static inline u_char
...
@@ -85,13 +86,12 @@ static inline u_char
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
{
{
register
u_char
ret
;
register
u_char
ret
;
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
diva_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
ret
=
bytein
(
adr
);
ret
=
bytein
(
adr
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
diva_lock
,
flags
);
return
(
ret
);
return
(
ret
);
}
}
...
@@ -108,13 +108,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
...
@@ -108,13 +108,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
static
inline
void
static
inline
void
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
diva_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
byteout
(
adr
,
data
);
byteout
(
adr
,
data
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
diva_lock
,
flags
);
}
}
static
inline
void
static
inline
void
...
@@ -408,13 +407,12 @@ MemwaitforXFW(struct IsdnCardState *cs, int hscx)
...
@@ -408,13 +407,12 @@ MemwaitforXFW(struct IsdnCardState *cs, int hscx)
static
inline
void
static
inline
void
MemWriteHSCXCMDR
(
struct
IsdnCardState
*
cs
,
int
hscx
,
u_char
data
)
MemWriteHSCXCMDR
(
struct
IsdnCardState
*
cs
,
int
hscx
,
u_char
data
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
diva_lock
,
flags
);
cli
();
MemwaitforCEC
(
cs
,
hscx
);
MemwaitforCEC
(
cs
,
hscx
);
MemWriteHSCX
(
cs
,
hscx
,
HSCX_CMDR
,
data
);
MemWriteHSCX
(
cs
,
hscx
,
HSCX_CMDR
,
data
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
diva_lock
,
flags
);
}
}
static
void
static
void
...
@@ -422,7 +420,7 @@ Memhscx_empty_fifo(struct BCState *bcs, int count)
...
@@ -422,7 +420,7 @@ Memhscx_empty_fifo(struct BCState *bcs, int count)
{
{
u_char
*
ptr
;
u_char
*
ptr
;
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
long
flags
;
unsigned
long
flags
;
int
cnt
;
int
cnt
;
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
...
@@ -435,8 +433,7 @@ Memhscx_empty_fifo(struct BCState *bcs, int count)
...
@@ -435,8 +433,7 @@ Memhscx_empty_fifo(struct BCState *bcs, int count)
bcs
->
hw
.
hscx
.
rcvidx
=
0
;
bcs
->
hw
.
hscx
.
rcvidx
=
0
;
return
;
return
;
}
}
save_flags
(
flags
);
spin_lock_irqsave
(
&
diva_lock
,
flags
);
cli
();
ptr
=
bcs
->
hw
.
hscx
.
rcvbuf
+
bcs
->
hw
.
hscx
.
rcvidx
;
ptr
=
bcs
->
hw
.
hscx
.
rcvbuf
+
bcs
->
hw
.
hscx
.
rcvidx
;
cnt
=
count
;
cnt
=
count
;
while
(
cnt
--
)
while
(
cnt
--
)
...
@@ -444,7 +441,7 @@ Memhscx_empty_fifo(struct BCState *bcs, int count)
...
@@ -444,7 +441,7 @@ Memhscx_empty_fifo(struct BCState *bcs, int count)
MemWriteHSCXCMDR
(
cs
,
bcs
->
hw
.
hscx
.
hscx
,
0x80
);
MemWriteHSCXCMDR
(
cs
,
bcs
->
hw
.
hscx
.
hscx
,
0x80
);
ptr
=
bcs
->
hw
.
hscx
.
rcvbuf
+
bcs
->
hw
.
hscx
.
rcvidx
;
ptr
=
bcs
->
hw
.
hscx
.
rcvbuf
+
bcs
->
hw
.
hscx
.
rcvidx
;
bcs
->
hw
.
hscx
.
rcvidx
+=
count
;
bcs
->
hw
.
hscx
.
rcvidx
+=
count
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
diva_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
char
*
t
=
bcs
->
blog
;
char
*
t
=
bcs
->
blog
;
...
@@ -462,7 +459,7 @@ Memhscx_fill_fifo(struct BCState *bcs)
...
@@ -462,7 +459,7 @@ Memhscx_fill_fifo(struct BCState *bcs)
int
more
,
count
,
cnt
;
int
more
,
count
,
cnt
;
int
fifo_size
=
test_bit
(
HW_IPAC
,
&
cs
->
HW_Flags
)
?
64
:
32
;
int
fifo_size
=
test_bit
(
HW_IPAC
,
&
cs
->
HW_Flags
)
?
64
:
32
;
u_char
*
ptr
,
*
p
;
u_char
*
ptr
,
*
p
;
long
flags
;
unsigned
long
flags
;
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
...
@@ -481,8 +478,7 @@ Memhscx_fill_fifo(struct BCState *bcs)
...
@@ -481,8 +478,7 @@ Memhscx_fill_fifo(struct BCState *bcs)
count
=
bcs
->
tx_skb
->
len
;
count
=
bcs
->
tx_skb
->
len
;
cnt
=
count
;
cnt
=
count
;
MemwaitforXFW
(
cs
,
bcs
->
hw
.
hscx
.
hscx
);
MemwaitforXFW
(
cs
,
bcs
->
hw
.
hscx
.
hscx
);
save_flags
(
flags
);
spin_lock_irqsave
(
&
diva_lock
,
flags
);
cli
();
p
=
ptr
=
bcs
->
tx_skb
->
data
;
p
=
ptr
=
bcs
->
tx_skb
->
data
;
skb_pull
(
bcs
->
tx_skb
,
count
);
skb_pull
(
bcs
->
tx_skb
,
count
);
bcs
->
tx_cnt
-=
count
;
bcs
->
tx_cnt
-=
count
;
...
@@ -491,7 +487,7 @@ Memhscx_fill_fifo(struct BCState *bcs)
...
@@ -491,7 +487,7 @@ Memhscx_fill_fifo(struct BCState *bcs)
memwritereg
(
cs
->
hw
.
diva
.
cfg_reg
,
bcs
->
hw
.
hscx
.
hscx
?
0x40
:
0
,
memwritereg
(
cs
->
hw
.
diva
.
cfg_reg
,
bcs
->
hw
.
hscx
.
hscx
?
0x40
:
0
,
*
p
++
);
*
p
++
);
MemWriteHSCXCMDR
(
cs
,
bcs
->
hw
.
hscx
.
hscx
,
more
?
0x8
:
0xa
);
MemWriteHSCXCMDR
(
cs
,
bcs
->
hw
.
hscx
.
hscx
,
more
?
0x8
:
0xa
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
diva_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
char
*
t
=
bcs
->
blog
;
char
*
t
=
bcs
->
blog
;
...
...
drivers/isdn/hisax/elsa.c
View file @
7c99c33b
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include <linux/serial_reg.h>
#include <linux/serial_reg.h>
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
static
spinlock_t
elsa_lock
=
SPIN_LOCK_UNLOCKED
;
const
char
*
Elsa_revision
=
"$Revision: 2.26.6.6 $"
;
const
char
*
Elsa_revision
=
"$Revision: 2.26.6.6 $"
;
const
char
*
Elsa_Types
[]
=
const
char
*
Elsa_Types
[]
=
...
@@ -145,13 +146,12 @@ static inline u_char
...
@@ -145,13 +146,12 @@ static inline u_char
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
{
{
register
u_char
ret
;
register
u_char
ret
;
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
elsa_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
ret
=
bytein
(
adr
);
ret
=
bytein
(
adr
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_lock
,
flags
);
return
(
ret
);
return
(
ret
);
}
}
...
@@ -168,13 +168,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
...
@@ -168,13 +168,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
static
inline
void
static
inline
void
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
elsa_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
byteout
(
adr
,
data
);
byteout
(
adr
,
data
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_lock
,
flags
);
}
}
static
inline
void
static
inline
void
...
@@ -253,26 +252,24 @@ static inline u_char
...
@@ -253,26 +252,24 @@ static inline u_char
readitac
(
struct
IsdnCardState
*
cs
,
u_char
off
)
readitac
(
struct
IsdnCardState
*
cs
,
u_char
off
)
{
{
register
u_char
ret
;
register
u_char
ret
;
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
elsa_lock
,
flags
);
cli
();
byteout
(
cs
->
hw
.
elsa
.
ale
,
off
);
byteout
(
cs
->
hw
.
elsa
.
ale
,
off
);
ret
=
bytein
(
cs
->
hw
.
elsa
.
itac
);
ret
=
bytein
(
cs
->
hw
.
elsa
.
itac
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_lock
,
flags
);
return
(
ret
);
return
(
ret
);
}
}
static
inline
void
static
inline
void
writeitac
(
struct
IsdnCardState
*
cs
,
u_char
off
,
u_char
data
)
writeitac
(
struct
IsdnCardState
*
cs
,
u_char
off
,
u_char
data
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
elsa_lock
,
flags
);
cli
();
byteout
(
cs
->
hw
.
elsa
.
ale
,
off
);
byteout
(
cs
->
hw
.
elsa
.
ale
,
off
);
byteout
(
cs
->
hw
.
elsa
.
itac
,
data
);
byteout
(
cs
->
hw
.
elsa
.
itac
,
data
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_lock
,
flags
);
}
}
static
inline
int
static
inline
int
...
@@ -798,7 +795,7 @@ probe_elsa_adr(unsigned int adr, int typ)
...
@@ -798,7 +795,7 @@ probe_elsa_adr(unsigned int adr, int typ)
{
{
int
i
,
in1
,
in2
,
p16_1
=
0
,
p16_2
=
0
,
p8_1
=
0
,
p8_2
=
0
,
pc_1
=
0
,
int
i
,
in1
,
in2
,
p16_1
=
0
,
p16_2
=
0
,
p8_1
=
0
,
p8_2
=
0
,
pc_1
=
0
,
pc_2
=
0
,
pfp_1
=
0
,
pfp_2
=
0
;
pc_2
=
0
,
pfp_1
=
0
,
pfp_2
=
0
;
long
flags
;
unsigned
long
flags
;
/* In case of the elsa pcmcia card, this region is in use,
/* In case of the elsa pcmcia card, this region is in use,
reserved for us by the card manager. So we do not check it
reserved for us by the card manager. So we do not check it
...
@@ -809,8 +806,7 @@ probe_elsa_adr(unsigned int adr, int typ)
...
@@ -809,8 +806,7 @@ probe_elsa_adr(unsigned int adr, int typ)
adr
);
adr
);
return
(
0
);
return
(
0
);
}
}
save_flags
(
flags
);
spin_lock_irqsave
(
&
elsa_lock
,
flags
);
cli
();
for
(
i
=
0
;
i
<
16
;
i
++
)
{
for
(
i
=
0
;
i
<
16
;
i
++
)
{
in1
=
inb
(
adr
+
ELSA_CONFIG
);
/* 'toggelt' bei */
in1
=
inb
(
adr
+
ELSA_CONFIG
);
/* 'toggelt' bei */
in2
=
inb
(
adr
+
ELSA_CONFIG
);
/* jedem Zugriff */
in2
=
inb
(
adr
+
ELSA_CONFIG
);
/* jedem Zugriff */
...
@@ -823,7 +819,7 @@ probe_elsa_adr(unsigned int adr, int typ)
...
@@ -823,7 +819,7 @@ probe_elsa_adr(unsigned int adr, int typ)
pfp_1
+=
0x40
&
in1
;
pfp_1
+=
0x40
&
in1
;
pfp_2
+=
0x40
&
in2
;
pfp_2
+=
0x40
&
in2
;
}
}
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_lock
,
flags
);
printk
(
KERN_INFO
"Elsa: Probing IO 0x%x"
,
adr
);
printk
(
KERN_INFO
"Elsa: Probing IO 0x%x"
,
adr
);
if
(
65
==
++
p16_1
*
++
p16_2
)
{
if
(
65
==
++
p16_1
*
++
p16_2
)
{
printk
(
" PCC-16/PCF found
\n
"
);
printk
(
" PCC-16/PCF found
\n
"
);
...
@@ -878,7 +874,7 @@ static struct pci_bus *pnp_c __devinitdata = NULL;
...
@@ -878,7 +874,7 @@ static struct pci_bus *pnp_c __devinitdata = NULL;
int
__devinit
int
__devinit
setup_elsa
(
struct
IsdnCard
*
card
)
setup_elsa
(
struct
IsdnCard
*
card
)
{
{
long
flags
;
unsigned
long
flags
;
int
bytecnt
;
int
bytecnt
;
u_char
val
,
pci_rev
;
u_char
val
,
pci_rev
;
struct
IsdnCardState
*
cs
=
card
->
cs
;
struct
IsdnCardState
*
cs
=
card
->
cs
;
...
@@ -1170,10 +1166,9 @@ setup_elsa(struct IsdnCard *card)
...
@@ -1170,10 +1166,9 @@ setup_elsa(struct IsdnCard *card)
return
(
0
);
return
(
0
);
}
}
}
}
save_flags
(
flags
);
spin_lock_irqsave
(
&
elsa_lock
,
flags
);
sti
();
HZDELAY
(
1
);
/* wait >=10 ms */
HZDELAY
(
1
);
/* wait >=10 ms */
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_lock
,
flags
);
if
(
TimerRun
(
cs
))
{
if
(
TimerRun
(
cs
))
{
printk
(
KERN_WARNING
"Elsa: timer do not run down
\n
"
);
printk
(
KERN_WARNING
"Elsa: timer do not run down
\n
"
);
release_io_elsa
(
cs
);
release_io_elsa
(
cs
);
...
...
drivers/isdn/hisax/elsa_ser.c
View file @
7c99c33b
...
@@ -30,6 +30,7 @@ static u_char deb[32];
...
@@ -30,6 +30,7 @@ static u_char deb[32];
const
char
*
ModemIn
[]
=
{
"RBR"
,
"IER"
,
"IIR"
,
"LCR"
,
"MCR"
,
"LSR"
,
"MSR"
,
"SCR"
};
const
char
*
ModemIn
[]
=
{
"RBR"
,
"IER"
,
"IIR"
,
"LCR"
,
"MCR"
,
"LSR"
,
"MSR"
,
"SCR"
};
const
char
*
ModemOut
[]
=
{
"THR"
,
"IER"
,
"FCR"
,
"LCR"
,
"MCR"
,
"LSR"
,
"MSR"
,
"SCR"
};
const
char
*
ModemOut
[]
=
{
"THR"
,
"IER"
,
"FCR"
,
"LCR"
,
"MCR"
,
"LSR"
,
"MSR"
,
"SCR"
};
#endif
#endif
static
spinlock_t
elsa_ser_lock
=
SPIN_LOCK_UNLOCKED
;
static
char
*
MInit_1
=
"AT&F&C1E0&D2
\r\0
"
;
static
char
*
MInit_1
=
"AT&F&C1E0&D2
\r\0
"
;
static
char
*
MInit_2
=
"ATL2M1S64=13
\r\0
"
;
static
char
*
MInit_2
=
"ATL2M1S64=13
\r\0
"
;
...
@@ -134,23 +135,22 @@ static void change_speed(struct IsdnCardState *cs, int baud)
...
@@ -134,23 +135,22 @@ static void change_speed(struct IsdnCardState *cs, int baud)
serial_outp
(
cs
,
UART_IER
,
cs
->
hw
.
elsa
.
IER
);
serial_outp
(
cs
,
UART_IER
,
cs
->
hw
.
elsa
.
IER
);
debugl1
(
cs
,
"modem quot=0x%x"
,
quot
);
debugl1
(
cs
,
"modem quot=0x%x"
,
quot
);
save_flags
(
flags
);
spin_lock_irqsave
(
&
elsa_ser_lock
,
flags
);
cli
();
serial_outp
(
cs
,
UART_LCR
,
cval
|
UART_LCR_DLAB
);
/* set DLAB */
serial_outp
(
cs
,
UART_LCR
,
cval
|
UART_LCR_DLAB
);
/* set DLAB */
serial_outp
(
cs
,
UART_DLL
,
quot
&
0xff
);
/* LS of divisor */
serial_outp
(
cs
,
UART_DLL
,
quot
&
0xff
);
/* LS of divisor */
serial_outp
(
cs
,
UART_DLM
,
quot
>>
8
);
/* MS of divisor */
serial_outp
(
cs
,
UART_DLM
,
quot
>>
8
);
/* MS of divisor */
serial_outp
(
cs
,
UART_LCR
,
cval
);
/* reset DLAB */
serial_outp
(
cs
,
UART_LCR
,
cval
);
/* reset DLAB */
serial_inp
(
cs
,
UART_RX
);
serial_inp
(
cs
,
UART_RX
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_ser_lock
,
flags
);
}
}
static
int
mstartup
(
struct
IsdnCardState
*
cs
)
static
int
mstartup
(
struct
IsdnCardState
*
cs
)
{
{
unsigned
long
flags
;
unsigned
unsigned
long
flags
;
int
retval
=
0
;
int
retval
=
0
;
s
ave_flags
(
flags
);
cli
(
);
s
pin_lock_irqsave
(
&
elsa_ser_lock
,
flags
);
/*
/*
* Clear the FIFO buffers and disable them
* Clear the FIFO buffers and disable them
...
@@ -207,7 +207,7 @@ static int mstartup(struct IsdnCardState *cs)
...
@@ -207,7 +207,7 @@ static int mstartup(struct IsdnCardState *cs)
change_speed
(
cs
,
BASE_BAUD
);
change_speed
(
cs
,
BASE_BAUD
);
cs
->
hw
.
elsa
.
MFlag
=
1
;
cs
->
hw
.
elsa
.
MFlag
=
1
;
errout:
errout:
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_ser_lock
,
flags
);
return
retval
;
return
retval
;
}
}
...
@@ -224,7 +224,7 @@ static void mshutdown(struct IsdnCardState *cs)
...
@@ -224,7 +224,7 @@ static void mshutdown(struct IsdnCardState *cs)
printk
(
KERN_DEBUG
"Shutting down serial ...."
);
printk
(
KERN_DEBUG
"Shutting down serial ...."
);
#endif
#endif
s
ave_flags
(
flags
);
cli
();
/* Disable interrupts */
s
pin_lock_irqsave
(
&
elsa_ser_lock
,
flags
);
/* Disable interrupts */
/*
/*
* clear delta_msr_wait queue to avoid mem leaks: we may free the irq
* clear delta_msr_wait queue to avoid mem leaks: we may free the irq
...
@@ -245,7 +245,7 @@ static void mshutdown(struct IsdnCardState *cs)
...
@@ -245,7 +245,7 @@ static void mshutdown(struct IsdnCardState *cs)
serial_outp
(
cs
,
UART_FCR
,
(
UART_FCR_CLEAR_RCVR
|
UART_FCR_CLEAR_XMIT
));
serial_outp
(
cs
,
UART_FCR
,
(
UART_FCR_CLEAR_RCVR
|
UART_FCR_CLEAR_XMIT
));
serial_inp
(
cs
,
UART_RX
);
/* read data port to reset things */
serial_inp
(
cs
,
UART_RX
);
/* read data port to reset things */
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_ser_lock
,
flags
);
#ifdef SERIAL_DEBUG_OPEN
#ifdef SERIAL_DEBUG_OPEN
printk
(
" done
\n
"
);
printk
(
" done
\n
"
);
#endif
#endif
...
@@ -256,14 +256,13 @@ write_modem(struct BCState *bcs) {
...
@@ -256,14 +256,13 @@ write_modem(struct BCState *bcs) {
int
ret
=
0
;
int
ret
=
0
;
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
int
count
,
len
,
fp
;
int
count
,
len
,
fp
;
long
flags
;
unsigned
long
flags
;
if
(
!
bcs
->
tx_skb
)
if
(
!
bcs
->
tx_skb
)
return
0
;
return
0
;
if
(
bcs
->
tx_skb
->
len
<=
0
)
if
(
bcs
->
tx_skb
->
len
<=
0
)
return
0
;
return
0
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
elsa_ser_lock
,
flags
);
cli
();
len
=
bcs
->
tx_skb
->
len
;
len
=
bcs
->
tx_skb
->
len
;
if
(
len
>
MAX_MODEM_BUF
-
cs
->
hw
.
elsa
.
transcnt
)
if
(
len
>
MAX_MODEM_BUF
-
cs
->
hw
.
elsa
.
transcnt
)
len
=
MAX_MODEM_BUF
-
cs
->
hw
.
elsa
.
transcnt
;
len
=
MAX_MODEM_BUF
-
cs
->
hw
.
elsa
.
transcnt
;
...
@@ -289,7 +288,7 @@ write_modem(struct BCState *bcs) {
...
@@ -289,7 +288,7 @@ write_modem(struct BCState *bcs) {
cs
->
hw
.
elsa
.
IER
|=
UART_IER_THRI
;
cs
->
hw
.
elsa
.
IER
|=
UART_IER_THRI
;
serial_outp
(
cs
,
UART_IER
,
cs
->
hw
.
elsa
.
IER
);
serial_outp
(
cs
,
UART_IER
,
cs
->
hw
.
elsa
.
IER
);
}
}
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_ser_lock
,
flags
);
return
(
ret
);
return
(
ret
);
}
}
...
@@ -460,14 +459,13 @@ void
...
@@ -460,14 +459,13 @@ void
modem_write_cmd
(
struct
IsdnCardState
*
cs
,
u_char
*
buf
,
int
len
)
{
modem_write_cmd
(
struct
IsdnCardState
*
cs
,
u_char
*
buf
,
int
len
)
{
int
count
,
fp
;
int
count
,
fp
;
u_char
*
msg
=
buf
;
u_char
*
msg
=
buf
;
long
flags
;
unsigned
long
flags
;
if
(
!
len
)
if
(
!
len
)
return
;
return
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
elsa_ser_lock
,
flags
);
cli
();
if
(
len
>
(
MAX_MODEM_BUF
-
cs
->
hw
.
elsa
.
transcnt
))
{
if
(
len
>
(
MAX_MODEM_BUF
-
cs
->
hw
.
elsa
.
transcnt
))
{
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_ser_lock
,
flags
);
return
;
return
;
}
}
fp
=
cs
->
hw
.
elsa
.
transcnt
+
cs
->
hw
.
elsa
.
transp
;
fp
=
cs
->
hw
.
elsa
.
transcnt
+
cs
->
hw
.
elsa
.
transp
;
...
@@ -488,17 +486,16 @@ modem_write_cmd(struct IsdnCardState *cs, u_char *buf, int len) {
...
@@ -488,17 +486,16 @@ modem_write_cmd(struct IsdnCardState *cs, u_char *buf, int len) {
cs
->
hw
.
elsa
.
IER
|=
UART_IER_THRI
;
cs
->
hw
.
elsa
.
IER
|=
UART_IER_THRI
;
serial_outp
(
cs
,
UART_IER
,
cs
->
hw
.
elsa
.
IER
);
serial_outp
(
cs
,
UART_IER
,
cs
->
hw
.
elsa
.
IER
);
}
}
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_ser_lock
,
flags
);
}
}
void
void
modem_set_init
(
struct
IsdnCardState
*
cs
)
{
modem_set_init
(
struct
IsdnCardState
*
cs
)
{
long
flags
;
unsigned
long
flags
;
int
timeout
;
int
timeout
;
#define RCV_DELAY 20000
#define RCV_DELAY 20000
save_flags
(
flags
);
spin_lock_irqsave
(
&
elsa_ser_lock
,
flags
);
sti
();
modem_write_cmd
(
cs
,
MInit_1
,
strlen
(
MInit_1
));
modem_write_cmd
(
cs
,
MInit_1
,
strlen
(
MInit_1
));
timeout
=
1000
;
timeout
=
1000
;
while
(
timeout
--
&&
cs
->
hw
.
elsa
.
transcnt
)
while
(
timeout
--
&&
cs
->
hw
.
elsa
.
transcnt
)
...
@@ -541,17 +538,16 @@ modem_set_init(struct IsdnCardState *cs) {
...
@@ -541,17 +538,16 @@ modem_set_init(struct IsdnCardState *cs) {
udelay
(
1000
);
udelay
(
1000
);
debugl1
(
cs
,
"msi tout=%d"
,
timeout
);
debugl1
(
cs
,
"msi tout=%d"
,
timeout
);
udelay
(
RCV_DELAY
);
udelay
(
RCV_DELAY
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_ser_lock
,
flags
);
}
}
void
void
modem_set_dial
(
struct
IsdnCardState
*
cs
,
int
outgoing
)
{
modem_set_dial
(
struct
IsdnCardState
*
cs
,
int
outgoing
)
{
long
flags
;
unsigned
long
flags
;
int
timeout
;
int
timeout
;
#define RCV_DELAY 20000
#define RCV_DELAY 20000
save_flags
(
flags
);
spin_lock_irqsave
(
&
elsa_ser_lock
,
flags
);
sti
();
modem_write_cmd
(
cs
,
MInit_speed28800
,
strlen
(
MInit_speed28800
));
modem_write_cmd
(
cs
,
MInit_speed28800
,
strlen
(
MInit_speed28800
));
timeout
=
1000
;
timeout
=
1000
;
while
(
timeout
--
&&
cs
->
hw
.
elsa
.
transcnt
)
while
(
timeout
--
&&
cs
->
hw
.
elsa
.
transcnt
)
...
@@ -567,26 +563,25 @@ modem_set_dial(struct IsdnCardState *cs, int outgoing) {
...
@@ -567,26 +563,25 @@ modem_set_dial(struct IsdnCardState *cs, int outgoing) {
udelay
(
1000
);
udelay
(
1000
);
debugl1
(
cs
,
"msi tout=%d"
,
timeout
);
debugl1
(
cs
,
"msi tout=%d"
,
timeout
);
udelay
(
RCV_DELAY
);
udelay
(
RCV_DELAY
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_ser_lock
,
flags
);
}
}
void
void
modem_l2l1
(
struct
PStack
*
st
,
int
pr
,
void
*
arg
)
modem_l2l1
(
struct
PStack
*
st
,
int
pr
,
void
*
arg
)
{
{
struct
sk_buff
*
skb
=
arg
;
struct
sk_buff
*
skb
=
arg
;
long
flags
;
unsigned
long
flags
;
if
(
pr
==
(
PH_DATA
|
REQUEST
))
{
if
(
pr
==
(
PH_DATA
|
REQUEST
))
{
save_flags
(
flags
);
spin_lock_irqsave
(
&
elsa_ser_lock
,
flags
);
cli
();
if
(
st
->
l1
.
bcs
->
tx_skb
)
{
if
(
st
->
l1
.
bcs
->
tx_skb
)
{
skb_queue_tail
(
&
st
->
l1
.
bcs
->
squeue
,
skb
);
skb_queue_tail
(
&
st
->
l1
.
bcs
->
squeue
,
skb
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_ser_lock
,
flags
);
}
else
{
}
else
{
st
->
l1
.
bcs
->
tx_skb
=
skb
;
st
->
l1
.
bcs
->
tx_skb
=
skb
;
test_and_set_bit
(
BC_FLG_BUSY
,
&
st
->
l1
.
bcs
->
Flag
);
test_and_set_bit
(
BC_FLG_BUSY
,
&
st
->
l1
.
bcs
->
Flag
);
st
->
l1
.
bcs
->
hw
.
hscx
.
count
=
0
;
st
->
l1
.
bcs
->
hw
.
hscx
.
count
=
0
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
elsa_ser_lock
,
flags
);
write_modem
(
st
->
l1
.
bcs
);
write_modem
(
st
->
l1
.
bcs
);
}
}
}
else
if
(
pr
==
(
PH_ACTIVATE
|
REQUEST
))
{
}
else
if
(
pr
==
(
PH_ACTIVATE
|
REQUEST
))
{
...
...
drivers/isdn/hisax/enternow_pci.c
View file @
7c99c33b
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
const
char
*
enternow_pci_rev
=
"$Revision: 1.1.2.1 $"
;
const
char
*
enternow_pci_rev
=
"$Revision: 1.1.2.1 $"
;
static
spinlock_t
enternow_pci_lock
=
SPIN_LOCK_UNLOCKED
;
/* *************************** I/O-Interface functions ************************************* */
/* *************************** I/O-Interface functions ************************************* */
...
@@ -237,7 +237,7 @@ enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
...
@@ -237,7 +237,7 @@ enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
{
struct
IsdnCardState
*
cs
=
dev_id
;
struct
IsdnCardState
*
cs
=
dev_id
;
BYTE
sval
,
ir
;
BYTE
sval
,
ir
;
long
flags
;
unsigned
long
flags
;
if
(
!
cs
)
{
if
(
!
cs
)
{
...
@@ -257,8 +257,7 @@ enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
...
@@ -257,8 +257,7 @@ enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
/* DMA-Interrupt: B-channel-stuff */
/* DMA-Interrupt: B-channel-stuff */
/* set bits in sval to indicate which page is free */
/* set bits in sval to indicate which page is free */
save_flags
(
flags
);
spin_lock_irqsave
(
&
enternow_pci_lock
,
flags
);
cli
();
/* set bits in sval to indicate which page is free */
/* set bits in sval to indicate which page is free */
if
(
inl
(
cs
->
hw
.
njet
.
base
+
NETJET_DMA_WRITE_ADR
)
<
if
(
inl
(
cs
->
hw
.
njet
.
base
+
NETJET_DMA_WRITE_ADR
)
<
inl
(
cs
->
hw
.
njet
.
base
+
NETJET_DMA_WRITE_IRQ
))
inl
(
cs
->
hw
.
njet
.
base
+
NETJET_DMA_WRITE_IRQ
))
...
@@ -275,11 +274,11 @@ enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
...
@@ -275,11 +274,11 @@ enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
if
(
sval
!=
cs
->
hw
.
njet
.
last_is0
)
/* we have a DMA interrupt */
if
(
sval
!=
cs
->
hw
.
njet
.
last_is0
)
/* we have a DMA interrupt */
{
{
if
(
test_and_set_bit
(
FLG_LOCK_ATOMIC
,
&
cs
->
HW_Flags
))
{
if
(
test_and_set_bit
(
FLG_LOCK_ATOMIC
,
&
cs
->
HW_Flags
))
{
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
enternow_pci_lock
,
flags
);
return
;
return
;
}
}
cs
->
hw
.
njet
.
irqstat0
=
sval
;
cs
->
hw
.
njet
.
irqstat0
=
sval
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
enternow_pci_lock
,
flags
);
if
((
cs
->
hw
.
njet
.
irqstat0
&
NETJET_IRQM0_READ
)
!=
if
((
cs
->
hw
.
njet
.
irqstat0
&
NETJET_IRQM0_READ
)
!=
(
cs
->
hw
.
njet
.
last_is0
&
NETJET_IRQM0_READ
))
(
cs
->
hw
.
njet
.
last_is0
&
NETJET_IRQM0_READ
))
/* we have a read dma int */
/* we have a read dma int */
...
@@ -290,7 +289,7 @@ enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
...
@@ -290,7 +289,7 @@ enpci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
write_tiger
(
cs
);
write_tiger
(
cs
);
test_and_clear_bit
(
FLG_LOCK_ATOMIC
,
&
cs
->
HW_Flags
);
test_and_clear_bit
(
FLG_LOCK_ATOMIC
,
&
cs
->
HW_Flags
);
}
else
}
else
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
enternow_pci_lock
,
flags
);
}
}
...
@@ -303,7 +302,7 @@ setup_enternow_pci(struct IsdnCard *card)
...
@@ -303,7 +302,7 @@ setup_enternow_pci(struct IsdnCard *card)
int
bytecnt
;
int
bytecnt
;
struct
IsdnCardState
*
cs
=
card
->
cs
;
struct
IsdnCardState
*
cs
=
card
->
cs
;
char
tmp
[
64
];
char
tmp
[
64
];
long
flags
;
unsigned
long
flags
;
#if CONFIG_PCI
#if CONFIG_PCI
#ifdef __BIG_ENDIAN
#ifdef __BIG_ENDIAN
...
...
drivers/isdn/hisax/gazel.c
View file @
7c99c33b
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
const
char
*
gazel_revision
=
"$Revision: 2.11.6.7 $"
;
const
char
*
gazel_revision
=
"$Revision: 2.11.6.7 $"
;
static
spinlock_t
gazel_lock
=
SPIN_LOCK_UNLOCKED
;
#define R647 1
#define R647 1
#define R685 2
#define R685 2
...
@@ -72,26 +73,24 @@ static inline u_char
...
@@ -72,26 +73,24 @@ static inline u_char
readreg_ipac
(
unsigned
int
adr
,
u_short
off
)
readreg_ipac
(
unsigned
int
adr
,
u_short
off
)
{
{
register
u_char
ret
;
register
u_char
ret
;
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
gazel_lock
,
flags
);
cli
();
byteout
(
adr
,
off
);
byteout
(
adr
,
off
);
ret
=
bytein
(
adr
+
4
);
ret
=
bytein
(
adr
+
4
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
gazel_lock
,
flags
);
return
ret
;
return
ret
;
}
}
static
inline
void
static
inline
void
writereg_ipac
(
unsigned
int
adr
,
u_short
off
,
u_char
data
)
writereg_ipac
(
unsigned
int
adr
,
u_short
off
,
u_char
data
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
gazel_lock
,
flags
);
cli
();
byteout
(
adr
,
off
);
byteout
(
adr
,
off
);
byteout
(
adr
+
4
,
data
);
byteout
(
adr
+
4
,
data
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
gazel_lock
,
flags
);
}
}
...
@@ -357,18 +356,17 @@ release_io_gazel(struct IsdnCardState *cs)
...
@@ -357,18 +356,17 @@ release_io_gazel(struct IsdnCardState *cs)
static
int
static
int
reset_gazel
(
struct
IsdnCardState
*
cs
)
reset_gazel
(
struct
IsdnCardState
*
cs
)
{
{
long
flags
;
unsigned
long
flags
;
unsigned
long
plxcntrl
,
addr
=
cs
->
hw
.
gazel
.
cfg_reg
;
unsigned
long
plxcntrl
,
addr
=
cs
->
hw
.
gazel
.
cfg_reg
;
switch
(
cs
->
subtyp
)
{
switch
(
cs
->
subtyp
)
{
case
R647
:
case
R647
:
save_flags
(
flags
);
spin_lock_irqsave
(
&
gazel_lock
,
flags
);
cli
();
writereg
(
addr
,
0
,
0
);
writereg
(
addr
,
0
,
0
);
HZDELAY
(
10
);
HZDELAY
(
10
);
writereg
(
addr
,
0
,
1
);
writereg
(
addr
,
0
,
1
);
HZDELAY
(
2
);
HZDELAY
(
2
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
gazel_lock
,
flags
);
break
;
break
;
case
R685
:
case
R685
:
plxcntrl
=
inl
(
addr
+
PLX_CNTRL
);
plxcntrl
=
inl
(
addr
+
PLX_CNTRL
);
...
...
drivers/isdn/hisax/icc.c
View file @
7c99c33b
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#define DBUSY_TIMER_VALUE 80
#define DBUSY_TIMER_VALUE 80
#define ARCOFI_USE 0
#define ARCOFI_USE 0
static
spinlock_t
icc_lock
=
SPIN_LOCK_UNLOCKED
;
static
char
*
ICCVer
[]
__initdata
=
static
char
*
ICCVer
[]
__initdata
=
{
"2070 A1/A3"
,
"2070 B1"
,
"2070 B2/B3"
,
"2070 V2.4"
};
{
"2070 A1/A3"
,
"2070 B1"
,
"2070 B2/B3"
,
"2070 V2.4"
};
...
@@ -112,7 +113,7 @@ void
...
@@ -112,7 +113,7 @@ void
icc_empty_fifo
(
struct
IsdnCardState
*
cs
,
int
count
)
icc_empty_fifo
(
struct
IsdnCardState
*
cs
,
int
count
)
{
{
u_char
*
ptr
;
u_char
*
ptr
;
long
flags
;
unsigned
long
flags
;
if
((
cs
->
debug
&
L1_DEB_ISAC
)
&&
!
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
))
if
((
cs
->
debug
&
L1_DEB_ISAC
)
&&
!
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
))
debugl1
(
cs
,
"icc_empty_fifo"
);
debugl1
(
cs
,
"icc_empty_fifo"
);
...
@@ -127,11 +128,10 @@ icc_empty_fifo(struct IsdnCardState *cs, int count)
...
@@ -127,11 +128,10 @@ icc_empty_fifo(struct IsdnCardState *cs, int count)
}
}
ptr
=
cs
->
rcvbuf
+
cs
->
rcvidx
;
ptr
=
cs
->
rcvbuf
+
cs
->
rcvidx
;
cs
->
rcvidx
+=
count
;
cs
->
rcvidx
+=
count
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
icc_lock
,
flags
);
cli
();
cs
->
readisacfifo
(
cs
,
ptr
,
count
);
cs
->
readisacfifo
(
cs
,
ptr
,
count
);
cs
->
writeisac
(
cs
,
ICC_CMDR
,
0x80
);
cs
->
writeisac
(
cs
,
ICC_CMDR
,
0x80
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
icc_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
)
{
if
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
)
{
char
*
t
=
cs
->
dlog
;
char
*
t
=
cs
->
dlog
;
...
@@ -146,7 +146,7 @@ icc_fill_fifo(struct IsdnCardState *cs)
...
@@ -146,7 +146,7 @@ icc_fill_fifo(struct IsdnCardState *cs)
{
{
int
count
,
more
;
int
count
,
more
;
u_char
*
ptr
;
u_char
*
ptr
;
long
flags
;
unsigned
long
flags
;
if
((
cs
->
debug
&
L1_DEB_ISAC
)
&&
!
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
))
if
((
cs
->
debug
&
L1_DEB_ISAC
)
&&
!
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
))
debugl1
(
cs
,
"icc_fill_fifo"
);
debugl1
(
cs
,
"icc_fill_fifo"
);
...
@@ -163,8 +163,7 @@ icc_fill_fifo(struct IsdnCardState *cs)
...
@@ -163,8 +163,7 @@ icc_fill_fifo(struct IsdnCardState *cs)
more
=
!
0
;
more
=
!
0
;
count
=
32
;
count
=
32
;
}
}
save_flags
(
flags
);
spin_lock_irqsave
(
&
icc_lock
,
flags
);
cli
();
ptr
=
cs
->
tx_skb
->
data
;
ptr
=
cs
->
tx_skb
->
data
;
skb_pull
(
cs
->
tx_skb
,
count
);
skb_pull
(
cs
->
tx_skb
,
count
);
cs
->
tx_cnt
+=
count
;
cs
->
tx_cnt
+=
count
;
...
@@ -177,7 +176,7 @@ icc_fill_fifo(struct IsdnCardState *cs)
...
@@ -177,7 +176,7 @@ icc_fill_fifo(struct IsdnCardState *cs)
init_timer
(
&
cs
->
dbusytimer
);
init_timer
(
&
cs
->
dbusytimer
);
cs
->
dbusytimer
.
expires
=
jiffies
+
((
DBUSY_TIMER_VALUE
*
HZ
)
/
1000
);
cs
->
dbusytimer
.
expires
=
jiffies
+
((
DBUSY_TIMER_VALUE
*
HZ
)
/
1000
);
add_timer
(
&
cs
->
dbusytimer
);
add_timer
(
&
cs
->
dbusytimer
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
icc_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
)
{
if
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
)
{
char
*
t
=
cs
->
dlog
;
char
*
t
=
cs
->
dlog
;
...
@@ -200,7 +199,7 @@ icc_interrupt(struct IsdnCardState *cs, u_char val)
...
@@ -200,7 +199,7 @@ icc_interrupt(struct IsdnCardState *cs, u_char val)
u_char
exval
,
v1
;
u_char
exval
,
v1
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
unsigned
int
count
;
unsigned
int
count
;
long
flags
;
unsigned
long
flags
;
if
(
cs
->
debug
&
L1_DEB_ISAC
)
if
(
cs
->
debug
&
L1_DEB_ISAC
)
debugl1
(
cs
,
"ICC interrupt %x"
,
val
);
debugl1
(
cs
,
"ICC interrupt %x"
,
val
);
...
@@ -227,8 +226,7 @@ icc_interrupt(struct IsdnCardState *cs, u_char val)
...
@@ -227,8 +226,7 @@ icc_interrupt(struct IsdnCardState *cs, u_char val)
if
(
count
==
0
)
if
(
count
==
0
)
count
=
32
;
count
=
32
;
icc_empty_fifo
(
cs
,
count
);
icc_empty_fifo
(
cs
,
count
);
save_flags
(
flags
);
spin_lock_irqsave
(
&
icc_lock
,
flags
);
cli
();
if
((
count
=
cs
->
rcvidx
)
>
0
)
{
if
((
count
=
cs
->
rcvidx
)
>
0
)
{
cs
->
rcvidx
=
0
;
cs
->
rcvidx
=
0
;
if
(
!
(
skb
=
alloc_skb
(
count
,
GFP_ATOMIC
)))
if
(
!
(
skb
=
alloc_skb
(
count
,
GFP_ATOMIC
)))
...
@@ -238,7 +236,7 @@ icc_interrupt(struct IsdnCardState *cs, u_char val)
...
@@ -238,7 +236,7 @@ icc_interrupt(struct IsdnCardState *cs, u_char val)
skb_queue_tail
(
&
cs
->
rq
,
skb
);
skb_queue_tail
(
&
cs
->
rq
,
skb
);
}
}
}
}
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
icc_lock
,
flags
);
}
}
cs
->
rcvidx
=
0
;
cs
->
rcvidx
=
0
;
icc_sched_event
(
cs
,
D_RCVBUFREADY
);
icc_sched_event
(
cs
,
D_RCVBUFREADY
);
...
...
drivers/isdn/hisax/ipacx.c
View file @
7c99c33b
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#define MAX_DFRAME_LEN_L1 300
#define MAX_DFRAME_LEN_L1 300
#define B_FIFO_SIZE 64
#define B_FIFO_SIZE 64
#define D_FIFO_SIZE 32
#define D_FIFO_SIZE 32
static
spinlock_t
ipacx_lock
=
SPIN_LOCK_UNLOCKED
;
// ipacx interrupt mask values
// ipacx interrupt mask values
#define _MASK_IMASK 0x2E // global mask
#define _MASK_IMASK 0x2E // global mask
...
@@ -314,7 +314,7 @@ dch_sched_event(struct IsdnCardState *cs, int event)
...
@@ -314,7 +314,7 @@ dch_sched_event(struct IsdnCardState *cs, int event)
static
void
static
void
dch_empty_fifo
(
struct
IsdnCardState
*
cs
,
int
count
)
dch_empty_fifo
(
struct
IsdnCardState
*
cs
,
int
count
)
{
{
long
flags
;
unsigned
long
flags
;
u_char
*
ptr
;
u_char
*
ptr
;
if
((
cs
->
debug
&
L1_DEB_ISAC
)
&&
!
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
))
if
((
cs
->
debug
&
L1_DEB_ISAC
)
&&
!
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
))
...
@@ -332,11 +332,10 @@ dch_empty_fifo(struct IsdnCardState *cs, int count)
...
@@ -332,11 +332,10 @@ dch_empty_fifo(struct IsdnCardState *cs, int count)
ptr
=
cs
->
rcvbuf
+
cs
->
rcvidx
;
ptr
=
cs
->
rcvbuf
+
cs
->
rcvidx
;
cs
->
rcvidx
+=
count
;
cs
->
rcvidx
+=
count
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
ipacx_lock
,
flags
);
cli
();
cs
->
readisacfifo
(
cs
,
ptr
,
count
);
cs
->
readisacfifo
(
cs
,
ptr
,
count
);
cs
->
writeisac
(
cs
,
IPACX_CMDRD
,
0x80
);
// RMC
cs
->
writeisac
(
cs
,
IPACX_CMDRD
,
0x80
);
// RMC
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
ipacx_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
)
{
if
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
)
{
char
*
t
=
cs
->
dlog
;
char
*
t
=
cs
->
dlog
;
...
@@ -353,7 +352,7 @@ dch_empty_fifo(struct IsdnCardState *cs, int count)
...
@@ -353,7 +352,7 @@ dch_empty_fifo(struct IsdnCardState *cs, int count)
static
void
static
void
dch_fill_fifo
(
struct
IsdnCardState
*
cs
)
dch_fill_fifo
(
struct
IsdnCardState
*
cs
)
{
{
long
flags
;
unsigned
long
flags
;
int
count
;
int
count
;
u_char
cmd
,
*
ptr
;
u_char
cmd
,
*
ptr
;
...
@@ -371,8 +370,7 @@ dch_fill_fifo(struct IsdnCardState *cs)
...
@@ -371,8 +370,7 @@ dch_fill_fifo(struct IsdnCardState *cs)
cmd
=
0x0A
;
// XTF | XME
cmd
=
0x0A
;
// XTF | XME
}
}
save_flags
(
flags
);
spin_lock_irqsave
(
&
ipacx_lock
,
flags
);
cli
();
ptr
=
cs
->
tx_skb
->
data
;
ptr
=
cs
->
tx_skb
->
data
;
skb_pull
(
cs
->
tx_skb
,
count
);
skb_pull
(
cs
->
tx_skb
,
count
);
cs
->
tx_cnt
+=
count
;
cs
->
tx_cnt
+=
count
;
...
@@ -387,7 +385,7 @@ dch_fill_fifo(struct IsdnCardState *cs)
...
@@ -387,7 +385,7 @@ dch_fill_fifo(struct IsdnCardState *cs)
init_timer
(
&
cs
->
dbusytimer
);
init_timer
(
&
cs
->
dbusytimer
);
cs
->
dbusytimer
.
expires
=
jiffies
+
((
DBUSY_TIMER_VALUE
*
HZ
)
/
1000
);
cs
->
dbusytimer
.
expires
=
jiffies
+
((
DBUSY_TIMER_VALUE
*
HZ
)
/
1000
);
add_timer
(
&
cs
->
dbusytimer
);
add_timer
(
&
cs
->
dbusytimer
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
ipacx_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
)
{
if
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
)
{
char
*
t
=
cs
->
dlog
;
char
*
t
=
cs
->
dlog
;
...
@@ -406,7 +404,7 @@ dch_int(struct IsdnCardState *cs)
...
@@ -406,7 +404,7 @@ dch_int(struct IsdnCardState *cs)
{
{
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
u_char
istad
,
rstad
;
u_char
istad
,
rstad
;
long
flags
;
unsigned
long
flags
;
int
count
;
int
count
;
istad
=
cs
->
readisac
(
cs
,
IPACX_ISTAD
);
istad
=
cs
->
readisac
(
cs
,
IPACX_ISTAD
);
...
@@ -430,8 +428,7 @@ dch_int(struct IsdnCardState *cs)
...
@@ -430,8 +428,7 @@ dch_int(struct IsdnCardState *cs)
count
&=
D_FIFO_SIZE
-
1
;
count
&=
D_FIFO_SIZE
-
1
;
if
(
count
==
0
)
count
=
D_FIFO_SIZE
;
if
(
count
==
0
)
count
=
D_FIFO_SIZE
;
dch_empty_fifo
(
cs
,
count
);
dch_empty_fifo
(
cs
,
count
);
save_flags
(
flags
);
spin_lock_irqsave
(
&
ipacx_lock
,
flags
);
cli
();
if
((
count
=
cs
->
rcvidx
)
>
0
)
{
if
((
count
=
cs
->
rcvidx
)
>
0
)
{
cs
->
rcvidx
=
0
;
cs
->
rcvidx
=
0
;
if
(
!
(
skb
=
dev_alloc_skb
(
count
)))
if
(
!
(
skb
=
dev_alloc_skb
(
count
)))
...
@@ -441,7 +438,7 @@ dch_int(struct IsdnCardState *cs)
...
@@ -441,7 +438,7 @@ dch_int(struct IsdnCardState *cs)
skb_queue_tail
(
&
cs
->
rq
,
skb
);
skb_queue_tail
(
&
cs
->
rq
,
skb
);
}
}
}
}
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
ipacx_lock
,
flags
);
}
}
cs
->
rcvidx
=
0
;
cs
->
rcvidx
=
0
;
dch_sched_event
(
cs
,
D_RCVBUFREADY
);
dch_sched_event
(
cs
,
D_RCVBUFREADY
);
...
@@ -535,20 +532,19 @@ static void
...
@@ -535,20 +532,19 @@ static void
bch_l2l1
(
struct
PStack
*
st
,
int
pr
,
void
*
arg
)
bch_l2l1
(
struct
PStack
*
st
,
int
pr
,
void
*
arg
)
{
{
struct
sk_buff
*
skb
=
arg
;
struct
sk_buff
*
skb
=
arg
;
long
flags
;
unsigned
long
flags
;
switch
(
pr
)
{
switch
(
pr
)
{
case
(
PH_DATA
|
REQUEST
):
case
(
PH_DATA
|
REQUEST
):
save_flags
(
flags
);
spin_lock_irqsave
(
&
ipacx_lock
,
flags
);
cli
();
if
(
st
->
l1
.
bcs
->
tx_skb
)
{
if
(
st
->
l1
.
bcs
->
tx_skb
)
{
skb_queue_tail
(
&
st
->
l1
.
bcs
->
squeue
,
skb
);
skb_queue_tail
(
&
st
->
l1
.
bcs
->
squeue
,
skb
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
ipacx_lock
,
flags
);
}
else
{
}
else
{
st
->
l1
.
bcs
->
tx_skb
=
skb
;
st
->
l1
.
bcs
->
tx_skb
=
skb
;
set_bit
(
BC_FLG_BUSY
,
&
st
->
l1
.
bcs
->
Flag
);
set_bit
(
BC_FLG_BUSY
,
&
st
->
l1
.
bcs
->
Flag
);
st
->
l1
.
bcs
->
hw
.
hscx
.
count
=
0
;
st
->
l1
.
bcs
->
hw
.
hscx
.
count
=
0
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
ipacx_lock
,
flags
);
bch_fill_fifo
(
st
->
l1
.
bcs
);
bch_fill_fifo
(
st
->
l1
.
bcs
);
}
}
break
;
break
;
...
@@ -604,7 +600,7 @@ bch_empty_fifo(struct BCState *bcs, int count)
...
@@ -604,7 +600,7 @@ bch_empty_fifo(struct BCState *bcs, int count)
{
{
u_char
*
ptr
,
hscx
;
u_char
*
ptr
,
hscx
;
struct
IsdnCardState
*
cs
;
struct
IsdnCardState
*
cs
;
long
flags
;
unsigned
long
flags
;
int
cnt
;
int
cnt
;
cs
=
bcs
->
cs
;
cs
=
bcs
->
cs
;
...
@@ -622,8 +618,7 @@ bch_empty_fifo(struct BCState *bcs, int count)
...
@@ -622,8 +618,7 @@ bch_empty_fifo(struct BCState *bcs, int count)
}
}
// Read data uninterruptible
// Read data uninterruptible
save_flags
(
flags
);
spin_lock_irqsave
(
&
ipacx_lock
,
flags
);
cli
();
ptr
=
bcs
->
hw
.
hscx
.
rcvbuf
+
bcs
->
hw
.
hscx
.
rcvidx
;
ptr
=
bcs
->
hw
.
hscx
.
rcvbuf
+
bcs
->
hw
.
hscx
.
rcvidx
;
cnt
=
count
;
cnt
=
count
;
while
(
cnt
--
)
*
ptr
++
=
cs
->
BC_Read_Reg
(
cs
,
hscx
,
IPACX_RFIFOB
);
while
(
cnt
--
)
*
ptr
++
=
cs
->
BC_Read_Reg
(
cs
,
hscx
,
IPACX_RFIFOB
);
...
@@ -631,7 +626,7 @@ bch_empty_fifo(struct BCState *bcs, int count)
...
@@ -631,7 +626,7 @@ bch_empty_fifo(struct BCState *bcs, int count)
ptr
=
bcs
->
hw
.
hscx
.
rcvbuf
+
bcs
->
hw
.
hscx
.
rcvidx
;
ptr
=
bcs
->
hw
.
hscx
.
rcvbuf
+
bcs
->
hw
.
hscx
.
rcvidx
;
bcs
->
hw
.
hscx
.
rcvidx
+=
count
;
bcs
->
hw
.
hscx
.
rcvidx
+=
count
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
ipacx_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
char
*
t
=
bcs
->
blog
;
char
*
t
=
bcs
->
blog
;
...
@@ -651,7 +646,7 @@ bch_fill_fifo(struct BCState *bcs)
...
@@ -651,7 +646,7 @@ bch_fill_fifo(struct BCState *bcs)
struct
IsdnCardState
*
cs
;
struct
IsdnCardState
*
cs
;
int
more
,
count
,
cnt
;
int
more
,
count
,
cnt
;
u_char
*
ptr
,
*
p
,
hscx
;
u_char
*
ptr
,
*
p
,
hscx
;
long
flags
;
unsigned
long
flags
;
cs
=
bcs
->
cs
;
cs
=
bcs
->
cs
;
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
...
@@ -670,15 +665,14 @@ bch_fill_fifo(struct BCState *bcs)
...
@@ -670,15 +665,14 @@ bch_fill_fifo(struct BCState *bcs)
}
}
cnt
=
count
;
cnt
=
count
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
ipacx_lock
,
flags
);
cli
();
p
=
ptr
=
bcs
->
tx_skb
->
data
;
p
=
ptr
=
bcs
->
tx_skb
->
data
;
skb_pull
(
bcs
->
tx_skb
,
count
);
skb_pull
(
bcs
->
tx_skb
,
count
);
bcs
->
tx_cnt
-=
count
;
bcs
->
tx_cnt
-=
count
;
bcs
->
hw
.
hscx
.
count
+=
count
;
bcs
->
hw
.
hscx
.
count
+=
count
;
while
(
cnt
--
)
cs
->
BC_Write_Reg
(
cs
,
hscx
,
IPACX_XFIFOB
,
*
p
++
);
while
(
cnt
--
)
cs
->
BC_Write_Reg
(
cs
,
hscx
,
IPACX_XFIFOB
,
*
p
++
);
cs
->
BC_Write_Reg
(
cs
,
hscx
,
IPACX_CMDRB
,
(
more
?
0x08
:
0x0a
));
cs
->
BC_Write_Reg
(
cs
,
hscx
,
IPACX_CMDRB
,
(
more
?
0x08
:
0x0a
));
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
ipacx_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
char
*
t
=
bcs
->
blog
;
char
*
t
=
bcs
->
blog
;
...
...
drivers/isdn/hisax/isac.c
View file @
7c99c33b
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#define DBUSY_TIMER_VALUE 80
#define DBUSY_TIMER_VALUE 80
#define ARCOFI_USE 1
#define ARCOFI_USE 1
static
spinlock_t
isac_lock
=
SPIN_LOCK_UNLOCKED
;
static
char
*
ISACVer
[]
__devinitdata
=
static
char
*
ISACVer
[]
__devinitdata
=
{
"2086/2186 V1.1"
,
"2085 B1"
,
"2085 B2"
,
{
"2086/2186 V1.1"
,
"2085 B1"
,
"2085 B2"
,
...
@@ -116,7 +117,7 @@ void
...
@@ -116,7 +117,7 @@ void
isac_empty_fifo
(
struct
IsdnCardState
*
cs
,
int
count
)
isac_empty_fifo
(
struct
IsdnCardState
*
cs
,
int
count
)
{
{
u_char
*
ptr
;
u_char
*
ptr
;
long
flags
;
unsigned
long
flags
;
if
((
cs
->
debug
&
L1_DEB_ISAC
)
&&
!
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
))
if
((
cs
->
debug
&
L1_DEB_ISAC
)
&&
!
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
))
debugl1
(
cs
,
"isac_empty_fifo"
);
debugl1
(
cs
,
"isac_empty_fifo"
);
...
@@ -131,11 +132,10 @@ isac_empty_fifo(struct IsdnCardState *cs, int count)
...
@@ -131,11 +132,10 @@ isac_empty_fifo(struct IsdnCardState *cs, int count)
}
}
ptr
=
cs
->
rcvbuf
+
cs
->
rcvidx
;
ptr
=
cs
->
rcvbuf
+
cs
->
rcvidx
;
cs
->
rcvidx
+=
count
;
cs
->
rcvidx
+=
count
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
isac_lock
,
flags
);
cli
();
cs
->
readisacfifo
(
cs
,
ptr
,
count
);
cs
->
readisacfifo
(
cs
,
ptr
,
count
);
cs
->
writeisac
(
cs
,
ISAC_CMDR
,
0x80
);
cs
->
writeisac
(
cs
,
ISAC_CMDR
,
0x80
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
isac_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
)
{
if
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
)
{
char
*
t
=
cs
->
dlog
;
char
*
t
=
cs
->
dlog
;
...
@@ -150,7 +150,7 @@ isac_fill_fifo(struct IsdnCardState *cs)
...
@@ -150,7 +150,7 @@ isac_fill_fifo(struct IsdnCardState *cs)
{
{
int
count
,
more
;
int
count
,
more
;
u_char
*
ptr
;
u_char
*
ptr
;
long
flags
;
unsigned
long
flags
;
if
((
cs
->
debug
&
L1_DEB_ISAC
)
&&
!
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
))
if
((
cs
->
debug
&
L1_DEB_ISAC
)
&&
!
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
))
debugl1
(
cs
,
"isac_fill_fifo"
);
debugl1
(
cs
,
"isac_fill_fifo"
);
...
@@ -167,8 +167,7 @@ isac_fill_fifo(struct IsdnCardState *cs)
...
@@ -167,8 +167,7 @@ isac_fill_fifo(struct IsdnCardState *cs)
more
=
!
0
;
more
=
!
0
;
count
=
32
;
count
=
32
;
}
}
save_flags
(
flags
);
spin_lock_irqsave
(
&
isac_lock
,
flags
);
cli
();
ptr
=
cs
->
tx_skb
->
data
;
ptr
=
cs
->
tx_skb
->
data
;
skb_pull
(
cs
->
tx_skb
,
count
);
skb_pull
(
cs
->
tx_skb
,
count
);
cs
->
tx_cnt
+=
count
;
cs
->
tx_cnt
+=
count
;
...
@@ -181,7 +180,7 @@ isac_fill_fifo(struct IsdnCardState *cs)
...
@@ -181,7 +180,7 @@ isac_fill_fifo(struct IsdnCardState *cs)
init_timer
(
&
cs
->
dbusytimer
);
init_timer
(
&
cs
->
dbusytimer
);
cs
->
dbusytimer
.
expires
=
jiffies
+
((
DBUSY_TIMER_VALUE
*
HZ
)
/
1000
);
cs
->
dbusytimer
.
expires
=
jiffies
+
((
DBUSY_TIMER_VALUE
*
HZ
)
/
1000
);
add_timer
(
&
cs
->
dbusytimer
);
add_timer
(
&
cs
->
dbusytimer
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
isac_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
)
{
if
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
)
{
char
*
t
=
cs
->
dlog
;
char
*
t
=
cs
->
dlog
;
...
@@ -204,7 +203,7 @@ isac_interrupt(struct IsdnCardState *cs, u_char val)
...
@@ -204,7 +203,7 @@ isac_interrupt(struct IsdnCardState *cs, u_char val)
u_char
exval
,
v1
;
u_char
exval
,
v1
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
unsigned
int
count
;
unsigned
int
count
;
long
flags
;
unsigned
long
flags
;
if
(
cs
->
debug
&
L1_DEB_ISAC
)
if
(
cs
->
debug
&
L1_DEB_ISAC
)
debugl1
(
cs
,
"ISAC interrupt %x"
,
val
);
debugl1
(
cs
,
"ISAC interrupt %x"
,
val
);
...
@@ -231,8 +230,7 @@ isac_interrupt(struct IsdnCardState *cs, u_char val)
...
@@ -231,8 +230,7 @@ isac_interrupt(struct IsdnCardState *cs, u_char val)
if
(
count
==
0
)
if
(
count
==
0
)
count
=
32
;
count
=
32
;
isac_empty_fifo
(
cs
,
count
);
isac_empty_fifo
(
cs
,
count
);
save_flags
(
flags
);
spin_lock_irqsave
(
&
isac_lock
,
flags
);
cli
();
if
((
count
=
cs
->
rcvidx
)
>
0
)
{
if
((
count
=
cs
->
rcvidx
)
>
0
)
{
cs
->
rcvidx
=
0
;
cs
->
rcvidx
=
0
;
if
(
!
(
skb
=
alloc_skb
(
count
,
GFP_ATOMIC
)))
if
(
!
(
skb
=
alloc_skb
(
count
,
GFP_ATOMIC
)))
...
@@ -242,7 +240,7 @@ isac_interrupt(struct IsdnCardState *cs, u_char val)
...
@@ -242,7 +240,7 @@ isac_interrupt(struct IsdnCardState *cs, u_char val)
skb_queue_tail
(
&
cs
->
rq
,
skb
);
skb_queue_tail
(
&
cs
->
rq
,
skb
);
}
}
}
}
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
isac_lock
,
flags
);
}
}
cs
->
rcvidx
=
0
;
cs
->
rcvidx
=
0
;
isac_sched_event
(
cs
,
D_RCVBUFREADY
);
isac_sched_event
(
cs
,
D_RCVBUFREADY
);
...
...
drivers/isdn/hisax/isar.c
View file @
7c99c33b
...
@@ -28,7 +28,7 @@ const u_char faxmodulation[] = {3,24,48,72,73,74,96,97,98,121,122,145,146};
...
@@ -28,7 +28,7 @@ const u_char faxmodulation[] = {3,24,48,72,73,74,96,97,98,121,122,145,146};
void
isar_setup
(
struct
IsdnCardState
*
cs
);
void
isar_setup
(
struct
IsdnCardState
*
cs
);
static
void
isar_pump_cmd
(
struct
BCState
*
bcs
,
u_char
cmd
,
u_char
para
);
static
void
isar_pump_cmd
(
struct
BCState
*
bcs
,
u_char
cmd
,
u_char
para
);
static
inline
void
ll_deliver_faxstat
(
struct
BCState
*
bcs
,
u_char
status
);
static
inline
void
ll_deliver_faxstat
(
struct
BCState
*
bcs
,
u_char
status
);
static
spinlock_t
isar_lock
=
SPIN_LOCK_UNLOCKED
;
static
inline
int
static
inline
int
waitforHIA
(
struct
IsdnCardState
*
cs
,
int
timeout
)
waitforHIA
(
struct
IsdnCardState
*
cs
,
int
timeout
)
{
{
...
@@ -47,7 +47,7 @@ int
...
@@ -47,7 +47,7 @@ int
sendmsg
(
struct
IsdnCardState
*
cs
,
u_char
his
,
u_char
creg
,
u_char
len
,
sendmsg
(
struct
IsdnCardState
*
cs
,
u_char
his
,
u_char
creg
,
u_char
len
,
u_char
*
msg
)
u_char
*
msg
)
{
{
long
flags
;
unsigned
long
flags
;
int
i
;
int
i
;
if
(
!
waitforHIA
(
cs
,
4000
))
if
(
!
waitforHIA
(
cs
,
4000
))
...
@@ -56,8 +56,7 @@ sendmsg(struct IsdnCardState *cs, u_char his, u_char creg, u_char len,
...
@@ -56,8 +56,7 @@ sendmsg(struct IsdnCardState *cs, u_char his, u_char creg, u_char len,
if
(
cs
->
debug
&
L1_DEB_HSCX
)
if
(
cs
->
debug
&
L1_DEB_HSCX
)
debugl1
(
cs
,
"sendmsg(%02x,%02x,%d)"
,
his
,
creg
,
len
);
debugl1
(
cs
,
"sendmsg(%02x,%02x,%d)"
,
his
,
creg
,
len
);
#endif
#endif
save_flags
(
flags
);
spin_lock_irqsave
(
&
isar_lock
,
flags
);
cli
();
cs
->
BC_Write_Reg
(
cs
,
0
,
ISAR_CTRL_H
,
creg
);
cs
->
BC_Write_Reg
(
cs
,
0
,
ISAR_CTRL_H
,
creg
);
cs
->
BC_Write_Reg
(
cs
,
0
,
ISAR_CTRL_L
,
len
);
cs
->
BC_Write_Reg
(
cs
,
0
,
ISAR_CTRL_L
,
len
);
cs
->
BC_Write_Reg
(
cs
,
0
,
ISAR_WADR
,
0
);
cs
->
BC_Write_Reg
(
cs
,
0
,
ISAR_WADR
,
0
);
...
@@ -81,7 +80,7 @@ sendmsg(struct IsdnCardState *cs, u_char his, u_char creg, u_char len,
...
@@ -81,7 +80,7 @@ sendmsg(struct IsdnCardState *cs, u_char his, u_char creg, u_char len,
#endif
#endif
}
}
cs
->
BC_Write_Reg
(
cs
,
1
,
ISAR_HIS
,
his
);
cs
->
BC_Write_Reg
(
cs
,
1
,
ISAR_HIS
,
his
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
isar_lock
,
flags
);
waitforHIA
(
cs
,
10000
);
waitforHIA
(
cs
,
10000
);
return
(
1
);
return
(
1
);
}
}
...
@@ -134,7 +133,7 @@ waitrecmsg(struct IsdnCardState *cs, u_char *len,
...
@@ -134,7 +133,7 @@ waitrecmsg(struct IsdnCardState *cs, u_char *len,
u_char
*
msg
,
int
maxdelay
)
u_char
*
msg
,
int
maxdelay
)
{
{
int
timeout
=
0
;
int
timeout
=
0
;
long
flags
;
unsigned
long
flags
;
struct
isar_reg
*
ir
=
cs
->
bcs
[
0
].
hw
.
isar
.
reg
;
struct
isar_reg
*
ir
=
cs
->
bcs
[
0
].
hw
.
isar
.
reg
;
...
@@ -145,12 +144,11 @@ waitrecmsg(struct IsdnCardState *cs, u_char *len,
...
@@ -145,12 +144,11 @@ waitrecmsg(struct IsdnCardState *cs, u_char *len,
printk
(
KERN_WARNING
"isar recmsg IRQSTA timeout
\n
"
);
printk
(
KERN_WARNING
"isar recmsg IRQSTA timeout
\n
"
);
return
(
0
);
return
(
0
);
}
}
save_flags
(
flags
);
spin_lock_irqsave
(
&
isar_lock
,
flags
);
cli
();
get_irq_infos
(
cs
,
ir
);
get_irq_infos
(
cs
,
ir
);
rcv_mbox
(
cs
,
ir
,
msg
);
rcv_mbox
(
cs
,
ir
,
msg
);
*
len
=
ir
->
clsb
;
*
len
=
ir
->
clsb
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
isar_lock
,
flags
);
return
(
1
);
return
(
1
);
}
}
...
@@ -192,7 +190,7 @@ isar_load_firmware(struct IsdnCardState *cs, u_char *buf)
...
@@ -192,7 +190,7 @@ isar_load_firmware(struct IsdnCardState *cs, u_char *buf)
u_short
sadr
,
left
,
*
sp
;
u_short
sadr
,
left
,
*
sp
;
u_char
*
p
=
buf
;
u_char
*
p
=
buf
;
u_char
*
msg
,
*
tmpmsg
,
*
mp
,
tmp
[
64
];
u_char
*
msg
,
*
tmpmsg
,
*
mp
,
tmp
[
64
];
long
flags
;
unsigned
long
flags
;
struct
isar_reg
*
ireg
=
cs
->
bcs
[
0
].
hw
.
isar
.
reg
;
struct
isar_reg
*
ireg
=
cs
->
bcs
[
0
].
hw
.
isar
.
reg
;
struct
{
u_short
sadr
;
struct
{
u_short
sadr
;
...
@@ -346,8 +344,7 @@ isar_load_firmware(struct IsdnCardState *cs, u_char *buf)
...
@@ -346,8 +344,7 @@ isar_load_firmware(struct IsdnCardState *cs, u_char *buf)
/* NORMAL mode entered */
/* NORMAL mode entered */
/* Enable IRQs of ISAR */
/* Enable IRQs of ISAR */
cs
->
BC_Write_Reg
(
cs
,
0
,
ISAR_IRQBIT
,
ISAR_IRQSTA
);
cs
->
BC_Write_Reg
(
cs
,
0
,
ISAR_IRQBIT
,
ISAR_IRQSTA
);
save_flags
(
flags
);
spin_lock_irqsave
(
&
isar_lock
,
flags
);
sti
();
cnt
=
1000
;
/* max 1s */
cnt
=
1000
;
/* max 1s */
while
((
!
ireg
->
bstat
)
&&
cnt
)
{
while
((
!
ireg
->
bstat
)
&&
cnt
)
{
udelay
(
1000
);
udelay
(
1000
);
...
@@ -415,7 +412,7 @@ isar_load_firmware(struct IsdnCardState *cs, u_char *buf)
...
@@ -415,7 +412,7 @@ isar_load_firmware(struct IsdnCardState *cs, u_char *buf)
isar_setup
(
cs
);
isar_setup
(
cs
);
ret
=
0
;
ret
=
0
;
reterrflg:
reterrflg:
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
isar_lock
,
flags
);
reterror:
reterror:
cs
->
debug
=
debug
;
cs
->
debug
=
debug
;
if
(
ret
)
if
(
ret
)
...
@@ -669,7 +666,7 @@ isar_fill_fifo(struct BCState *bcs)
...
@@ -669,7 +666,7 @@ isar_fill_fifo(struct BCState *bcs)
int
count
;
int
count
;
u_char
msb
;
u_char
msb
;
u_char
*
ptr
;
u_char
*
ptr
;
long
flags
;
unsigned
long
flags
;
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
debugl1
(
cs
,
"isar_fill_fifo"
);
debugl1
(
cs
,
"isar_fill_fifo"
);
...
@@ -687,8 +684,7 @@ isar_fill_fifo(struct BCState *bcs)
...
@@ -687,8 +684,7 @@ isar_fill_fifo(struct BCState *bcs)
count
=
bcs
->
tx_skb
->
len
;
count
=
bcs
->
tx_skb
->
len
;
msb
=
HDLC_FED
;
msb
=
HDLC_FED
;
}
}
save_flags
(
flags
);
spin_lock_irqsave
(
&
isar_lock
,
flags
);
cli
();
ptr
=
bcs
->
tx_skb
->
data
;
ptr
=
bcs
->
tx_skb
->
data
;
if
(
!
bcs
->
hw
.
isar
.
txcnt
)
{
if
(
!
bcs
->
hw
.
isar
.
txcnt
)
{
msb
|=
HDLC_FST
;
msb
|=
HDLC_FST
;
...
@@ -739,7 +735,7 @@ isar_fill_fifo(struct BCState *bcs)
...
@@ -739,7 +735,7 @@ isar_fill_fifo(struct BCState *bcs)
printk
(
KERN_ERR
"isar_fill_fifo mode(%x) error
\n
"
,
bcs
->
mode
);
printk
(
KERN_ERR
"isar_fill_fifo mode(%x) error
\n
"
,
bcs
->
mode
);
break
;
break
;
}
}
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
isar_lock
,
flags
);
}
}
inline
inline
...
@@ -1163,12 +1159,11 @@ static char debbuf[128];
...
@@ -1163,12 +1159,11 @@ static char debbuf[128];
void
void
isar_int_main
(
struct
IsdnCardState
*
cs
)
isar_int_main
(
struct
IsdnCardState
*
cs
)
{
{
long
flags
;
unsigned
long
flags
;
struct
isar_reg
*
ireg
=
cs
->
bcs
[
0
].
hw
.
isar
.
reg
;
struct
isar_reg
*
ireg
=
cs
->
bcs
[
0
].
hw
.
isar
.
reg
;
struct
BCState
*
bcs
;
struct
BCState
*
bcs
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
isar_lock
,
flags
);
cli
();
get_irq_infos
(
cs
,
ireg
);
get_irq_infos
(
cs
,
ireg
);
switch
(
ireg
->
iis
&
ISAR_IIS_MSCMSD
)
{
switch
(
ireg
->
iis
&
ISAR_IIS_MSCMSD
)
{
case
ISAR_IIS_RDATA
:
case
ISAR_IIS_RDATA
:
...
@@ -1254,7 +1249,7 @@ isar_int_main(struct IsdnCardState *cs)
...
@@ -1254,7 +1249,7 @@ isar_int_main(struct IsdnCardState *cs)
ireg
->
iis
,
ireg
->
cmsb
,
ireg
->
clsb
);
ireg
->
iis
,
ireg
->
cmsb
,
ireg
->
clsb
);
break
;
break
;
}
}
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
isar_lock
,
flags
);
}
}
static
void
static
void
...
@@ -1568,22 +1563,21 @@ void
...
@@ -1568,22 +1563,21 @@ void
isar_l2l1
(
struct
PStack
*
st
,
int
pr
,
void
*
arg
)
isar_l2l1
(
struct
PStack
*
st
,
int
pr
,
void
*
arg
)
{
{
struct
sk_buff
*
skb
=
arg
;
struct
sk_buff
*
skb
=
arg
;
long
flags
;
unsigned
long
flags
;
switch
(
pr
)
{
switch
(
pr
)
{
case
(
PH_DATA
|
REQUEST
):
case
(
PH_DATA
|
REQUEST
):
save_flags
(
flags
);
spin_lock_irqsave
(
&
isar_lock
,
flags
);
cli
();
if
(
st
->
l1
.
bcs
->
tx_skb
)
{
if
(
st
->
l1
.
bcs
->
tx_skb
)
{
skb_queue_tail
(
&
st
->
l1
.
bcs
->
squeue
,
skb
);
skb_queue_tail
(
&
st
->
l1
.
bcs
->
squeue
,
skb
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
isar_lock
,
flags
);
}
else
{
}
else
{
st
->
l1
.
bcs
->
tx_skb
=
skb
;
st
->
l1
.
bcs
->
tx_skb
=
skb
;
test_and_set_bit
(
BC_FLG_BUSY
,
&
st
->
l1
.
bcs
->
Flag
);
test_and_set_bit
(
BC_FLG_BUSY
,
&
st
->
l1
.
bcs
->
Flag
);
if
(
st
->
l1
.
bcs
->
cs
->
debug
&
L1_DEB_HSCX
)
if
(
st
->
l1
.
bcs
->
cs
->
debug
&
L1_DEB_HSCX
)
debugl1
(
st
->
l1
.
bcs
->
cs
,
"DRQ set BC_FLG_BUSY"
);
debugl1
(
st
->
l1
.
bcs
->
cs
,
"DRQ set BC_FLG_BUSY"
);
st
->
l1
.
bcs
->
hw
.
isar
.
txcnt
=
0
;
st
->
l1
.
bcs
->
hw
.
isar
.
txcnt
=
0
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
isar_lock
,
flags
);
st
->
l1
.
bcs
->
cs
->
BC_Send_Data
(
st
->
l1
.
bcs
);
st
->
l1
.
bcs
->
cs
->
BC_Send_Data
(
st
->
l1
.
bcs
);
}
}
break
;
break
;
...
...
drivers/isdn/hisax/isdnl2.c
View file @
7c99c33b
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
#include "isdnl2.h"
#include "isdnl2.h"
const
char
*
l2_revision
=
"$Revision: 2.25.6.4 $"
;
const
char
*
l2_revision
=
"$Revision: 2.25.6.4 $"
;
static
spinlock_t
isdnl2_lock
=
SPIN_LOCK_UNLOCKED
;
static
void
l2m_debug
(
struct
FsmInst
*
fi
,
char
*
fmt
,
...);
static
void
l2m_debug
(
struct
FsmInst
*
fi
,
char
*
fmt
,
...);
static
struct
Fsm
l2fsm
;
static
struct
Fsm
l2fsm
;
...
@@ -1256,7 +1256,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg)
...
@@ -1256,7 +1256,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg)
u_char
header
[
MAX_HEADER_LEN
];
u_char
header
[
MAX_HEADER_LEN
];
int
i
;
int
i
;
int
unsigned
p1
;
int
unsigned
p1
;
long
flags
;
unsigned
long
flags
;
if
(
!
cansend
(
st
))
if
(
!
cansend
(
st
))
return
;
return
;
...
@@ -1265,8 +1265,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg)
...
@@ -1265,8 +1265,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg)
if
(
!
skb
)
if
(
!
skb
)
return
;
return
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
isdnl2_lock
,
flags
);
cli
();
if
(
test_bit
(
FLG_MOD128
,
&
l2
->
flag
))
if
(
test_bit
(
FLG_MOD128
,
&
l2
->
flag
))
p1
=
(
l2
->
vs
-
l2
->
va
)
%
128
;
p1
=
(
l2
->
vs
-
l2
->
va
)
%
128
;
else
else
...
@@ -1289,7 +1288,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg)
...
@@ -1289,7 +1288,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg)
header
[
i
++
]
=
(
l2
->
vr
<<
5
)
|
(
l2
->
vs
<<
1
);
header
[
i
++
]
=
(
l2
->
vr
<<
5
)
|
(
l2
->
vs
<<
1
);
l2
->
vs
=
(
l2
->
vs
+
1
)
%
8
;
l2
->
vs
=
(
l2
->
vs
+
1
)
%
8
;
}
}
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
isdnl2_lock
,
flags
);
p1
=
skb
->
data
-
skb
->
head
;
p1
=
skb
->
data
-
skb
->
head
;
if
(
p1
>=
i
)
if
(
p1
>=
i
)
...
...
drivers/isdn/hisax/isurf.c
View file @
7c99c33b
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
static
const
char
*
ISurf_revision
=
"$Revision: 1.10.6.2 $"
;
static
const
char
*
ISurf_revision
=
"$Revision: 1.10.6.2 $"
;
static
spinlock_t
isurf_lock
=
SPIN_LOCK_UNLOCKED
;
#define byteout(addr,val) outb(val,addr)
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
#define bytein(addr) inb(addr)
...
...
drivers/isdn/hisax/ix1_micro.c
View file @
7c99c33b
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
const
char
*
ix1_revision
=
"$Revision: 2.10.6.2 $"
;
const
char
*
ix1_revision
=
"$Revision: 2.10.6.2 $"
;
static
spinlock_t
ix1_micro_lock
=
SPIN_LOCK_UNLOCKED
;
#define byteout(addr,val) outb(val,addr)
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
#define bytein(addr) inb(addr)
...
@@ -43,13 +44,12 @@ static inline u_char
...
@@ -43,13 +44,12 @@ static inline u_char
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
{
{
register
u_char
ret
;
register
u_char
ret
;
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
ix1_micro_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
ret
=
bytein
(
adr
);
ret
=
bytein
(
adr
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
ix1_micro_lock
,
flags
);
return
(
ret
);
return
(
ret
);
}
}
...
@@ -66,13 +66,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
...
@@ -66,13 +66,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
static
inline
void
static
inline
void
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
ix1_micro_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
byteout
(
adr
,
data
);
byteout
(
adr
,
data
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
ix1_micro_lock
,
flags
);
}
}
static
inline
void
static
inline
void
...
@@ -184,19 +183,18 @@ release_io_ix1micro(struct IsdnCardState *cs)
...
@@ -184,19 +183,18 @@ release_io_ix1micro(struct IsdnCardState *cs)
static
void
static
void
ix1_reset
(
struct
IsdnCardState
*
cs
)
ix1_reset
(
struct
IsdnCardState
*
cs
)
{
{
long
flags
;
unsigned
long
flags
;
int
cnt
;
int
cnt
;
/* reset isac */
/* reset isac */
s
ave_flags
(
flags
);
s
pin_lock_irqsave
(
&
ix1_micro_lock
,
flags
);
cnt
=
3
*
(
HZ
/
10
)
+
1
;
cnt
=
3
*
(
HZ
/
10
)
+
1
;
sti
();
while
(
cnt
--
)
{
while
(
cnt
--
)
{
byteout
(
cs
->
hw
.
ix1
.
cfg_reg
+
SPECIAL_PORT_OFFSET
,
1
);
byteout
(
cs
->
hw
.
ix1
.
cfg_reg
+
SPECIAL_PORT_OFFSET
,
1
);
HZDELAY
(
1
);
/* wait >=10 ms */
HZDELAY
(
1
);
/* wait >=10 ms */
}
}
byteout
(
cs
->
hw
.
ix1
.
cfg_reg
+
SPECIAL_PORT_OFFSET
,
0
);
byteout
(
cs
->
hw
.
ix1
.
cfg_reg
+
SPECIAL_PORT_OFFSET
,
0
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
ix1_micro_lock
,
flags
);
}
}
static
int
static
int
...
...
drivers/isdn/hisax/jade.c
View file @
7c99c33b
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#include "isdnl1.h"
#include "isdnl1.h"
#include <linux/interrupt.h>
#include <linux/interrupt.h>
static
spinlock_t
jade_lock
=
SPIN_LOCK_UNLOCKED
;
int
__init
int
__init
JadeVersion
(
struct
IsdnCardState
*
cs
,
char
*
s
)
JadeVersion
(
struct
IsdnCardState
*
cs
,
char
*
s
)
...
@@ -50,10 +51,9 @@ static void
...
@@ -50,10 +51,9 @@ static void
jade_write_indirect
(
struct
IsdnCardState
*
cs
,
u_char
reg
,
u_char
value
)
jade_write_indirect
(
struct
IsdnCardState
*
cs
,
u_char
reg
,
u_char
value
)
{
{
int
to
=
50
;
int
to
=
50
;
long
flags
;
unsigned
long
flags
;
u_char
ret
;
u_char
ret
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
jade_lock
,
flags
);
cli
();
/* Write the data */
/* Write the data */
cs
->
BC_Write_Reg
(
cs
,
-
1
,
COMM_JADE
+
1
,
value
);
cs
->
BC_Write_Reg
(
cs
,
-
1
,
COMM_JADE
+
1
,
value
);
/* Say JADE we wanna write indirect reg 'reg' */
/* Say JADE we wanna write indirect reg 'reg' */
...
@@ -68,12 +68,12 @@ jade_write_indirect(struct IsdnCardState *cs, u_char reg, u_char value)
...
@@ -68,12 +68,12 @@ jade_write_indirect(struct IsdnCardState *cs, u_char reg, u_char value)
/* Got acknowledge */
/* Got acknowledge */
break
;
break
;
if
(
!
to
)
{
if
(
!
to
)
{
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
jade_lock
,
flags
);
printk
(
KERN_INFO
"Can not see ready bit from JADE DSP (reg=0x%X, value=0x%X)
\n
"
,
reg
,
value
);
printk
(
KERN_INFO
"Can not see ready bit from JADE DSP (reg=0x%X, value=0x%X)
\n
"
,
reg
,
value
);
return
;
return
;
}
}
}
}
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
jade_lock
,
flags
);
}
}
...
@@ -145,20 +145,19 @@ static void
...
@@ -145,20 +145,19 @@ static void
jade_l2l1
(
struct
PStack
*
st
,
int
pr
,
void
*
arg
)
jade_l2l1
(
struct
PStack
*
st
,
int
pr
,
void
*
arg
)
{
{
struct
sk_buff
*
skb
=
arg
;
struct
sk_buff
*
skb
=
arg
;
long
flags
;
unsigned
long
flags
;
switch
(
pr
)
{
switch
(
pr
)
{
case
(
PH_DATA
|
REQUEST
):
case
(
PH_DATA
|
REQUEST
):
save_flags
(
flags
);
spin_lock_irqsave
(
&
jade_lock
,
flags
);
cli
();
if
(
st
->
l1
.
bcs
->
tx_skb
)
{
if
(
st
->
l1
.
bcs
->
tx_skb
)
{
skb_queue_tail
(
&
st
->
l1
.
bcs
->
squeue
,
skb
);
skb_queue_tail
(
&
st
->
l1
.
bcs
->
squeue
,
skb
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
jade_lock
,
flags
);
}
else
{
}
else
{
st
->
l1
.
bcs
->
tx_skb
=
skb
;
st
->
l1
.
bcs
->
tx_skb
=
skb
;
test_and_set_bit
(
BC_FLG_BUSY
,
&
st
->
l1
.
bcs
->
Flag
);
test_and_set_bit
(
BC_FLG_BUSY
,
&
st
->
l1
.
bcs
->
Flag
);
st
->
l1
.
bcs
->
hw
.
hscx
.
count
=
0
;
st
->
l1
.
bcs
->
hw
.
hscx
.
count
=
0
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
jade_lock
,
flags
);
st
->
l1
.
bcs
->
cs
->
BC_Send_Data
(
st
->
l1
.
bcs
);
st
->
l1
.
bcs
->
cs
->
BC_Send_Data
(
st
->
l1
.
bcs
);
}
}
break
;
break
;
...
...
drivers/isdn/hisax/jade_irq.c
View file @
7c99c33b
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
* of the GNU General Public License, incorporated herein by reference.
* of the GNU General Public License, incorporated herein by reference.
*
*
*/
*/
static
spinlock_t
jade_irq_lock
=
SPIN_LOCK_UNLOCKED
;
static
inline
void
static
inline
void
waitforCEC
(
struct
IsdnCardState
*
cs
,
int
jade
,
int
reg
)
waitforCEC
(
struct
IsdnCardState
*
cs
,
int
jade
,
int
reg
)
...
@@ -33,13 +34,12 @@ waitforXFW(struct IsdnCardState *cs, int jade)
...
@@ -33,13 +34,12 @@ waitforXFW(struct IsdnCardState *cs, int jade)
static
inline
void
static
inline
void
WriteJADECMDR
(
struct
IsdnCardState
*
cs
,
int
jade
,
int
reg
,
u_char
data
)
WriteJADECMDR
(
struct
IsdnCardState
*
cs
,
int
jade
,
int
reg
,
u_char
data
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
jade_irq_lock
,
flags
);
cli
();
waitforCEC
(
cs
,
jade
,
reg
);
waitforCEC
(
cs
,
jade
,
reg
);
WRITEJADE
(
cs
,
jade
,
reg
,
data
);
WRITEJADE
(
cs
,
jade
,
reg
,
data
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
jade_irq_lock
,
flags
);
}
}
...
@@ -49,7 +49,7 @@ jade_empty_fifo(struct BCState *bcs, int count)
...
@@ -49,7 +49,7 @@ jade_empty_fifo(struct BCState *bcs, int count)
{
{
u_char
*
ptr
;
u_char
*
ptr
;
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
long
flags
;
unsigned
long
flags
;
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
debugl1
(
cs
,
"jade_empty_fifo"
);
debugl1
(
cs
,
"jade_empty_fifo"
);
...
@@ -63,11 +63,10 @@ jade_empty_fifo(struct BCState *bcs, int count)
...
@@ -63,11 +63,10 @@ jade_empty_fifo(struct BCState *bcs, int count)
}
}
ptr
=
bcs
->
hw
.
hscx
.
rcvbuf
+
bcs
->
hw
.
hscx
.
rcvidx
;
ptr
=
bcs
->
hw
.
hscx
.
rcvbuf
+
bcs
->
hw
.
hscx
.
rcvidx
;
bcs
->
hw
.
hscx
.
rcvidx
+=
count
;
bcs
->
hw
.
hscx
.
rcvidx
+=
count
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
jade_irq_lock
,
flags
);
cli
();
READJADEFIFO
(
cs
,
bcs
->
hw
.
hscx
.
hscx
,
ptr
,
count
);
READJADEFIFO
(
cs
,
bcs
->
hw
.
hscx
.
hscx
,
ptr
,
count
);
WriteJADECMDR
(
cs
,
bcs
->
hw
.
hscx
.
hscx
,
jade_HDLC_RCMD
,
jadeRCMD_RMC
);
WriteJADECMDR
(
cs
,
bcs
->
hw
.
hscx
.
hscx
,
jade_HDLC_RCMD
,
jadeRCMD_RMC
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
jade_irq_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
char
*
t
=
bcs
->
blog
;
char
*
t
=
bcs
->
blog
;
...
@@ -85,7 +84,7 @@ jade_fill_fifo(struct BCState *bcs)
...
@@ -85,7 +84,7 @@ jade_fill_fifo(struct BCState *bcs)
int
more
,
count
;
int
more
,
count
;
int
fifo_size
=
32
;
int
fifo_size
=
32
;
u_char
*
ptr
;
u_char
*
ptr
;
long
flags
;
unsigned
long
flags
;
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
debugl1
(
cs
,
"jade_fill_fifo"
);
debugl1
(
cs
,
"jade_fill_fifo"
);
...
@@ -103,15 +102,14 @@ jade_fill_fifo(struct BCState *bcs)
...
@@ -103,15 +102,14 @@ jade_fill_fifo(struct BCState *bcs)
count
=
bcs
->
tx_skb
->
len
;
count
=
bcs
->
tx_skb
->
len
;
waitforXFW
(
cs
,
bcs
->
hw
.
hscx
.
hscx
);
waitforXFW
(
cs
,
bcs
->
hw
.
hscx
.
hscx
);
save_flags
(
flags
);
spin_lock_irqsave
(
&
jade_irq_lock
,
flags
);
cli
();
ptr
=
bcs
->
tx_skb
->
data
;
ptr
=
bcs
->
tx_skb
->
data
;
skb_pull
(
bcs
->
tx_skb
,
count
);
skb_pull
(
bcs
->
tx_skb
,
count
);
bcs
->
tx_cnt
-=
count
;
bcs
->
tx_cnt
-=
count
;
bcs
->
hw
.
hscx
.
count
+=
count
;
bcs
->
hw
.
hscx
.
count
+=
count
;
WRITEJADEFIFO
(
cs
,
bcs
->
hw
.
hscx
.
hscx
,
ptr
,
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
));
WriteJADECMDR
(
cs
,
bcs
->
hw
.
hscx
.
hscx
,
jade_HDLC_XCMD
,
more
?
jadeXCMD_XF
:
(
jadeXCMD_XF
|
jadeXCMD_XME
));
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
jade_irq_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
char
*
t
=
bcs
->
blog
;
char
*
t
=
bcs
->
blog
;
...
...
drivers/isdn/hisax/l3dss1.c
View file @
7c99c33b
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
extern
char
*
HiSax_getrev
(
const
char
*
revision
);
extern
char
*
HiSax_getrev
(
const
char
*
revision
);
const
char
*
dss1_revision
=
"$Revision: 2.30.6.2 $"
;
const
char
*
dss1_revision
=
"$Revision: 2.30.6.2 $"
;
static
spinlock_t
l3dss1_lock
=
SPIN_LOCK_UNLOCKED
;
#define EXT_BEARER_CAPS 1
#define EXT_BEARER_CAPS 1
...
@@ -53,8 +54,7 @@ static unsigned char new_invoke_id(struct PStack *p)
...
@@ -53,8 +54,7 @@ static unsigned char new_invoke_id(struct PStack *p)
i
=
32
;
/* maximum search depth */
i
=
32
;
/* maximum search depth */
save_flags
(
flags
);
spin_lock_irqsave
(
&
l3dss1_lock
,
flags
);
cli
();
retval
=
p
->
prot
.
dss1
.
last_invoke_id
+
1
;
/* try new id */
retval
=
p
->
prot
.
dss1
.
last_invoke_id
+
1
;
/* try new id */
while
((
i
)
&&
(
p
->
prot
.
dss1
.
invoke_used
[
retval
>>
3
]
==
0xFF
))
{
while
((
i
)
&&
(
p
->
prot
.
dss1
.
invoke_used
[
retval
>>
3
]
==
0xFF
))
{
...
@@ -68,7 +68,7 @@ static unsigned char new_invoke_id(struct PStack *p)
...
@@ -68,7 +68,7 @@ static unsigned char new_invoke_id(struct PStack *p)
retval
=
0
;
retval
=
0
;
p
->
prot
.
dss1
.
last_invoke_id
=
retval
;
p
->
prot
.
dss1
.
last_invoke_id
=
retval
;
p
->
prot
.
dss1
.
invoke_used
[
retval
>>
3
]
|=
(
1
<<
(
retval
&
7
));
p
->
prot
.
dss1
.
invoke_used
[
retval
>>
3
]
|=
(
1
<<
(
retval
&
7
));
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
l3dss1_lock
,
flags
);
return
(
retval
);
return
(
retval
);
}
/* new_invoke_id */
}
/* new_invoke_id */
...
@@ -81,10 +81,9 @@ static void free_invoke_id(struct PStack *p, unsigned char id)
...
@@ -81,10 +81,9 @@ static void free_invoke_id(struct PStack *p, unsigned char id)
if
(
!
id
)
return
;
/* 0 = invalid value */
if
(
!
id
)
return
;
/* 0 = invalid value */
save_flags
(
flags
);
spin_lock_irqsave
(
&
l3dss1_lock
,
flags
);
cli
();
p
->
prot
.
dss1
.
invoke_used
[
id
>>
3
]
&=
~
(
1
<<
(
id
&
7
));
p
->
prot
.
dss1
.
invoke_used
[
id
>>
3
]
&=
~
(
1
<<
(
id
&
7
));
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
l3dss1_lock
,
flags
);
}
/* free_invoke_id */
}
/* free_invoke_id */
...
...
drivers/isdn/hisax/l3ni1.c
View file @
7c99c33b
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
extern
char
*
HiSax_getrev
(
const
char
*
revision
);
extern
char
*
HiSax_getrev
(
const
char
*
revision
);
const
char
*
ni1_revision
=
"$Revision: 2.5.6.3 $"
;
const
char
*
ni1_revision
=
"$Revision: 2.5.6.3 $"
;
static
spinlock_t
l3ni1_lock
=
SPIN_LOCK_UNLOCKED
;
#define EXT_BEARER_CAPS 1
#define EXT_BEARER_CAPS 1
...
@@ -51,8 +52,7 @@ static unsigned char new_invoke_id(struct PStack *p)
...
@@ -51,8 +52,7 @@ static unsigned char new_invoke_id(struct PStack *p)
i
=
32
;
/* maximum search depth */
i
=
32
;
/* maximum search depth */
save_flags
(
flags
);
spin_lock_irqsave
(
&
l3ni1_lock
,
flags
);
cli
();
retval
=
p
->
prot
.
ni1
.
last_invoke_id
+
1
;
/* try new id */
retval
=
p
->
prot
.
ni1
.
last_invoke_id
+
1
;
/* try new id */
while
((
i
)
&&
(
p
->
prot
.
ni1
.
invoke_used
[
retval
>>
3
]
==
0xFF
))
{
while
((
i
)
&&
(
p
->
prot
.
ni1
.
invoke_used
[
retval
>>
3
]
==
0xFF
))
{
...
@@ -66,7 +66,7 @@ static unsigned char new_invoke_id(struct PStack *p)
...
@@ -66,7 +66,7 @@ static unsigned char new_invoke_id(struct PStack *p)
retval
=
0
;
retval
=
0
;
p
->
prot
.
ni1
.
last_invoke_id
=
retval
;
p
->
prot
.
ni1
.
last_invoke_id
=
retval
;
p
->
prot
.
ni1
.
invoke_used
[
retval
>>
3
]
|=
(
1
<<
(
retval
&
7
));
p
->
prot
.
ni1
.
invoke_used
[
retval
>>
3
]
|=
(
1
<<
(
retval
&
7
));
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
l3ni1_lock
,
flags
);
return
(
retval
);
return
(
retval
);
}
/* new_invoke_id */
}
/* new_invoke_id */
...
@@ -79,10 +79,9 @@ static void free_invoke_id(struct PStack *p, unsigned char id)
...
@@ -79,10 +79,9 @@ static void free_invoke_id(struct PStack *p, unsigned char id)
if
(
!
id
)
return
;
/* 0 = invalid value */
if
(
!
id
)
return
;
/* 0 = invalid value */
save_flags
(
flags
);
spin_lock_irqsave
(
&
l3ni1_lock
,
flags
);
cli
();
p
->
prot
.
ni1
.
invoke_used
[
id
>>
3
]
&=
~
(
1
<<
(
id
&
7
));
p
->
prot
.
ni1
.
invoke_used
[
id
>>
3
]
&=
~
(
1
<<
(
id
&
7
));
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
l3ni1_lock
,
flags
);
}
/* free_invoke_id */
}
/* free_invoke_id */
...
...
drivers/isdn/hisax/mic.c
View file @
7c99c33b
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
const
char
*
mic_revision
=
"$Revision: 1.10.6.2 $"
;
const
char
*
mic_revision
=
"$Revision: 1.10.6.2 $"
;
static
spinlock_t
mic_lock
=
SPIN_LOCK_UNLOCKED
;
#define byteout(addr,val) outb(val,addr)
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
#define bytein(addr) inb(addr)
...
@@ -34,13 +35,12 @@ static inline u_char
...
@@ -34,13 +35,12 @@ static inline u_char
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
{
{
register
u_char
ret
;
register
u_char
ret
;
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
mic_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
ret
=
bytein
(
adr
);
ret
=
bytein
(
adr
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
mic_lock
,
flags
);
return
(
ret
);
return
(
ret
);
}
}
...
@@ -58,13 +58,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
...
@@ -58,13 +58,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
static
inline
void
static
inline
void
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
mic_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
byteout
(
adr
,
data
);
byteout
(
adr
,
data
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
mic_lock
,
flags
);
}
}
static
inline
void
static
inline
void
...
...
drivers/isdn/hisax/netjet.c
View file @
7c99c33b
...
@@ -26,37 +26,36 @@
...
@@ -26,37 +26,36 @@
#include "netjet.h"
#include "netjet.h"
const
char
*
NETjet_revision
=
"$Revision: 1.24.6.6 $"
;
const
char
*
NETjet_revision
=
"$Revision: 1.24.6.6 $"
;
static
spinlock_t
netjet_lock
=
SPIN_LOCK_UNLOCKED
;
/* Interface functions */
/* Interface functions */
u_char
u_char
NETjet_ReadIC
(
struct
IsdnCardState
*
cs
,
u_char
offset
)
NETjet_ReadIC
(
struct
IsdnCardState
*
cs
,
u_char
offset
)
{
{
long
flags
;
unsigned
long
flags
;
u_char
ret
;
u_char
ret
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
netjet_lock
,
flags
);
cli
();
cs
->
hw
.
njet
.
auxd
&=
0xfc
;
cs
->
hw
.
njet
.
auxd
&=
0xfc
;
cs
->
hw
.
njet
.
auxd
|=
(
offset
>>
4
)
&
3
;
cs
->
hw
.
njet
.
auxd
|=
(
offset
>>
4
)
&
3
;
byteout
(
cs
->
hw
.
njet
.
auxa
,
cs
->
hw
.
njet
.
auxd
);
byteout
(
cs
->
hw
.
njet
.
auxa
,
cs
->
hw
.
njet
.
auxd
);
ret
=
bytein
(
cs
->
hw
.
njet
.
isac
+
((
offset
&
0xf
)
<<
2
));
ret
=
bytein
(
cs
->
hw
.
njet
.
isac
+
((
offset
&
0xf
)
<<
2
));
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
netjet_lock
,
flags
);
return
(
ret
);
return
(
ret
);
}
}
void
void
NETjet_WriteIC
(
struct
IsdnCardState
*
cs
,
u_char
offset
,
u_char
value
)
NETjet_WriteIC
(
struct
IsdnCardState
*
cs
,
u_char
offset
,
u_char
value
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
netjet_lock
,
flags
);
cli
();
cs
->
hw
.
njet
.
auxd
&=
0xfc
;
cs
->
hw
.
njet
.
auxd
&=
0xfc
;
cs
->
hw
.
njet
.
auxd
|=
(
offset
>>
4
)
&
3
;
cs
->
hw
.
njet
.
auxd
|=
(
offset
>>
4
)
&
3
;
byteout
(
cs
->
hw
.
njet
.
auxa
,
cs
->
hw
.
njet
.
auxd
);
byteout
(
cs
->
hw
.
njet
.
auxa
,
cs
->
hw
.
njet
.
auxd
);
byteout
(
cs
->
hw
.
njet
.
isac
+
((
offset
&
0xf
)
<<
2
),
value
);
byteout
(
cs
->
hw
.
njet
.
isac
+
((
offset
&
0xf
)
<<
2
),
value
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
netjet_lock
,
flags
);
}
}
void
void
...
@@ -839,19 +838,18 @@ static void
...
@@ -839,19 +838,18 @@ static void
tiger_l2l1
(
struct
PStack
*
st
,
int
pr
,
void
*
arg
)
tiger_l2l1
(
struct
PStack
*
st
,
int
pr
,
void
*
arg
)
{
{
struct
sk_buff
*
skb
=
arg
;
struct
sk_buff
*
skb
=
arg
;
long
flags
;
unsigned
long
flags
;
switch
(
pr
)
{
switch
(
pr
)
{
case
(
PH_DATA
|
REQUEST
):
case
(
PH_DATA
|
REQUEST
):
save_flags
(
flags
);
spin_lock_irqsave
(
&
netjet_lock
,
flags
);
cli
();
if
(
st
->
l1
.
bcs
->
tx_skb
)
{
if
(
st
->
l1
.
bcs
->
tx_skb
)
{
skb_queue_tail
(
&
st
->
l1
.
bcs
->
squeue
,
skb
);
skb_queue_tail
(
&
st
->
l1
.
bcs
->
squeue
,
skb
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
netjet_lock
,
flags
);
}
else
{
}
else
{
st
->
l1
.
bcs
->
tx_skb
=
skb
;
st
->
l1
.
bcs
->
tx_skb
=
skb
;
st
->
l1
.
bcs
->
cs
->
BC_Send_Data
(
st
->
l1
.
bcs
);
st
->
l1
.
bcs
->
cs
->
BC_Send_Data
(
st
->
l1
.
bcs
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
netjet_lock
,
flags
);
}
}
break
;
break
;
case
(
PH_PULL
|
INDICATION
):
case
(
PH_PULL
|
INDICATION
):
...
@@ -859,11 +857,10 @@ tiger_l2l1(struct PStack *st, int pr, void *arg)
...
@@ -859,11 +857,10 @@ tiger_l2l1(struct PStack *st, int pr, void *arg)
printk
(
KERN_WARNING
"tiger_l2l1: this shouldn't happen
\n
"
);
printk
(
KERN_WARNING
"tiger_l2l1: this shouldn't happen
\n
"
);
break
;
break
;
}
}
save_flags
(
flags
);
spin_lock_irqsave
(
&
netjet_lock
,
flags
);
cli
();
st
->
l1
.
bcs
->
tx_skb
=
skb
;
st
->
l1
.
bcs
->
tx_skb
=
skb
;
st
->
l1
.
bcs
->
cs
->
BC_Send_Data
(
st
->
l1
.
bcs
);
st
->
l1
.
bcs
->
cs
->
BC_Send_Data
(
st
->
l1
.
bcs
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
netjet_lock
,
flags
);
break
;
break
;
case
(
PH_PULL
|
REQUEST
):
case
(
PH_PULL
|
REQUEST
):
if
(
!
st
->
l1
.
bcs
->
tx_skb
)
{
if
(
!
st
->
l1
.
bcs
->
tx_skb
)
{
...
...
drivers/isdn/hisax/niccy.c
View file @
7c99c33b
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
const
char
*
niccy_revision
=
"$Revision: 1.15.6.6 $"
;
const
char
*
niccy_revision
=
"$Revision: 1.15.6.6 $"
;
static
spinlock_t
niccy_lock
=
SPIN_LOCK_UNLOCKED
;
#define byteout(addr,val) outb(val,addr)
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
#define bytein(addr) inb(addr)
...
@@ -50,13 +51,12 @@ static inline u_char
...
@@ -50,13 +51,12 @@ static inline u_char
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
{
{
register
u_char
ret
;
register
u_char
ret
;
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
niccy_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
ret
=
bytein
(
adr
);
ret
=
bytein
(
adr
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
niccy_lock
,
flags
);
return
(
ret
);
return
(
ret
);
}
}
...
@@ -73,13 +73,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
...
@@ -73,13 +73,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
static
inline
void
static
inline
void
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
niccy_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
byteout
(
adr
,
data
);
byteout
(
adr
,
data
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
niccy_lock
,
flags
);
}
}
static
inline
void
static
inline
void
...
...
drivers/isdn/hisax/nj_s.c
View file @
7c99c33b
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include "netjet.h"
#include "netjet.h"
const
char
*
NETjet_S_revision
=
"$Revision: 2.7.6.6 $"
;
const
char
*
NETjet_S_revision
=
"$Revision: 2.7.6.6 $"
;
static
spinlock_t
nj_s_lock
=
SPIN_LOCK_UNLOCKED
;
static
u_char
dummyrr
(
struct
IsdnCardState
*
cs
,
int
chan
,
u_char
off
)
static
u_char
dummyrr
(
struct
IsdnCardState
*
cs
,
int
chan
,
u_char
off
)
{
{
...
@@ -31,7 +32,7 @@ netjet_s_interrupt(int intno, void *dev_id, struct pt_regs *regs)
...
@@ -31,7 +32,7 @@ netjet_s_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
{
struct
IsdnCardState
*
cs
=
dev_id
;
struct
IsdnCardState
*
cs
=
dev_id
;
u_char
val
,
sval
;
u_char
val
,
sval
;
long
flags
;
unsigned
long
flags
;
if
(
!
cs
)
{
if
(
!
cs
)
{
printk
(
KERN_WARNING
"NETjet-S: Spurious interrupt!
\n
"
);
printk
(
KERN_WARNING
"NETjet-S: Spurious interrupt!
\n
"
);
...
@@ -48,8 +49,7 @@ netjet_s_interrupt(int intno, void *dev_id, struct pt_regs *regs)
...
@@ -48,8 +49,7 @@ netjet_s_interrupt(int intno, void *dev_id, struct pt_regs *regs)
NETjet_WriteIC
(
cs
,
ISAC_MASK
,
0x0
);
NETjet_WriteIC
(
cs
,
ISAC_MASK
,
0x0
);
}
}
}
}
save_flags
(
flags
);
spin_lock_irqsave
(
&
nj_s_lock
,
flags
);
cli
();
/* start new code 13/07/00 GE */
/* start new code 13/07/00 GE */
/* set bits in sval to indicate which page is free */
/* set bits in sval to indicate which page is free */
if
(
inl
(
cs
->
hw
.
njet
.
base
+
NETJET_DMA_WRITE_ADR
)
<
if
(
inl
(
cs
->
hw
.
njet
.
base
+
NETJET_DMA_WRITE_ADR
)
<
...
@@ -67,11 +67,11 @@ netjet_s_interrupt(int intno, void *dev_id, struct pt_regs *regs)
...
@@ -67,11 +67,11 @@ netjet_s_interrupt(int intno, void *dev_id, struct pt_regs *regs)
if
(
sval
!=
cs
->
hw
.
njet
.
last_is0
)
/* we have a DMA interrupt */
if
(
sval
!=
cs
->
hw
.
njet
.
last_is0
)
/* we have a DMA interrupt */
{
{
if
(
test_and_set_bit
(
FLG_LOCK_ATOMIC
,
&
cs
->
HW_Flags
))
{
if
(
test_and_set_bit
(
FLG_LOCK_ATOMIC
,
&
cs
->
HW_Flags
))
{
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
nj_s_lock
,
flags
);
return
;
return
;
}
}
cs
->
hw
.
njet
.
irqstat0
=
sval
;
cs
->
hw
.
njet
.
irqstat0
=
sval
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
nj_s_lock
,
flags
);
if
((
cs
->
hw
.
njet
.
irqstat0
&
NETJET_IRQM0_READ
)
!=
if
((
cs
->
hw
.
njet
.
irqstat0
&
NETJET_IRQM0_READ
)
!=
(
cs
->
hw
.
njet
.
last_is0
&
NETJET_IRQM0_READ
))
(
cs
->
hw
.
njet
.
last_is0
&
NETJET_IRQM0_READ
))
/* we have a read dma int */
/* we have a read dma int */
...
@@ -83,7 +83,7 @@ netjet_s_interrupt(int intno, void *dev_id, struct pt_regs *regs)
...
@@ -83,7 +83,7 @@ netjet_s_interrupt(int intno, void *dev_id, struct pt_regs *regs)
/* end new code 13/07/00 GE */
/* end new code 13/07/00 GE */
test_and_clear_bit
(
FLG_LOCK_ATOMIC
,
&
cs
->
HW_Flags
);
test_and_clear_bit
(
FLG_LOCK_ATOMIC
,
&
cs
->
HW_Flags
);
}
else
}
else
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
nj_s_lock
,
flags
);
/* if (!testcnt--) {
/* if (!testcnt--) {
cs->hw.njet.dmactrl = 0;
cs->hw.njet.dmactrl = 0;
...
@@ -149,7 +149,7 @@ setup_netjet_s(struct IsdnCard *card)
...
@@ -149,7 +149,7 @@ setup_netjet_s(struct IsdnCard *card)
int
bytecnt
;
int
bytecnt
;
struct
IsdnCardState
*
cs
=
card
->
cs
;
struct
IsdnCardState
*
cs
=
card
->
cs
;
char
tmp
[
64
];
char
tmp
[
64
];
long
flags
;
unsigned
long
flags
;
#ifdef __BIG_ENDIAN
#ifdef __BIG_ENDIAN
#error "not running on big endian machines now"
#error "not running on big endian machines now"
...
...
drivers/isdn/hisax/nj_u.c
View file @
7c99c33b
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include "netjet.h"
#include "netjet.h"
const
char
*
NETjet_U_revision
=
"$Revision: 2.8.6.6 $"
;
const
char
*
NETjet_U_revision
=
"$Revision: 2.8.6.6 $"
;
static
spinlock_t
nj_u_lock
=
SPIN_LOCK_UNLOCKED
;
static
u_char
dummyrr
(
struct
IsdnCardState
*
cs
,
int
chan
,
u_char
off
)
static
u_char
dummyrr
(
struct
IsdnCardState
*
cs
,
int
chan
,
u_char
off
)
{
{
...
@@ -31,7 +32,7 @@ netjet_u_interrupt(int intno, void *dev_id, struct pt_regs *regs)
...
@@ -31,7 +32,7 @@ netjet_u_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
{
struct
IsdnCardState
*
cs
=
dev_id
;
struct
IsdnCardState
*
cs
=
dev_id
;
u_char
val
,
sval
;
u_char
val
,
sval
;
long
flags
;
unsigned
long
flags
;
if
(
!
cs
)
{
if
(
!
cs
)
{
printk
(
KERN_WARNING
"NETspider-U: Spurious interrupt!
\n
"
);
printk
(
KERN_WARNING
"NETspider-U: Spurious interrupt!
\n
"
);
...
@@ -48,8 +49,7 @@ netjet_u_interrupt(int intno, void *dev_id, struct pt_regs *regs)
...
@@ -48,8 +49,7 @@ netjet_u_interrupt(int intno, void *dev_id, struct pt_regs *regs)
NETjet_WriteIC
(
cs
,
ICC_MASK
,
0x0
);
NETjet_WriteIC
(
cs
,
ICC_MASK
,
0x0
);
}
}
}
}
save_flags
(
flags
);
spin_lock_irqsave
(
&
nj_u_lock
,
flags
);
cli
();
/* start new code 13/07/00 GE */
/* start new code 13/07/00 GE */
/* set bits in sval to indicate which page is free */
/* set bits in sval to indicate which page is free */
if
(
inl
(
cs
->
hw
.
njet
.
base
+
NETJET_DMA_WRITE_ADR
)
<
if
(
inl
(
cs
->
hw
.
njet
.
base
+
NETJET_DMA_WRITE_ADR
)
<
...
@@ -67,11 +67,11 @@ netjet_u_interrupt(int intno, void *dev_id, struct pt_regs *regs)
...
@@ -67,11 +67,11 @@ netjet_u_interrupt(int intno, void *dev_id, struct pt_regs *regs)
if
(
sval
!=
cs
->
hw
.
njet
.
last_is0
)
/* we have a DMA interrupt */
if
(
sval
!=
cs
->
hw
.
njet
.
last_is0
)
/* we have a DMA interrupt */
{
{
if
(
test_and_set_bit
(
FLG_LOCK_ATOMIC
,
&
cs
->
HW_Flags
))
{
if
(
test_and_set_bit
(
FLG_LOCK_ATOMIC
,
&
cs
->
HW_Flags
))
{
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
nj_u_lock
,
flags
);
return
;
return
;
}
}
cs
->
hw
.
njet
.
irqstat0
=
sval
;
cs
->
hw
.
njet
.
irqstat0
=
sval
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
nj_u_lock
,
flags
);
if
((
cs
->
hw
.
njet
.
irqstat0
&
NETJET_IRQM0_READ
)
!=
if
((
cs
->
hw
.
njet
.
irqstat0
&
NETJET_IRQM0_READ
)
!=
(
cs
->
hw
.
njet
.
last_is0
&
NETJET_IRQM0_READ
))
(
cs
->
hw
.
njet
.
last_is0
&
NETJET_IRQM0_READ
))
/* we have a read dma int */
/* we have a read dma int */
...
@@ -83,7 +83,7 @@ netjet_u_interrupt(int intno, void *dev_id, struct pt_regs *regs)
...
@@ -83,7 +83,7 @@ netjet_u_interrupt(int intno, void *dev_id, struct pt_regs *regs)
/* end new code 13/07/00 GE */
/* end new code 13/07/00 GE */
test_and_clear_bit
(
FLG_LOCK_ATOMIC
,
&
cs
->
HW_Flags
);
test_and_clear_bit
(
FLG_LOCK_ATOMIC
,
&
cs
->
HW_Flags
);
}
else
}
else
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
nj_u_lock
,
flags
);
/* if (!testcnt--) {
/* if (!testcnt--) {
cs->hw.njet.dmactrl = 0;
cs->hw.njet.dmactrl = 0;
...
@@ -196,7 +196,6 @@ setup_netjet_u(struct IsdnCard *card)
...
@@ -196,7 +196,6 @@ setup_netjet_u(struct IsdnCard *card)
save_flags
(
flags
);
save_flags
(
flags
);
sti
();
sti
();
cs
->
hw
.
njet
.
ctrl_reg
=
0xff
;
/* Reset On */
cs
->
hw
.
njet
.
ctrl_reg
=
0xff
;
/* Reset On */
byteout
(
cs
->
hw
.
njet
.
base
+
NETJET_CTRL
,
cs
->
hw
.
njet
.
ctrl_reg
);
byteout
(
cs
->
hw
.
njet
.
base
+
NETJET_CTRL
,
cs
->
hw
.
njet
.
ctrl_reg
);
...
...
drivers/isdn/hisax/s0box.c
View file @
7c99c33b
...
@@ -18,13 +18,13 @@
...
@@ -18,13 +18,13 @@
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
const
char
*
s0box_revision
=
"$Revision: 2.4.6.2 $"
;
const
char
*
s0box_revision
=
"$Revision: 2.4.6.2 $"
;
static
spinlock_t
s0box_lock
=
SPIN_LOCK_UNLOCKED
;
static
inline
void
static
inline
void
writereg
(
unsigned
int
padr
,
signed
int
addr
,
u_char
off
,
u_char
val
)
{
writereg
(
unsigned
int
padr
,
signed
int
addr
,
u_char
off
,
u_char
val
)
{
unsigned
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
s0box_lock
,
flags
);
cli
();
outb_p
(
0x1c
,
padr
+
2
);
outb_p
(
0x1c
,
padr
+
2
);
outb_p
(
0x14
,
padr
+
2
);
outb_p
(
0x14
,
padr
+
2
);
outb_p
((
addr
+
off
)
&
0x7f
,
padr
);
outb_p
((
addr
+
off
)
&
0x7f
,
padr
);
...
@@ -33,7 +33,7 @@ writereg(unsigned int padr, signed int addr, u_char off, u_char val) {
...
@@ -33,7 +33,7 @@ writereg(unsigned int padr, signed int addr, u_char off, u_char val) {
outb_p
(
0x17
,
padr
+
2
);
outb_p
(
0x17
,
padr
+
2
);
outb_p
(
0x14
,
padr
+
2
);
outb_p
(
0x14
,
padr
+
2
);
outb_p
(
0x1c
,
padr
+
2
);
outb_p
(
0x1c
,
padr
+
2
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
s0box_lock
,
flags
);
}
}
static
u_char
nibtab
[]
=
{
1
,
9
,
5
,
0xd
,
3
,
0xb
,
7
,
0xf
,
static
u_char
nibtab
[]
=
{
1
,
9
,
5
,
0xd
,
3
,
0xb
,
7
,
0xf
,
...
@@ -45,8 +45,7 @@ readreg(unsigned int padr, signed int addr, u_char off) {
...
@@ -45,8 +45,7 @@ readreg(unsigned int padr, signed int addr, u_char off) {
register
u_char
n1
,
n2
;
register
u_char
n1
,
n2
;
unsigned
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
s0box_lock
,
flags
);
cli
();
outb_p
(
0x1c
,
padr
+
2
);
outb_p
(
0x1c
,
padr
+
2
);
outb_p
(
0x14
,
padr
+
2
);
outb_p
(
0x14
,
padr
+
2
);
outb_p
((
addr
+
off
)
|
0x80
,
padr
);
outb_p
((
addr
+
off
)
|
0x80
,
padr
);
...
@@ -57,7 +56,7 @@ readreg(unsigned int padr, signed int addr, u_char off) {
...
@@ -57,7 +56,7 @@ readreg(unsigned int padr, signed int addr, u_char off) {
n2
=
(
inb_p
(
padr
+
1
)
>>
3
)
&
0x17
;
n2
=
(
inb_p
(
padr
+
1
)
>>
3
)
&
0x17
;
outb_p
(
0x14
,
padr
+
2
);
outb_p
(
0x14
,
padr
+
2
);
outb_p
(
0x1c
,
padr
+
2
);
outb_p
(
0x1c
,
padr
+
2
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
s0box_lock
,
flags
);
return
nibtab
[
n1
]
|
(
nibtab
[
n2
]
<<
4
);
return
nibtab
[
n1
]
|
(
nibtab
[
n2
]
<<
4
);
}
}
...
...
drivers/isdn/hisax/saphir.c
View file @
7c99c33b
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
static
char
*
saphir_rev
=
"$Revision: 1.8.6.2 $"
;
static
char
*
saphir_rev
=
"$Revision: 1.8.6.2 $"
;
static
spinlock_t
saphir_lock
=
SPIN_LOCK_UNLOCKED
;
#define byteout(addr,val) outb(val,addr)
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
#define bytein(addr) inb(addr)
...
@@ -35,13 +36,12 @@ static inline u_char
...
@@ -35,13 +36,12 @@ static inline u_char
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
{
{
register
u_char
ret
;
register
u_char
ret
;
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
saphir_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
ret
=
bytein
(
adr
);
ret
=
bytein
(
adr
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
saphir_lock
,
flags
);
return
(
ret
);
return
(
ret
);
}
}
...
@@ -58,13 +58,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
...
@@ -58,13 +58,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
static
inline
void
static
inline
void
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
saphir_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
byteout
(
adr
,
data
);
byteout
(
adr
,
data
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
saphir_lock
,
flags
);
}
}
static
inline
void
static
inline
void
...
@@ -182,14 +181,13 @@ SaphirWatchDog(struct IsdnCardState *cs)
...
@@ -182,14 +181,13 @@ SaphirWatchDog(struct IsdnCardState *cs)
void
void
release_io_saphir
(
struct
IsdnCardState
*
cs
)
release_io_saphir
(
struct
IsdnCardState
*
cs
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
saphir_lock
,
flags
);
cli
();
byteout
(
cs
->
hw
.
saphir
.
cfg_reg
+
IRQ_REG
,
0xff
);
byteout
(
cs
->
hw
.
saphir
.
cfg_reg
+
IRQ_REG
,
0xff
);
del_timer
(
&
cs
->
hw
.
saphir
.
timer
);
del_timer
(
&
cs
->
hw
.
saphir
.
timer
);
cs
->
hw
.
saphir
.
timer
.
function
=
NULL
;
cs
->
hw
.
saphir
.
timer
.
function
=
NULL
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
saphir_lock
,
flags
);
if
(
cs
->
hw
.
saphir
.
cfg_reg
)
if
(
cs
->
hw
.
saphir
.
cfg_reg
)
release_region
(
cs
->
hw
.
saphir
.
cfg_reg
,
6
);
release_region
(
cs
->
hw
.
saphir
.
cfg_reg
,
6
);
}
}
...
...
drivers/isdn/hisax/sedlbauer.c
View file @
7c99c33b
...
@@ -50,6 +50,7 @@
...
@@ -50,6 +50,7 @@
#include <linux/isapnp.h>
#include <linux/isapnp.h>
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
static
spinlock_t
sedlbauer_lock
=
SPIN_LOCK_UNLOCKED
;
const
char
*
Sedlbauer_revision
=
"$Revision: 1.25.6.6 $"
;
const
char
*
Sedlbauer_revision
=
"$Revision: 1.25.6.6 $"
;
...
@@ -121,13 +122,12 @@ static inline u_char
...
@@ -121,13 +122,12 @@ static inline u_char
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
readreg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
)
{
{
register
u_char
ret
;
register
u_char
ret
;
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
sedlbauer_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
ret
=
bytein
(
adr
);
ret
=
bytein
(
adr
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
sedlbauer_lock
,
flags
);
return
(
ret
);
return
(
ret
);
}
}
...
@@ -144,13 +144,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
...
@@ -144,13 +144,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
static
inline
void
static
inline
void
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
writereg
(
unsigned
int
ale
,
unsigned
int
adr
,
u_char
off
,
u_char
data
)
{
{
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
sedlbauer_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
byteout
(
adr
,
data
);
byteout
(
adr
,
data
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
sedlbauer_lock
,
flags
);
}
}
static
inline
void
static
inline
void
...
@@ -552,7 +551,7 @@ setup_sedlbauer(struct IsdnCard *card)
...
@@ -552,7 +551,7 @@ setup_sedlbauer(struct IsdnCard *card)
struct
IsdnCardState
*
cs
=
card
->
cs
;
struct
IsdnCardState
*
cs
=
card
->
cs
;
char
tmp
[
64
];
char
tmp
[
64
];
u16
sub_vendor_id
,
sub_id
;
u16
sub_vendor_id
,
sub_id
;
long
flags
;
unsigned
long
flags
;
strcpy
(
tmp
,
Sedlbauer_revision
);
strcpy
(
tmp
,
Sedlbauer_revision
);
printk
(
KERN_INFO
"HiSax: Sedlbauer driver Rev. %s
\n
"
,
HiSax_getrev
(
tmp
));
printk
(
KERN_INFO
"HiSax: Sedlbauer driver Rev. %s
\n
"
,
HiSax_getrev
(
tmp
));
...
...
drivers/isdn/hisax/sportster.c
View file @
7c99c33b
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
const
char
*
sportster_revision
=
"$Revision: 1.14.6.2 $"
;
const
char
*
sportster_revision
=
"$Revision: 1.14.6.2 $"
;
static
spinlock_t
sportster_lock
=
SPIN_LOCK_UNLOCKED
;
#define byteout(addr,val) outb(val,addr)
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
#define bytein(addr) inb(addr)
...
...
drivers/isdn/hisax/teleint.c
View file @
7c99c33b
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
const
char
*
TeleInt_revision
=
"$Revision: 1.14.6.2 $"
;
const
char
*
TeleInt_revision
=
"$Revision: 1.14.6.2 $"
;
static
spinlock_t
teleint_lock
=
SPIN_LOCK_UNLOCKED
;
#define byteout(addr,val) outb(val,addr)
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
#define bytein(addr) inb(addr)
...
@@ -28,21 +29,20 @@ readreg(unsigned int ale, unsigned int adr, u_char off)
...
@@ -28,21 +29,20 @@ readreg(unsigned int ale, unsigned int adr, u_char off)
{
{
register
u_char
ret
;
register
u_char
ret
;
int
max_delay
=
2000
;
int
max_delay
=
2000
;
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
teleint_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
ret
=
HFC_BUSY
&
bytein
(
ale
);
ret
=
HFC_BUSY
&
bytein
(
ale
);
while
(
ret
&&
--
max_delay
)
while
(
ret
&&
--
max_delay
)
ret
=
HFC_BUSY
&
bytein
(
ale
);
ret
=
HFC_BUSY
&
bytein
(
ale
);
if
(
!
max_delay
)
{
if
(
!
max_delay
)
{
printk
(
KERN_WARNING
"TeleInt Busy not inactive
\n
"
);
printk
(
KERN_WARNING
"TeleInt Busy not inactive
\n
"
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
teleint_lock
,
flags
);
return
(
0
);
return
(
0
);
}
}
ret
=
bytein
(
adr
);
ret
=
bytein
(
adr
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
teleint_lock
,
flags
);
return
(
ret
);
return
(
ret
);
}
}
...
@@ -72,21 +72,20 @@ writereg(unsigned int ale, unsigned int adr, u_char off, u_char data)
...
@@ -72,21 +72,20 @@ writereg(unsigned int ale, unsigned int adr, u_char off, u_char data)
{
{
register
u_char
ret
;
register
u_char
ret
;
int
max_delay
=
2000
;
int
max_delay
=
2000
;
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
teleint_lock
,
flags
);
cli
();
byteout
(
ale
,
off
);
byteout
(
ale
,
off
);
ret
=
HFC_BUSY
&
bytein
(
ale
);
ret
=
HFC_BUSY
&
bytein
(
ale
);
while
(
ret
&&
--
max_delay
)
while
(
ret
&&
--
max_delay
)
ret
=
HFC_BUSY
&
bytein
(
ale
);
ret
=
HFC_BUSY
&
bytein
(
ale
);
if
(
!
max_delay
)
{
if
(
!
max_delay
)
{
printk
(
KERN_WARNING
"TeleInt Busy not inactive
\n
"
);
printk
(
KERN_WARNING
"TeleInt Busy not inactive
\n
"
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
teleint_lock
,
flags
);
return
;
return
;
}
}
byteout
(
adr
,
data
);
byteout
(
adr
,
data
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
teleint_lock
,
flags
);
}
}
static
inline
void
static
inline
void
...
...
drivers/isdn/hisax/teles0.c
View file @
7c99c33b
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
const
char
*
teles0_revision
=
"$Revision: 2.13.6.2 $"
;
const
char
*
teles0_revision
=
"$Revision: 2.13.6.2 $"
;
static
spinlock_t
teles0_lock
=
SPIN_LOCK_UNLOCKED
;
#define TELES_IOMEM_SIZE 0x400
#define TELES_IOMEM_SIZE 0x400
#define byteout(addr,val) outb(val,addr)
#define byteout(addr,val) outb(val,addr)
...
@@ -196,10 +197,9 @@ static int
...
@@ -196,10 +197,9 @@ static int
reset_teles0
(
struct
IsdnCardState
*
cs
)
reset_teles0
(
struct
IsdnCardState
*
cs
)
{
{
u_char
cfval
;
u_char
cfval
;
long
flags
;
unsigned
long
flags
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
teles0_lock
,
flags
);
sti
();
if
(
cs
->
hw
.
teles0
.
cfg_reg
)
{
if
(
cs
->
hw
.
teles0
.
cfg_reg
)
{
switch
(
cs
->
irq
)
{
switch
(
cs
->
irq
)
{
case
2
:
case
2
:
...
@@ -228,6 +228,7 @@ reset_teles0(struct IsdnCardState *cs)
...
@@ -228,6 +228,7 @@ reset_teles0(struct IsdnCardState *cs)
cfval
=
0x0E
;
cfval
=
0x0E
;
break
;
break
;
default:
default:
spin_unlock_irqrestore
(
&
teles0_lock
,
flags
);
return
(
1
);
return
(
1
);
}
}
cfval
|=
((
cs
->
hw
.
teles0
.
phymem
>>
9
)
&
0xF0
);
cfval
|=
((
cs
->
hw
.
teles0
.
phymem
>>
9
)
&
0xF0
);
...
@@ -240,7 +241,7 @@ reset_teles0(struct IsdnCardState *cs)
...
@@ -240,7 +241,7 @@ reset_teles0(struct IsdnCardState *cs)
HZDELAY
(
HZ
/
5
+
1
);
HZDELAY
(
HZ
/
5
+
1
);
writeb
(
1
,
cs
->
hw
.
teles0
.
membase
+
0x80
);
mb
();
writeb
(
1
,
cs
->
hw
.
teles0
.
membase
+
0x80
);
mb
();
HZDELAY
(
HZ
/
5
+
1
);
HZDELAY
(
HZ
/
5
+
1
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
teles0_lock
,
flags
);
return
(
0
);
return
(
0
);
}
}
...
...
drivers/isdn/hisax/teles3.c
View file @
7c99c33b
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
extern
const
char
*
CardType
[];
extern
const
char
*
CardType
[];
const
char
*
teles3_revision
=
"$Revision: 2.17.6.2 $"
;
const
char
*
teles3_revision
=
"$Revision: 2.17.6.2 $"
;
static
spinlock_t
teles3_lock
=
SPIN_LOCK_UNLOCKED
;
#define byteout(addr,val) outb(val,addr)
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
#define bytein(addr) inb(addr)
...
@@ -174,7 +175,7 @@ release_io_teles3(struct IsdnCardState *cs)
...
@@ -174,7 +175,7 @@ release_io_teles3(struct IsdnCardState *cs)
static
int
static
int
reset_teles3
(
struct
IsdnCardState
*
cs
)
reset_teles3
(
struct
IsdnCardState
*
cs
)
{
{
long
flags
;
unsigned
long
flags
;
u_char
irqcfg
;
u_char
irqcfg
;
if
(
cs
->
typ
!=
ISDN_CTYPE_TELESPCMCIA
)
{
if
(
cs
->
typ
!=
ISDN_CTYPE_TELESPCMCIA
)
{
...
@@ -208,28 +209,27 @@ reset_teles3(struct IsdnCardState *cs)
...
@@ -208,28 +209,27 @@ reset_teles3(struct IsdnCardState *cs)
default:
default:
return
(
1
);
return
(
1
);
}
}
s
ave_flags
(
flags
);
s
pin_lock_irqsave
(
&
teles3_lock
,
flags
);
byteout
(
cs
->
hw
.
teles3
.
cfg_reg
+
4
,
irqcfg
);
byteout
(
cs
->
hw
.
teles3
.
cfg_reg
+
4
,
irqcfg
);
sti
();
HZDELAY
(
HZ
/
10
+
1
);
HZDELAY
(
HZ
/
10
+
1
);
byteout
(
cs
->
hw
.
teles3
.
cfg_reg
+
4
,
irqcfg
|
1
);
byteout
(
cs
->
hw
.
teles3
.
cfg_reg
+
4
,
irqcfg
|
1
);
HZDELAY
(
HZ
/
10
+
1
);
HZDELAY
(
HZ
/
10
+
1
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
teles3_lock
,
flags
);
}
else
if
(
cs
->
typ
==
ISDN_CTYPE_COMPAQ_ISA
)
{
}
else
if
(
cs
->
typ
==
ISDN_CTYPE_COMPAQ_ISA
)
{
s
ave_flags
(
flags
);
s
pin_lock_irqsave
(
&
teles3_lock
,
flags
);
byteout
(
cs
->
hw
.
teles3
.
cfg_reg
,
0xff
);
byteout
(
cs
->
hw
.
teles3
.
cfg_reg
,
0xff
);
HZDELAY
(
2
);
HZDELAY
(
2
);
byteout
(
cs
->
hw
.
teles3
.
cfg_reg
,
0x00
);
byteout
(
cs
->
hw
.
teles3
.
cfg_reg
,
0x00
);
HZDELAY
(
2
);
HZDELAY
(
2
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
teles3_lock
,
flags
);
}
else
{
}
else
{
/* Reset off for 16.3 PnP , thanks to Georg Acher */
/* Reset off for 16.3 PnP , thanks to Georg Acher */
s
ave_flags
(
flags
);
s
pin_lock_irqsave
(
&
teles3_lock
,
flags
);
byteout
(
cs
->
hw
.
teles3
.
isac
+
0x3c
,
0
);
byteout
(
cs
->
hw
.
teles3
.
isac
+
0x3c
,
0
);
HZDELAY
(
2
);
HZDELAY
(
2
);
byteout
(
cs
->
hw
.
teles3
.
isac
+
0x3c
,
1
);
byteout
(
cs
->
hw
.
teles3
.
isac
+
0x3c
,
1
);
HZDELAY
(
2
);
HZDELAY
(
2
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
teles3_lock
,
flags
);
}
}
}
}
return
(
0
);
return
(
0
);
...
...
drivers/isdn/hisax/w6692.c
View file @
7c99c33b
...
@@ -43,6 +43,8 @@ extern const char *CardType[];
...
@@ -43,6 +43,8 @@ extern const char *CardType[];
const
char
*
w6692_revision
=
"$Revision: 1.12.6.6 $"
;
const
char
*
w6692_revision
=
"$Revision: 1.12.6.6 $"
;
static
spinlock_t
w6692_lock
=
SPIN_LOCK_UNLOCKED
;
#define DBUSY_TIMER_VALUE 80
#define DBUSY_TIMER_VALUE 80
static
char
*
W6692Ver
[]
__initdata
=
static
char
*
W6692Ver
[]
__initdata
=
...
@@ -149,7 +151,7 @@ static void
...
@@ -149,7 +151,7 @@ static void
W6692_empty_fifo
(
struct
IsdnCardState
*
cs
,
int
count
)
W6692_empty_fifo
(
struct
IsdnCardState
*
cs
,
int
count
)
{
{
u_char
*
ptr
;
u_char
*
ptr
;
long
flags
;
unsigned
long
flags
;
if
((
cs
->
debug
&
L1_DEB_ISAC
)
&&
!
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
))
if
((
cs
->
debug
&
L1_DEB_ISAC
)
&&
!
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
))
debugl1
(
cs
,
"W6692_empty_fifo"
);
debugl1
(
cs
,
"W6692_empty_fifo"
);
...
@@ -164,11 +166,10 @@ W6692_empty_fifo(struct IsdnCardState *cs, int count)
...
@@ -164,11 +166,10 @@ W6692_empty_fifo(struct IsdnCardState *cs, int count)
}
}
ptr
=
cs
->
rcvbuf
+
cs
->
rcvidx
;
ptr
=
cs
->
rcvbuf
+
cs
->
rcvidx
;
cs
->
rcvidx
+=
count
;
cs
->
rcvidx
+=
count
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
w6692_lock
,
flags
);
cli
();
cs
->
readW6692fifo
(
cs
,
ptr
,
count
);
cs
->
readW6692fifo
(
cs
,
ptr
,
count
);
cs
->
writeW6692
(
cs
,
W_D_CMDR
,
W_D_CMDR_RACK
);
cs
->
writeW6692
(
cs
,
W_D_CMDR
,
W_D_CMDR_RACK
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
w6692_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
)
{
if
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
)
{
char
*
t
=
cs
->
dlog
;
char
*
t
=
cs
->
dlog
;
...
@@ -183,7 +184,7 @@ W6692_fill_fifo(struct IsdnCardState *cs)
...
@@ -183,7 +184,7 @@ W6692_fill_fifo(struct IsdnCardState *cs)
{
{
int
count
,
more
;
int
count
,
more
;
u_char
*
ptr
;
u_char
*
ptr
;
long
flags
;
unsigned
long
flags
;
if
((
cs
->
debug
&
L1_DEB_ISAC
)
&&
!
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
))
if
((
cs
->
debug
&
L1_DEB_ISAC
)
&&
!
(
cs
->
debug
&
L1_DEB_ISAC_FIFO
))
debugl1
(
cs
,
"W6692_fill_fifo"
);
debugl1
(
cs
,
"W6692_fill_fifo"
);
...
@@ -200,14 +201,13 @@ W6692_fill_fifo(struct IsdnCardState *cs)
...
@@ -200,14 +201,13 @@ W6692_fill_fifo(struct IsdnCardState *cs)
more
=
!
0
;
more
=
!
0
;
count
=
W_D_FIFO_THRESH
;
count
=
W_D_FIFO_THRESH
;
}
}
save_flags
(
flags
);
spin_lock_irqsave
(
&
w6692_lock
,
flags
);
cli
();
ptr
=
cs
->
tx_skb
->
data
;
ptr
=
cs
->
tx_skb
->
data
;
skb_pull
(
cs
->
tx_skb
,
count
);
skb_pull
(
cs
->
tx_skb
,
count
);
cs
->
tx_cnt
+=
count
;
cs
->
tx_cnt
+=
count
;
cs
->
writeW6692fifo
(
cs
,
ptr
,
count
);
cs
->
writeW6692fifo
(
cs
,
ptr
,
count
);
cs
->
writeW6692
(
cs
,
W_D_CMDR
,
more
?
W_D_CMDR_XMS
:
(
W_D_CMDR_XMS
|
W_D_CMDR_XME
));
cs
->
writeW6692
(
cs
,
W_D_CMDR
,
more
?
W_D_CMDR_XMS
:
(
W_D_CMDR_XMS
|
W_D_CMDR_XME
));
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
w6692_lock
,
flags
);
if
(
test_and_set_bit
(
FLG_DBUSY_TIMER
,
&
cs
->
HW_Flags
))
{
if
(
test_and_set_bit
(
FLG_DBUSY_TIMER
,
&
cs
->
HW_Flags
))
{
debugl1
(
cs
,
"W6692_fill_fifo dbusytimer running"
);
debugl1
(
cs
,
"W6692_fill_fifo dbusytimer running"
);
del_timer
(
&
cs
->
dbusytimer
);
del_timer
(
&
cs
->
dbusytimer
);
...
@@ -229,7 +229,7 @@ W6692B_empty_fifo(struct BCState *bcs, int count)
...
@@ -229,7 +229,7 @@ W6692B_empty_fifo(struct BCState *bcs, int count)
{
{
u_char
*
ptr
;
u_char
*
ptr
;
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
long
flags
;
unsigned
long
flags
;
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
debugl1
(
cs
,
"W6692B_empty_fifo"
);
debugl1
(
cs
,
"W6692B_empty_fifo"
);
...
@@ -243,11 +243,10 @@ W6692B_empty_fifo(struct BCState *bcs, int count)
...
@@ -243,11 +243,10 @@ W6692B_empty_fifo(struct BCState *bcs, int count)
}
}
ptr
=
bcs
->
hw
.
w6692
.
rcvbuf
+
bcs
->
hw
.
w6692
.
rcvidx
;
ptr
=
bcs
->
hw
.
w6692
.
rcvbuf
+
bcs
->
hw
.
w6692
.
rcvidx
;
bcs
->
hw
.
w6692
.
rcvidx
+=
count
;
bcs
->
hw
.
w6692
.
rcvidx
+=
count
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
w6692_lock
,
flags
);
cli
();
READW6692BFIFO
(
cs
,
bcs
->
channel
,
ptr
,
count
);
READW6692BFIFO
(
cs
,
bcs
->
channel
,
ptr
,
count
);
cs
->
BC_Write_Reg
(
cs
,
bcs
->
channel
,
W_B_CMDR
,
W_B_CMDR_RACK
|
W_B_CMDR_RACT
);
cs
->
BC_Write_Reg
(
cs
,
bcs
->
channel
,
W_B_CMDR
,
W_B_CMDR_RACK
|
W_B_CMDR_RACT
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
w6692_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
char
*
t
=
bcs
->
blog
;
char
*
t
=
bcs
->
blog
;
...
@@ -264,7 +263,7 @@ W6692B_fill_fifo(struct BCState *bcs)
...
@@ -264,7 +263,7 @@ W6692B_fill_fifo(struct BCState *bcs)
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
struct
IsdnCardState
*
cs
=
bcs
->
cs
;
int
more
,
count
;
int
more
,
count
;
u_char
*
ptr
;
u_char
*
ptr
;
long
flags
;
unsigned
long
flags
;
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
if
((
cs
->
debug
&
L1_DEB_HSCX
)
&&
!
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
))
...
@@ -282,15 +281,14 @@ W6692B_fill_fifo(struct BCState *bcs)
...
@@ -282,15 +281,14 @@ W6692B_fill_fifo(struct BCState *bcs)
}
else
}
else
count
=
bcs
->
tx_skb
->
len
;
count
=
bcs
->
tx_skb
->
len
;
save_flags
(
flags
);
spin_lock_irqsave
(
&
w6692_lock
,
flags
);
cli
();
ptr
=
bcs
->
tx_skb
->
data
;
ptr
=
bcs
->
tx_skb
->
data
;
skb_pull
(
bcs
->
tx_skb
,
count
);
skb_pull
(
bcs
->
tx_skb
,
count
);
bcs
->
tx_cnt
-=
count
;
bcs
->
tx_cnt
-=
count
;
bcs
->
hw
.
w6692
.
count
+=
count
;
bcs
->
hw
.
w6692
.
count
+=
count
;
WRITEW6692BFIFO
(
cs
,
bcs
->
channel
,
ptr
,
count
);
WRITEW6692BFIFO
(
cs
,
bcs
->
channel
,
ptr
,
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
));
cs
->
BC_Write_Reg
(
cs
,
bcs
->
channel
,
W_B_CMDR
,
W_B_CMDR_RACT
|
W_B_CMDR_XMS
|
(
more
?
0
:
W_B_CMDR_XME
));
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
w6692_lock
,
flags
);
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
if
(
cs
->
debug
&
L1_DEB_HSCX_FIFO
)
{
char
*
t
=
bcs
->
blog
;
char
*
t
=
bcs
->
blog
;
...
@@ -411,7 +409,7 @@ W6692_interrupt(int intno, void *dev_id, struct pt_regs *regs)
...
@@ -411,7 +409,7 @@ W6692_interrupt(int intno, void *dev_id, struct pt_regs *regs)
u_char
val
,
exval
,
v1
;
u_char
val
,
exval
,
v1
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
unsigned
int
count
;
unsigned
int
count
;
long
flags
;
unsigned
long
flags
;
int
icnt
=
5
;
int
icnt
=
5
;
if
(
!
cs
)
{
if
(
!
cs
)
{
...
@@ -442,8 +440,7 @@ W6692_interrupt(int intno, void *dev_id, struct pt_regs *regs)
...
@@ -442,8 +440,7 @@ W6692_interrupt(int intno, void *dev_id, struct pt_regs *regs)
if
(
count
==
0
)
if
(
count
==
0
)
count
=
W_D_FIFO_THRESH
;
count
=
W_D_FIFO_THRESH
;
W6692_empty_fifo
(
cs
,
count
);
W6692_empty_fifo
(
cs
,
count
);
save_flags
(
flags
);
spin_lock_irqsave
(
&
w6692_lock
,
flags
);
cli
();
if
((
count
=
cs
->
rcvidx
)
>
0
)
{
if
((
count
=
cs
->
rcvidx
)
>
0
)
{
cs
->
rcvidx
=
0
;
cs
->
rcvidx
=
0
;
if
(
!
(
skb
=
alloc_skb
(
count
,
GFP_ATOMIC
)))
if
(
!
(
skb
=
alloc_skb
(
count
,
GFP_ATOMIC
)))
...
@@ -453,7 +450,7 @@ W6692_interrupt(int intno, void *dev_id, struct pt_regs *regs)
...
@@ -453,7 +450,7 @@ W6692_interrupt(int intno, void *dev_id, struct pt_regs *regs)
skb_queue_tail
(
&
cs
->
rq
,
skb
);
skb_queue_tail
(
&
cs
->
rq
,
skb
);
}
}
}
}
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
w6692_lock
,
flags
);
}
}
cs
->
rcvidx
=
0
;
cs
->
rcvidx
=
0
;
W6692_sched_event
(
cs
,
D_RCVBUFREADY
);
W6692_sched_event
(
cs
,
D_RCVBUFREADY
);
...
@@ -745,20 +742,19 @@ static void
...
@@ -745,20 +742,19 @@ static void
W6692_l2l1
(
struct
PStack
*
st
,
int
pr
,
void
*
arg
)
W6692_l2l1
(
struct
PStack
*
st
,
int
pr
,
void
*
arg
)
{
{
struct
sk_buff
*
skb
=
arg
;
struct
sk_buff
*
skb
=
arg
;
long
flags
;
unsigned
long
flags
;
switch
(
pr
)
{
switch
(
pr
)
{
case
(
PH_DATA
|
REQUEST
):
case
(
PH_DATA
|
REQUEST
):
save_flags
(
flags
);
spin_lock_irqsave
(
&
w6692_lock
,
flags
);
cli
();
if
(
st
->
l1
.
bcs
->
tx_skb
)
{
if
(
st
->
l1
.
bcs
->
tx_skb
)
{
skb_queue_tail
(
&
st
->
l1
.
bcs
->
squeue
,
skb
);
skb_queue_tail
(
&
st
->
l1
.
bcs
->
squeue
,
skb
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
w6692_lock
,
flags
);
}
else
{
}
else
{
st
->
l1
.
bcs
->
tx_skb
=
skb
;
st
->
l1
.
bcs
->
tx_skb
=
skb
;
test_and_set_bit
(
BC_FLG_BUSY
,
&
st
->
l1
.
bcs
->
Flag
);
test_and_set_bit
(
BC_FLG_BUSY
,
&
st
->
l1
.
bcs
->
Flag
);
st
->
l1
.
bcs
->
hw
.
w6692
.
count
=
0
;
st
->
l1
.
bcs
->
hw
.
w6692
.
count
=
0
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
w6692_lock
,
flags
);
st
->
l1
.
bcs
->
cs
->
BC_Send_Data
(
st
->
l1
.
bcs
);
st
->
l1
.
bcs
->
cs
->
BC_Send_Data
(
st
->
l1
.
bcs
);
}
}
break
;
break
;
...
...
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