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
0954ed82
Commit
0954ed82
authored
Jul 09, 2008
by
Krzysztof Hałasa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WAN: Simplify HD64572 status handling.
Signed-off-by:
Krzysztof Hałasa
<
khc@pm.waw.pl
>
parent
0446c3b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
29 deletions
+8
-29
drivers/net/wan/hd64572.c
drivers/net/wan/hd64572.c
+8
-29
No files found.
drivers/net/wan/hd64572.c
View file @
0954ed82
...
...
@@ -51,10 +51,6 @@
#define get_dmac_rx(port) (phy_node(port) ? DMAC1RX_OFFSET : DMAC0RX_OFFSET)
#define get_dmac_tx(port) (phy_node(port) ? DMAC1TX_OFFSET : DMAC0TX_OFFSET)
#define SCA_INTR_MSCI(node) (node ? 0x10 : 0x01)
#define SCA_INTR_DMAC_RX(node) (node ? 0x20 : 0x02)
#define SCA_INTR_DMAC_TX(node) (node ? 0x40 : 0x04)
static
int
sca_poll
(
struct
napi_struct
*
napi
,
int
budget
);
static
inline
struct
net_device
*
port_to_dev
(
port_t
*
port
)
...
...
@@ -62,21 +58,6 @@ static inline struct net_device *port_to_dev(port_t *port)
return
port
->
dev
;
}
static
inline
int
sca_intr_status
(
card_t
*
card
)
{
u8
result
=
0
;
u32
isr0
=
sca_inl
(
ISR0
,
card
);
if
(
isr0
&
0x00000002
)
result
|=
SCA_INTR_DMAC_RX
(
0
);
if
(
isr0
&
0x00000020
)
result
|=
SCA_INTR_DMAC_TX
(
0
);
if
(
isr0
&
0x00000200
)
result
|=
SCA_INTR_DMAC_RX
(
1
);
if
(
isr0
&
0x00002000
)
result
|=
SCA_INTR_DMAC_TX
(
1
);
if
(
isr0
&
0x00080000
)
result
|=
SCA_INTR_MSCI
(
0
);
if
(
isr0
&
0x08000000
)
result
|=
SCA_INTR_MSCI
(
1
);
return
result
;
}
static
inline
port_t
*
dev_to_port
(
struct
net_device
*
dev
)
{
return
dev_to_hdlc
(
dev
)
->
priv
;
...
...
@@ -358,16 +339,16 @@ static inline void sca_tx_done(port_t *port)
static
int
sca_poll
(
struct
napi_struct
*
napi
,
int
budget
)
{
port_t
*
port
=
container_of
(
napi
,
port_t
,
napi
);
u
8
stat
=
sca_intr_status
(
port
->
card
);
u
32
isr0
=
sca_inl
(
ISR0
,
port
->
card
);
int
received
=
0
;
if
(
stat
&
SCA_INTR_MSCI
(
port
->
phy_node
))
if
(
isr0
&
(
port
->
phy_node
?
0x08000000
:
0x00080000
))
sca_msci_intr
(
port
);
if
(
stat
&
SCA_INTR_DMAC_TX
(
port
->
phy_node
))
if
(
isr0
&
(
port
->
phy_node
?
0x00002000
:
0x00000020
))
sca_tx_done
(
port
);
if
(
stat
&
SCA_INTR_DMAC_RX
(
port
->
phy_node
))
if
(
isr0
&
(
port
->
phy_node
?
0x00000200
:
0x00000002
))
received
=
sca_rx_done
(
port
,
budget
);
if
(
received
<
budget
)
{
...
...
@@ -378,17 +359,15 @@ static int sca_poll(struct napi_struct *napi, int budget)
return
received
;
}
static
irqreturn_t
sca_intr
(
int
irq
,
void
*
dev_id
)
static
irqreturn_t
sca_intr
(
int
irq
,
void
*
dev_id
)
{
card_t
*
card
=
dev_id
;
int
i
;
u8
stat
=
sca_intr_status
(
card
);
int
handled
=
0
;
u32
isr0
=
sca_inl
(
ISR0
,
card
);
int
i
,
handled
=
0
;
for
(
i
=
0
;
i
<
2
;
i
++
)
{
port_t
*
port
=
get_port
(
card
,
i
);
if
(
port
&&
(
stat
&
(
SCA_INTR_MSCI
(
i
)
|
SCA_INTR_DMAC_RX
(
i
)
|
SCA_INTR_DMAC_TX
(
i
))))
{
if
(
port
&&
(
isr0
&
(
i
?
0x08002200
:
0x00080022
)))
{
handled
=
1
;
disable_intr
(
port
);
netif_rx_schedule
(
port
->
dev
,
&
port
->
napi
);
...
...
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