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
9e3083c1
Commit
9e3083c1
authored
Aug 02, 2003
by
Chas Williams
Committed by
David S. Miller
Aug 02, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ATM]: Convert cli() to spinlock in ZATM driver.
parent
ba79a0ce
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
63 deletions
+51
-63
drivers/atm/uPD98402.c
drivers/atm/uPD98402.c
+6
-6
drivers/atm/zatm.c
drivers/atm/zatm.c
+44
-57
drivers/atm/zatm.h
drivers/atm/zatm.h
+1
-0
No files found.
drivers/atm/uPD98402.c
View file @
9e3083c1
...
...
@@ -27,6 +27,7 @@ struct uPD98402_priv {
struct
k_sonet_stats
sonet_stats
;
/* link diagnostics */
unsigned
char
framing
;
/* SONET/SDH framing */
int
loop_mode
;
/* loopback mode */
spinlock_t
lock
;
};
...
...
@@ -71,14 +72,13 @@ static int set_framing(struct atm_dev *dev,unsigned char framing)
default:
return
-
EINVAL
;
}
save_flags
(
flags
);
cli
();
spin_lock_irqsave
(
&
PRIV
(
dev
)
->
lock
,
flags
);
PUT
(
set
[
0
],
C11T
);
PUT
(
set
[
1
],
C12T
);
PUT
(
set
[
2
],
C13T
);
PUT
((
GET
(
MDR
)
&
~
uPD98402_MDR_SS_MASK
)
|
(
set
[
3
]
<<
uPD98402_MDR_SS_SHIFT
),
MDR
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
PRIV
(
dev
)
->
lock
,
flags
);
return
0
;
}
...
...
@@ -88,12 +88,11 @@ static int get_sense(struct atm_dev *dev,u8 *arg)
unsigned
long
flags
;
unsigned
char
s
[
3
];
save_flags
(
flags
);
cli
();
spin_lock_irqsave
(
&
PRIV
(
dev
)
->
lock
,
flags
);
s
[
0
]
=
GET
(
C11R
);
s
[
1
]
=
GET
(
C12R
);
s
[
2
]
=
GET
(
C13R
);
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
PRIV
(
dev
)
->
lock
,
flags
);
return
(
put_user
(
s
[
0
],
arg
)
||
put_user
(
s
[
1
],
arg
+
1
)
||
put_user
(
s
[
2
],
arg
+
2
)
||
put_user
(
0xff
,
arg
+
3
)
||
put_user
(
0xff
,
arg
+
4
)
||
put_user
(
0xff
,
arg
+
5
))
?
-
EFAULT
:
0
;
...
...
@@ -214,6 +213,7 @@ static int uPD98402_start(struct atm_dev *dev)
DPRINTK
(
"phy_start
\n
"
);
if
(
!
(
PRIV
(
dev
)
=
kmalloc
(
sizeof
(
struct
uPD98402_priv
),
GFP_KERNEL
)))
return
-
ENOMEM
;
spin_lock_init
(
&
PRIV
(
dev
)
->
lock
);
memset
(
&
PRIV
(
dev
)
->
sonet_stats
,
0
,
sizeof
(
struct
k_sonet_stats
));
(
void
)
GET
(
PCR
);
/* clear performance events */
PUT
(
uPD98402_PFM_FJ
,
PCMR
);
/* ignore frequency adj */
...
...
drivers/atm/zatm.c
View file @
9e3083c1
This diff is collapsed.
Click to expand it.
drivers/atm/zatm.h
View file @
9e3083c1
...
...
@@ -85,6 +85,7 @@ struct zatm_dev {
unsigned
char
irq
;
/* IRQ */
unsigned
int
base
;
/* IO base address */
struct
pci_dev
*
pci_dev
;
/* PCI stuff */
spinlock_t
lock
;
};
...
...
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