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
b86366a8
Commit
b86366a8
authored
Mar 28, 2004
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TG3]: Do not allow illegal ethtool advertisement bits.
parent
a10e5109
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
drivers/net/tg3.c
drivers/net/tg3.c
+11
-0
No files found.
drivers/net/tg3.c
View file @
b86366a8
...
@@ -5882,6 +5882,16 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
...
@@ -5882,6 +5882,16 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
tp
->
link_config
.
phy_is_low_power
)
tp
->
link_config
.
phy_is_low_power
)
return
-
EAGAIN
;
return
-
EAGAIN
;
if
(
tp
->
phy_id
==
PHY_ID_SERDES
)
{
/* These are the only valid advertisement bits allowed. */
if
(
cmd
->
autoned
==
AUTONEG_ENABLE
&&
(
cmd
->
advertising
&
~
(
ADVERTISED_1000baseT_Half
|
ADVERTISED_1000baseT_Full
|
ADVERTISED_Autoneg
|
ADVERTISED_FIBRE
)))
return
-
EINVAL
;
}
spin_lock_irq
(
&
tp
->
lock
);
spin_lock_irq
(
&
tp
->
lock
);
spin_lock
(
&
tp
->
tx_lock
);
spin_lock
(
&
tp
->
tx_lock
);
...
@@ -5891,6 +5901,7 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
...
@@ -5891,6 +5901,7 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
tp
->
link_config
.
speed
=
SPEED_INVALID
;
tp
->
link_config
.
speed
=
SPEED_INVALID
;
tp
->
link_config
.
duplex
=
DUPLEX_INVALID
;
tp
->
link_config
.
duplex
=
DUPLEX_INVALID
;
}
else
{
}
else
{
tp
->
link_config
.
advertising
=
0
;
tp
->
link_config
.
speed
=
cmd
->
speed
;
tp
->
link_config
.
speed
=
cmd
->
speed
;
tp
->
link_config
.
duplex
=
cmd
->
duplex
;
tp
->
link_config
.
duplex
=
cmd
->
duplex
;
}
}
...
...
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