Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
4b634098
Commit
4b634098
authored
Apr 30, 2002
by
Kai Germaschewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ISDN: B1 DMA drivers: Replace cli() by proper spin_lock.
parent
698b2ca3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
34 deletions
+17
-34
drivers/isdn/hardware/avm/avmcard.h
drivers/isdn/hardware/avm/avmcard.h
+4
-0
drivers/isdn/hardware/avm/b1dma.c
drivers/isdn/hardware/avm/b1dma.c
+10
-34
drivers/isdn/hardware/avm/b1pci.c
drivers/isdn/hardware/avm/b1pci.c
+1
-0
drivers/isdn/hardware/avm/t1pci.c
drivers/isdn/hardware/avm/t1pci.c
+2
-0
No files found.
drivers/isdn/hardware/avm/avmcard.h
View file @
4b634098
...
...
@@ -10,6 +10,8 @@
#ifndef _AVMCARD_H_
#define _AVMCARD_H_
#include <linux/spinlock.h>
#define AVMB1_PORTLEN 0x1f
#define AVM_MAXVERSION 8
#define AVM_NCCI_PER_CHANNEL 4
...
...
@@ -57,6 +59,8 @@ typedef struct avmcard_dmainfo {
typedef
struct
avmcard
{
char
name
[
32
];
spinlock_t
lock
;
unsigned
int
port
;
unsigned
irq
;
unsigned
long
membase
;
...
...
drivers/isdn/hardware/avm/b1dma.c
View file @
4b634098
...
...
@@ -214,10 +214,6 @@ static inline u32 _get_slice(void **pp, unsigned char *dp)
void
b1dma_reset
(
avmcard
*
card
)
{
unsigned
long
flags
;
save_flags
(
flags
);
cli
();
card
->
csr
=
0x0
;
b1dmaoutmeml
(
card
->
mbase
+
AMCC_INTCSR
,
card
->
csr
);
b1dmaoutmeml
(
card
->
mbase
+
AMCC_MCSR
,
0
);
...
...
@@ -227,8 +223,6 @@ void b1dma_reset(avmcard *card)
t1outp
(
card
->
port
,
0x10
,
0x00
);
t1outp
(
card
->
port
,
0x07
,
0x00
);
restore_flags
(
flags
);
b1dmaoutmeml
(
card
->
mbase
+
AMCC_MCSR
,
0
);
mdelay
(
10
);
b1dmaoutmeml
(
card
->
mbase
+
AMCC_MCSR
,
0x0f000000
);
/* reset all */
...
...
@@ -354,16 +348,16 @@ static void b1dma_queue_tx(avmcard *card, struct sk_buff *skb)
{
unsigned
long
flags
;
s
kb_queue_tail
(
&
card
->
dma
->
send_queue
,
skb
);
s
pin_lock_irqsave
(
&
card
->
lock
,
flags
);
s
pin_lock_irq_save
(
&
card
->
lock
,
flags
);
s
kb_queue_tail
(
&
card
->
dma
->
send_queue
,
skb
);
if
(
!
(
card
->
csr
&
EN_TX_TC_INT
))
{
b1dma_dispatch_tx
(
card
);
b1dmaoutmeml
(
card
->
mbase
+
AMCC_INTCSR
,
card
->
csr
);
}
spin_unlock_irq
_
restore
(
&
card
->
lock
,
flags
);
spin_unlock_irqrestore
(
&
card
->
lock
,
flags
);
}
/* ------------------------------------------------------------- */
...
...
@@ -371,7 +365,6 @@ static void b1dma_queue_tx(avmcard *card, struct sk_buff *skb)
static
void
b1dma_dispatch_tx
(
avmcard
*
card
)
{
avmcard_dmainfo
*
dma
=
card
->
dma
;
unsigned
long
flags
;
struct
sk_buff
*
skb
;
u8
cmd
,
subcmd
;
u16
len
;
...
...
@@ -382,13 +375,6 @@ static void b1dma_dispatch_tx(avmcard *card)
inint
=
card
->
interrupt
;
skb
=
skb_dequeue
(
&
dma
->
send_queue
);
if
(
!
skb
)
{
#ifdef CONFIG_B1DMA_DEBUG
printk
(
KERN_DEBUG
"tx(%d): underrun
\n
"
,
inint
);
#endif
restore_flags
(
flags
);
return
;
}
len
=
CAPIMSG_LEN
(
skb
->
data
);
...
...
@@ -617,16 +603,17 @@ static void b1dma_handle_interrupt(avmcard *card)
}
}
if
((
status
&
TX_TC_INT
)
!=
0
)
{
spin_lock_irq_save
(
&
card
->
lock
,
flags
);
card
->
csr
&=
~
EN_TX_TC_INT
;
b1dma_dispatch_tx
(
card
);
spin_lock
(
&
card
->
lock
);
spin_unlock_irq_restore
(
&
card
->
lock
,
flags
);
if
((
status
&
TX_TC_INT
)
!=
0
)
{
if
(
skb_queue_empty
(
&
card
->
dma
->
send_queue
))
card
->
csr
&=
~
EN_TX_TC_INT
;
else
b1dma_dispatch_tx
(
card
);
}
b1dmaoutmeml
(
card
->
mbase
+
AMCC_INTCSR
,
card
->
csr
);
spin_unlock
(
&
card
->
lock
);
}
void
b1dma_interrupt
(
int
interrupt
,
void
*
devptr
,
struct
pt_regs
*
regs
)
...
...
@@ -712,7 +699,6 @@ int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data)
{
avmctrl_info
*
cinfo
=
(
avmctrl_info
*
)(
ctrl
->
driverdata
);
avmcard
*
card
=
cinfo
->
card
;
unsigned
long
flags
;
int
retval
;
b1dma_reset
(
card
);
...
...
@@ -739,9 +725,6 @@ int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data)
return
-
EIO
;
}
save_flags
(
flags
);
cli
();
card
->
csr
=
AVM_FLAG
;
b1dmaoutmeml
(
card
->
mbase
+
AMCC_INTCSR
,
card
->
csr
);
b1dmaoutmeml
(
card
->
mbase
+
AMCC_MCSR
,
...
...
@@ -756,7 +739,6 @@ int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data)
b1dmaoutmeml
(
card
->
mbase
+
AMCC_RXLEN
,
4
);
card
->
csr
|=
EN_RX_TC_INT
;
b1dmaoutmeml
(
card
->
mbase
+
AMCC_INTCSR
,
card
->
csr
);
restore_flags
(
flags
);
b1dma_send_init
(
card
);
...
...
@@ -858,7 +840,6 @@ int b1dmactl_read_proc(char *page, char **start, off_t off,
{
avmctrl_info
*
cinfo
=
(
avmctrl_info
*
)(
ctrl
->
driverdata
);
avmcard
*
card
=
cinfo
->
card
;
unsigned
long
flags
;
u8
flag
;
int
len
=
0
;
char
*
s
;
...
...
@@ -915,9 +896,6 @@ int b1dmactl_read_proc(char *page, char **start, off_t off,
}
len
+=
sprintf
(
page
+
len
,
"%-16s %s
\n
"
,
"cardname"
,
cinfo
->
cardname
);
save_flags
(
flags
);
cli
();
txoff
=
(
dma_addr_t
)
b1dmainmeml
(
card
->
mbase
+
0x2c
)
-
card
->
dma
->
sendbuf
.
dmaaddr
;
txlen
=
b1dmainmeml
(
card
->
mbase
+
0x30
);
...
...
@@ -926,8 +904,6 @@ int b1dmactl_read_proc(char *page, char **start, off_t off,
csr
=
b1dmainmeml
(
card
->
mbase
+
AMCC_INTCSR
);
restore_flags
(
flags
);
len
+=
sprintf
(
page
+
len
,
"%-16s 0x%lx
\n
"
,
"csr (cached)"
,
(
unsigned
long
)
card
->
csr
);
len
+=
sprintf
(
page
+
len
,
"%-16s 0x%lx
\n
"
,
...
...
drivers/isdn/hardware/avm/b1pci.c
View file @
4b634098
...
...
@@ -258,6 +258,7 @@ static int b1pciv4_add_card(struct capi_driver *driver,
goto
err
;
}
memset
(
card
,
0
,
sizeof
(
avmcard
));
spin_lock_init
(
&
card
->
lock
);
card
->
dma
=
avmcard_dma_alloc
(
driver
->
name
,
dev
,
2048
+
128
,
2048
+
128
);
if
(
!
card
->
dma
)
{
...
...
drivers/isdn/hardware/avm/t1pci.c
View file @
4b634098
...
...
@@ -66,6 +66,8 @@ static int t1pci_add_card(struct capi_driver *driver,
goto
err
;
}
memset
(
card
,
0
,
sizeof
(
avmcard
));
spin_lock_init
(
&
card
->
lock
);
card
->
dma
=
avmcard_dma_alloc
(
driver
->
name
,
dev
,
2048
+
128
,
2048
+
128
);
if
(
!
card
->
dma
)
{
printk
(
KERN_WARNING
"%s: no memory.
\n
"
,
driver
->
name
);
...
...
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