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
1d96b12b
Commit
1d96b12b
authored
Sep 11, 2003
by
Scott Feldman
Committed by
Stephen Hemminger
Sep 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[e1000] make function our of setting media type
* Consolidate code and make function out of setting media type.
parent
8bef0b6b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
32 deletions
+44
-32
drivers/net/e1000/e1000_hw.c
drivers/net/e1000/e1000_hw.c
+43
-20
drivers/net/e1000/e1000_main.c
drivers/net/e1000/e1000_main.c
+1
-12
No files found.
drivers/net/e1000/e1000_hw.c
View file @
1d96b12b
...
...
@@ -249,6 +249,46 @@ e1000_set_mac_type(struct e1000_hw *hw)
return
E1000_SUCCESS
;
}
/*****************************************************************************
* Set media type and TBI compatibility.
*
* hw - Struct containing variables accessed by shared code
* **************************************************************************/
void
e1000_set_media_type
(
struct
e1000_hw
*
hw
)
{
uint32_t
status
;
DEBUGFUNC
(
"e1000_set_media_type"
);
if
(
hw
->
mac_type
!=
e1000_82543
)
{
/* tbi_compatibility is only valid on 82543 */
hw
->
tbi_compatibility_en
=
FALSE
;
}
switch
(
hw
->
device_id
)
{
case
E1000_DEV_ID_82545GM_SERDES
:
case
E1000_DEV_ID_82546GB_SERDES
:
hw
->
media_type
=
e1000_media_type_internal_serdes
;
break
;
default:
if
(
hw
->
mac_type
>=
e1000_82543
)
{
status
=
E1000_READ_REG
(
hw
,
STATUS
);
if
(
status
&
E1000_STATUS_TBIMODE
)
{
hw
->
media_type
=
e1000_media_type_fiber
;
/* tbi_compatibility not valid on fiber */
hw
->
tbi_compatibility_en
=
FALSE
;
}
else
{
hw
->
media_type
=
e1000_media_type_copper
;
}
}
else
{
/* This is an 82542 (fiber only) */
hw
->
media_type
=
e1000_media_type_fiber
;
}
}
}
/******************************************************************************
* Reset the transmit and receive units; mask and clear all interrupts.
*
...
...
@@ -404,7 +444,7 @@ e1000_reset_hw(struct e1000_hw *hw)
int32_t
e1000_init_hw
(
struct
e1000_hw
*
hw
)
{
uint32_t
ctrl
,
status
;
uint32_t
ctrl
;
uint32_t
i
;
int32_t
ret_val
;
uint16_t
pcix_cmd_word
;
...
...
@@ -421,25 +461,8 @@ e1000_init_hw(struct e1000_hw *hw)
return
ret_val
;
}
/* Set the Media Type and exit with error if it is not valid. */
if
(
hw
->
mac_type
!=
e1000_82543
)
{
/* tbi_compatibility is only valid on 82543 */
hw
->
tbi_compatibility_en
=
FALSE
;
}
if
(
hw
->
mac_type
>=
e1000_82543
)
{
status
=
E1000_READ_REG
(
hw
,
STATUS
);
if
(
status
&
E1000_STATUS_TBIMODE
)
{
hw
->
media_type
=
e1000_media_type_fiber
;
/* tbi_compatibility not valid on fiber */
hw
->
tbi_compatibility_en
=
FALSE
;
}
else
{
hw
->
media_type
=
e1000_media_type_copper
;
}
}
else
{
/* This is an 82542 (fiber only) */
hw
->
media_type
=
e1000_media_type_fiber
;
}
/* Set the media type and TBI compatibility */
e1000_set_media_type
(
hw
);
/* Disabling VLAN filtering. */
DEBUGOUT
(
"Initializing the IEEE VLAN
\n
"
);
...
...
drivers/net/e1000/e1000_main.c
View file @
1d96b12b
...
...
@@ -625,18 +625,7 @@ e1000_sw_init(struct e1000_adapter *adapter)
(
hw
->
mac_type
==
e1000_82547_rev_2
))
hw
->
phy_init_script
=
1
;
/* Media type - copper or fiber */
if
(
hw
->
mac_type
>=
e1000_82543
)
{
uint32_t
status
=
E1000_READ_REG
(
hw
,
STATUS
);
if
(
status
&
E1000_STATUS_TBIMODE
)
hw
->
media_type
=
e1000_media_type_fiber
;
else
hw
->
media_type
=
e1000_media_type_copper
;
}
else
{
hw
->
media_type
=
e1000_media_type_fiber
;
}
e1000_set_media_type
(
hw
);
if
(
hw
->
mac_type
<
e1000_82543
)
hw
->
report_tx_early
=
0
;
...
...
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