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
dd253205
Commit
dd253205
authored
Apr 21, 2004
by
Denis Vlasenko
Committed by
Linus Torvalds
Apr 21, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] fealnx #5: introduce stop_nic_rxtx(), use it where makes sense
parent
f44910c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
drivers/net/fealnx.c
drivers/net/fealnx.c
+15
-6
No files found.
drivers/net/fealnx.c
View file @
dd253205
...
@@ -458,6 +458,7 @@ static struct ethtool_ops netdev_ethtool_ops;
...
@@ -458,6 +458,7 @@ static struct ethtool_ops netdev_ethtool_ops;
static
int
netdev_close
(
struct
net_device
*
dev
);
static
int
netdev_close
(
struct
net_device
*
dev
);
static
void
reset_rx_descriptors
(
struct
net_device
*
dev
);
static
void
reset_rx_descriptors
(
struct
net_device
*
dev
);
static
void
stop_nic_tx
(
long
ioaddr
,
long
crvalue
)
static
void
stop_nic_tx
(
long
ioaddr
,
long
crvalue
)
{
{
writel
(
crvalue
&
(
~
CR_W_TXEN
),
ioaddr
+
TCRRCR
);
writel
(
crvalue
&
(
~
CR_W_TXEN
),
ioaddr
+
TCRRCR
);
...
@@ -488,6 +489,17 @@ static void stop_nic_rx(long ioaddr, long crvalue)
...
@@ -488,6 +489,17 @@ static void stop_nic_rx(long ioaddr, long crvalue)
}
}
static
void
stop_nic_rxtx
(
long
ioaddr
,
long
crvalue
)
{
int
delay
=
0x1000
;
writel
(
crvalue
&
~
(
CR_W_RXEN
+
CR_W_TXEN
),
ioaddr
+
TCRRCR
);
while
(
--
delay
)
{
if
(
(
readl
(
ioaddr
+
TCRRCR
)
&
(
CR_R_RXSTOP
+
CR_R_TXSTOP
))
==
(
CR_R_RXSTOP
+
CR_R_TXSTOP
)
)
break
;
}
}
static
int
__devinit
fealnx_init_one
(
struct
pci_dev
*
pdev
,
static
int
__devinit
fealnx_init_one
(
struct
pci_dev
*
pdev
,
const
struct
pci_device_id
*
ent
)
const
struct
pci_device_id
*
ent
)
...
@@ -1175,8 +1187,7 @@ static void netdev_timer(unsigned long data)
...
@@ -1175,8 +1187,7 @@ static void netdev_timer(unsigned long data)
if
((
old_linkok
==
0
)
&&
(
np
->
linkok
==
1
))
{
/* we need to detect the media type again */
if
((
old_linkok
==
0
)
&&
(
np
->
linkok
==
1
))
{
/* we need to detect the media type again */
getlinktype
(
dev
);
getlinktype
(
dev
);
if
(
np
->
crvalue
!=
old_crvalue
)
{
if
(
np
->
crvalue
!=
old_crvalue
)
{
stop_nic_tx
(
ioaddr
,
np
->
crvalue
);
stop_nic_rxtx
(
ioaddr
,
np
->
crvalue
);
stop_nic_rx
(
ioaddr
,
np
->
crvalue
&
(
~
CR_W_TXEN
));
writel
(
np
->
crvalue
,
ioaddr
+
TCRRCR
);
writel
(
np
->
crvalue
,
ioaddr
+
TCRRCR
);
}
}
}
}
...
@@ -1776,8 +1787,7 @@ static void set_rx_mode(struct net_device *dev)
...
@@ -1776,8 +1787,7 @@ static void set_rx_mode(struct net_device *dev)
rx_mode
=
CR_W_AB
|
CR_W_AM
;
rx_mode
=
CR_W_AB
|
CR_W_AM
;
}
}
stop_nic_tx
(
ioaddr
,
np
->
crvalue
);
stop_nic_rxtx
(
ioaddr
,
np
->
crvalue
);
stop_nic_rx
(
ioaddr
,
np
->
crvalue
&
(
~
CR_W_TXEN
));
writel
(
mc_filter
[
0
],
ioaddr
+
MAR0
);
writel
(
mc_filter
[
0
],
ioaddr
+
MAR0
);
writel
(
mc_filter
[
1
],
ioaddr
+
MAR1
);
writel
(
mc_filter
[
1
],
ioaddr
+
MAR1
);
...
@@ -1882,8 +1892,7 @@ static int netdev_close(struct net_device *dev)
...
@@ -1882,8 +1892,7 @@ static int netdev_close(struct net_device *dev)
writel
(
0x0000
,
ioaddr
+
IMR
);
writel
(
0x0000
,
ioaddr
+
IMR
);
/* Stop the chip's Tx and Rx processes. */
/* Stop the chip's Tx and Rx processes. */
stop_nic_tx
(
ioaddr
,
0
);
stop_nic_rxtx
(
ioaddr
,
0
);
stop_nic_rx
(
ioaddr
,
0
);
del_timer_sync
(
&
np
->
timer
);
del_timer_sync
(
&
np
->
timer
);
...
...
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