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
cd81ecfd
Commit
cd81ecfd
authored
Apr 13, 2004
by
Ganesh Venkatesan
Committed by
Jeff Garzik
Apr 13, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] e1000: ethtool set/get eeprom fixes
parent
4d72de23
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
drivers/net/e1000/e1000_ethtool.c
drivers/net/e1000/e1000_ethtool.c
+15
-1
No files found.
drivers/net/e1000/e1000_ethtool.c
View file @
cd81ecfd
...
@@ -353,6 +353,7 @@ e1000_ethtool_geeprom(struct e1000_adapter *adapter,
...
@@ -353,6 +353,7 @@ e1000_ethtool_geeprom(struct e1000_adapter *adapter,
struct
e1000_hw
*
hw
=
&
adapter
->
hw
;
struct
e1000_hw
*
hw
=
&
adapter
->
hw
;
int
first_word
,
last_word
;
int
first_word
,
last_word
;
int
ret_val
=
0
;
int
ret_val
=
0
;
uint16_t
i
;
if
(
eeprom
->
len
==
0
)
{
if
(
eeprom
->
len
==
0
)
{
ret_val
=
-
EINVAL
;
ret_val
=
-
EINVAL
;
...
@@ -377,12 +378,16 @@ e1000_ethtool_geeprom(struct e1000_adapter *adapter,
...
@@ -377,12 +378,16 @@ e1000_ethtool_geeprom(struct e1000_adapter *adapter,
last_word
-
first_word
+
1
,
last_word
-
first_word
+
1
,
eeprom_buff
);
eeprom_buff
);
else
{
else
{
uint16_t
i
;
for
(
i
=
0
;
i
<
last_word
-
first_word
+
1
;
i
++
)
for
(
i
=
0
;
i
<
last_word
-
first_word
+
1
;
i
++
)
if
((
ret_val
=
e1000_read_eeprom
(
hw
,
first_word
+
i
,
1
,
if
((
ret_val
=
e1000_read_eeprom
(
hw
,
first_word
+
i
,
1
,
&
eeprom_buff
[
i
])))
&
eeprom_buff
[
i
])))
break
;
break
;
}
}
/* Device's eeprom is always little-endian, word addressable */
for
(
i
=
0
;
i
<
last_word
-
first_word
+
1
;
i
++
)
le16_to_cpus
(
&
eeprom_buff
[
i
]);
geeprom_error:
geeprom_error:
return
ret_val
;
return
ret_val
;
}
}
...
@@ -395,6 +400,7 @@ e1000_ethtool_seeprom(struct e1000_adapter *adapter,
...
@@ -395,6 +400,7 @@ e1000_ethtool_seeprom(struct e1000_adapter *adapter,
uint16_t
*
eeprom_buff
;
uint16_t
*
eeprom_buff
;
void
*
ptr
;
void
*
ptr
;
int
max_len
,
first_word
,
last_word
,
ret_val
=
0
;
int
max_len
,
first_word
,
last_word
,
ret_val
=
0
;
uint16_t
i
;
if
(
eeprom
->
len
==
0
)
if
(
eeprom
->
len
==
0
)
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
...
@@ -428,11 +434,19 @@ e1000_ethtool_seeprom(struct e1000_adapter *adapter,
...
@@ -428,11 +434,19 @@ e1000_ethtool_seeprom(struct e1000_adapter *adapter,
ret_val
=
e1000_read_eeprom
(
hw
,
last_word
,
1
,
ret_val
=
e1000_read_eeprom
(
hw
,
last_word
,
1
,
&
eeprom_buff
[
last_word
-
first_word
]);
&
eeprom_buff
[
last_word
-
first_word
]);
}
}
/* Device's eeprom is always little-endian, word addressable */
for
(
i
=
0
;
i
<
last_word
-
first_word
+
1
;
i
++
)
le16_to_cpus
(
&
eeprom_buff
[
i
]);
if
((
ret_val
!=
0
)
||
copy_from_user
(
ptr
,
user_data
,
eeprom
->
len
))
{
if
((
ret_val
!=
0
)
||
copy_from_user
(
ptr
,
user_data
,
eeprom
->
len
))
{
ret_val
=
-
EFAULT
;
ret_val
=
-
EFAULT
;
goto
seeprom_error
;
goto
seeprom_error
;
}
}
for
(
i
=
0
;
i
<
last_word
-
first_word
+
1
;
i
++
)
eeprom_buff
[
i
]
=
cpu_to_le16
(
eeprom_buff
[
i
]);
ret_val
=
e1000_write_eeprom
(
hw
,
first_word
,
ret_val
=
e1000_write_eeprom
(
hw
,
first_word
,
last_word
-
first_word
+
1
,
eeprom_buff
);
last_word
-
first_word
+
1
,
eeprom_buff
);
...
...
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