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
0f024d36
Commit
0f024d36
authored
Aug 26, 2003
by
Stefan Rompf
Committed by
Jeff Garzik
Aug 26, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[netdrvr 8139too] use mii_check_media lib function,
instead of homebrew MII bitbanging.
parent
7d8608b1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
26 deletions
+4
-26
drivers/net/8139too.c
drivers/net/8139too.c
+4
-26
No files found.
drivers/net/8139too.c
View file @
0f024d36
...
@@ -1339,23 +1339,12 @@ static int rtl8139_open (struct net_device *dev)
...
@@ -1339,23 +1339,12 @@ static int rtl8139_open (struct net_device *dev)
}
}
static
void
rtl_check_media
(
struct
net_device
*
dev
)
static
void
rtl_check_media
(
struct
net_device
*
dev
,
unsigned
int
init_media
)
{
{
struct
rtl8139_private
*
tp
=
dev
->
priv
;
struct
rtl8139_private
*
tp
=
dev
->
priv
;
if
(
tp
->
phys
[
0
]
>=
0
)
{
if
(
tp
->
phys
[
0
]
>=
0
)
{
u16
mii_lpa
=
mdio_read
(
dev
,
tp
->
phys
[
0
],
MII_LPA
);
mii_check_media
(
&
tp
->
mii
,
1
,
init_media
);
if
(
mii_lpa
==
0xffff
)
;
/* Not there */
else
if
((
mii_lpa
&
LPA_100FULL
)
==
LPA_100FULL
||
(
mii_lpa
&
0x00C0
)
==
LPA_10FULL
)
tp
->
mii
.
full_duplex
=
1
;
printk
(
KERN_INFO
"%s: Setting %s%s-duplex based on"
" auto-negotiated partner ability %4.4x.
\n
"
,
dev
->
name
,
mii_lpa
==
0
?
""
:
(
mii_lpa
&
0x0180
)
?
"100mbps "
:
"10mbps "
,
tp
->
mii
.
full_duplex
?
"full"
:
"half"
,
mii_lpa
);
}
}
}
}
...
@@ -1390,7 +1379,7 @@ static void rtl8139_hw_start (struct net_device *dev)
...
@@ -1390,7 +1379,7 @@ static void rtl8139_hw_start (struct net_device *dev)
tp
->
cur_rx
=
0
;
tp
->
cur_rx
=
0
;
rtl_check_media
(
dev
);
rtl_check_media
(
dev
,
1
);
if
(
tp
->
chipset
>=
CH_8139B
)
{
if
(
tp
->
chipset
>=
CH_8139B
)
{
/* Disable magic packet scanning, which is enabled
/* Disable magic packet scanning, which is enabled
...
@@ -1999,18 +1988,7 @@ static void rtl8139_weird_interrupt (struct net_device *dev,
...
@@ -1999,18 +1988,7 @@ static void rtl8139_weird_interrupt (struct net_device *dev,
if
((
status
&
RxUnderrun
)
&&
link_changed
&&
if
((
status
&
RxUnderrun
)
&&
link_changed
&&
(
tp
->
drv_flags
&
HAS_LNK_CHNG
))
{
(
tp
->
drv_flags
&
HAS_LNK_CHNG
))
{
/* Really link-change on new chips. */
rtl_check_media
(
dev
,
0
);
int
lpar
=
RTL_R16
(
NWayLPAR
);
int
duplex
=
(
lpar
&
LPA_100FULL
)
||
(
lpar
&
0x01C0
)
==
0x0040
||
tp
->
mii
.
force_media
;
if
(
tp
->
mii
.
full_duplex
!=
duplex
)
{
tp
->
mii
.
full_duplex
=
duplex
;
#if 0
RTL_W8 (Cfg9346, Cfg9346_Unlock);
RTL_W8 (Config1, tp->mii.full_duplex ? 0x60 : 0x20);
RTL_W8 (Cfg9346, Cfg9346_Lock);
#endif
}
status
&=
~
RxUnderrun
;
status
&=
~
RxUnderrun
;
}
}
...
...
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