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
e1f024eb
Commit
e1f024eb
authored
Jul 11, 2008
by
Krzysztof Hałasa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WAN: Simplify sca_init_port() in HD64572 driver.
Signed-off-by:
Krzysztof Hałasa
<
khc@pm.waw.pl
>
parent
fcfe9ff3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
36 deletions
+31
-36
drivers/net/wan/hd64572.c
drivers/net/wan/hd64572.c
+31
-36
No files found.
drivers/net/wan/hd64572.c
View file @
e1f024eb
...
@@ -131,6 +131,7 @@ static inline void sca_set_carrier(port_t *port)
...
@@ -131,6 +131,7 @@ static inline void sca_set_carrier(port_t *port)
static
void
sca_init_port
(
port_t
*
port
)
static
void
sca_init_port
(
port_t
*
port
)
{
{
card_t
*
card
=
port
->
card
;
card_t
*
card
=
port
->
card
;
u16
dmac_rx
=
get_dmac_rx
(
port
),
dmac_tx
=
get_dmac_tx
(
port
);
int
transmit
,
i
;
int
transmit
,
i
;
port
->
rxin
=
0
;
port
->
rxin
=
0
;
...
@@ -138,7 +139,6 @@ static void sca_init_port(port_t *port)
...
@@ -138,7 +139,6 @@ static void sca_init_port(port_t *port)
port
->
txlast
=
0
;
port
->
txlast
=
0
;
for
(
transmit
=
0
;
transmit
<
2
;
transmit
++
)
{
for
(
transmit
=
0
;
transmit
<
2
;
transmit
++
)
{
u16
dmac
=
transmit
?
get_dmac_tx
(
port
)
:
get_dmac_rx
(
port
);
u16
buffs
=
transmit
?
card
->
tx_ring_buffers
u16
buffs
=
transmit
?
card
->
tx_ring_buffers
:
card
->
rx_ring_buffers
;
:
card
->
rx_ring_buffers
;
...
@@ -152,42 +152,37 @@ static void sca_init_port(port_t *port)
...
@@ -152,42 +152,37 @@ static void sca_init_port(port_t *port)
writew
(
0
,
&
desc
->
len
);
writew
(
0
,
&
desc
->
len
);
writeb
(
0
,
&
desc
->
stat
);
writeb
(
0
,
&
desc
->
stat
);
}
}
}
/* DMA disable - to halt state */
/* DMA disable - to halt state */
sca_out
(
0
,
transmit
?
DSR_TX
(
port
->
chan
)
:
sca_out
(
0
,
DSR_RX
(
port
->
chan
),
card
);
DSR_RX
(
port
->
chan
),
card
);
sca_out
(
0
,
DSR_TX
(
port
->
chan
),
card
);
/* software ABORT - to initial state */
/* software ABORT - to initial state */
sca_out
(
DCR_ABORT
,
transmit
?
DCR_TX
(
port
->
chan
)
:
sca_out
(
DCR_ABORT
,
DCR_RX
(
port
->
chan
),
card
);
DCR_R
X
(
port
->
chan
),
card
);
sca_out
(
DCR_ABORT
,
DCR_T
X
(
port
->
chan
),
card
);
/* current desc addr */
/* current desc addr */
sca_outl
(
desc_offset
(
port
,
0
,
transmit
),
dmac
+
CDAL
,
card
);
sca_outl
(
desc_offset
(
port
,
0
,
0
),
dmac_rx
+
CDAL
,
card
);
if
(
!
transmit
)
sca_outl
(
desc_offset
(
port
,
card
->
tx_ring_buffers
-
1
,
0
),
sca_outl
(
desc_offset
(
port
,
buffs
-
1
,
transmit
),
dmac_rx
+
EDAL
,
card
);
dmac
+
EDAL
,
card
);
sca_outl
(
desc_offset
(
port
,
0
,
1
),
dmac_tx
+
CDAL
,
card
);
else
sca_outl
(
desc_offset
(
port
,
0
,
1
),
dmac_tx
+
EDAL
,
card
);
sca_outl
(
desc_offset
(
port
,
0
,
transmit
),
dmac
+
EDAL
,
card
);
/* clear frame end interrupt counter */
/* clear frame end interrupt counter */
sca_out
(
DCR_CLEAR_EOF
,
transmit
?
DCR_TX
(
port
->
chan
)
:
sca_out
(
DCR_CLEAR_EOF
,
DCR_RX
(
port
->
chan
),
card
);
DCR_RX
(
port
->
chan
),
card
);
sca_out
(
DCR_CLEAR_EOF
,
DCR_TX
(
port
->
chan
),
card
);
if
(
!
transmit
)
{
/* Receive */
/* Receive */
/* set buffer length */
sca_outw
(
HDLC_MAX_MRU
,
dmac_rx
+
BFLL
,
card
);
/* set buffer length */
sca_outw
(
HDLC_MAX_MRU
,
dmac
+
BFLL
,
card
);
sca_out
(
0x14
,
DMR_RX
(
port
->
chan
),
card
);
/* Chain mode, Multi-frame */
/* Chain mode, Multi-frame */
sca_out
(
DIR_EOME
,
DIR_RX
(
port
->
chan
),
card
);
/* enable interrupts */
sca_out
(
0x14
,
DMR_RX
(
port
->
chan
),
card
);
sca_out
(
DSR_DE
,
DSR_RX
(
port
->
chan
),
card
);
/* DMA enable */
sca_out
(
DIR_EOME
,
DIR_RX
(
port
->
chan
),
card
);
/* DMA enable */
/* Transmit */
sca_out
(
DSR_DE
,
DSR_RX
(
port
->
chan
),
card
);
sca_out
(
0x14
,
DMR_TX
(
port
->
chan
),
card
);
/* Chain mode, Multi-frame */
}
else
{
/* Transmit */
sca_out
(
DIR_EOME
,
DIR_TX
(
port
->
chan
),
card
);
/* enable interrupts */
/* Chain mode, Multi-frame */
sca_out
(
0x14
,
DMR_TX
(
port
->
chan
),
card
);
/* enable underflow interrupts */
sca_out
(
DIR_EOME
,
DIR_TX
(
port
->
chan
),
card
);
}
}
sca_set_carrier
(
port
);
sca_set_carrier
(
port
);
netif_napi_add
(
port
->
netdev
,
&
port
->
napi
,
sca_poll
,
NAPI_WEIGHT
);
netif_napi_add
(
port
->
netdev
,
&
port
->
napi
,
sca_poll
,
NAPI_WEIGHT
);
}
}
...
...
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