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
02891c60
Commit
02891c60
authored
Aug 23, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ETHTOOL]: Add {G,S}TSO support to ethtool_ops.
parent
ef71cd43
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
include/linux/ethtool.h
include/linux/ethtool.h
+4
-0
net/core/ethtool.c
net/core/ethtool.c
+31
-0
No files found.
include/linux/ethtool.h
View file @
02891c60
...
@@ -284,6 +284,8 @@ int ethtool_op_set_sg(struct net_device *dev, u32 data);
...
@@ -284,6 +284,8 @@ int ethtool_op_set_sg(struct net_device *dev, u32 data);
* set_tx_csum: Turn transmit checksums on or off
* set_tx_csum: Turn transmit checksums on or off
* get_sg: Report whether scatter-gather is enabled
* get_sg: Report whether scatter-gather is enabled
* set_sg: Turn scatter-gather on or off
* set_sg: Turn scatter-gather on or off
* get_tso: Report whether TCP segmentation offload is enabled
* set_tso: Turn TCP segmentation offload on or off
* self_test: Run specified self-tests
* self_test: Run specified self-tests
* get_strings: Return a set of strings that describe the requested objects
* get_strings: Return a set of strings that describe the requested objects
* phys_id: Identify the device
* phys_id: Identify the device
...
@@ -337,6 +339,8 @@ struct ethtool_ops {
...
@@ -337,6 +339,8 @@ struct ethtool_ops {
int
(
*
set_tx_csum
)(
struct
net_device
*
,
u32
);
int
(
*
set_tx_csum
)(
struct
net_device
*
,
u32
);
u32
(
*
get_sg
)(
struct
net_device
*
);
u32
(
*
get_sg
)(
struct
net_device
*
);
int
(
*
set_sg
)(
struct
net_device
*
,
u32
);
int
(
*
set_sg
)(
struct
net_device
*
,
u32
);
u32
(
*
get_tso
)(
struct
net_device
*
);
int
(
*
set_tso
)(
struct
net_device
*
,
u32
);
int
(
*
self_test_count
)(
struct
net_device
*
);
int
(
*
self_test_count
)(
struct
net_device
*
);
void
(
*
self_test
)(
struct
net_device
*
,
struct
ethtool_test
*
,
u64
*
);
void
(
*
self_test
)(
struct
net_device
*
,
struct
ethtool_test
*
,
u64
*
);
void
(
*
get_strings
)(
struct
net_device
*
,
u32
stringset
,
u8
*
);
void
(
*
get_strings
)(
struct
net_device
*
,
u32
stringset
,
u8
*
);
...
...
net/core/ethtool.c
View file @
02891c60
...
@@ -454,6 +454,33 @@ static int ethtool_set_sg(struct net_device *dev, char *useraddr)
...
@@ -454,6 +454,33 @@ static int ethtool_set_sg(struct net_device *dev, char *useraddr)
return
dev
->
ethtool_ops
->
set_sg
(
dev
,
edata
.
data
);
return
dev
->
ethtool_ops
->
set_sg
(
dev
,
edata
.
data
);
}
}
static
int
ethtool_get_tso
(
struct
net_device
*
dev
,
char
*
useraddr
)
{
struct
ethtool_value
edata
=
{
ETHTOOL_GTSO
};
if
(
!
dev
->
ethtool_ops
->
get_tso
)
return
-
EOPNOTSUPP
;
edata
.
data
=
dev
->
ethtool_ops
->
get_tso
(
dev
);
if
(
copy_to_user
(
useraddr
,
&
edata
,
sizeof
(
edata
)))
return
-
EFAULT
;
return
0
;
}
static
int
ethtool_set_tso
(
struct
net_device
*
dev
,
char
*
useraddr
)
{
struct
ethtool_value
edata
;
if
(
!
dev
->
ethtool_ops
->
set_tso
)
return
-
EOPNOTSUPP
;
if
(
copy_from_user
(
&
edata
,
useraddr
,
sizeof
(
edata
)))
return
-
EFAULT
;
return
dev
->
ethtool_ops
->
set_tso
(
dev
,
edata
.
data
);
}
static
int
ethtool_self_test
(
struct
net_device
*
dev
,
char
*
useraddr
)
static
int
ethtool_self_test
(
struct
net_device
*
dev
,
char
*
useraddr
)
{
{
struct
ethtool_test
test
;
struct
ethtool_test
test
;
...
@@ -653,6 +680,10 @@ int dev_ethtool(struct ifreq *ifr)
...
@@ -653,6 +680,10 @@ int dev_ethtool(struct ifreq *ifr)
return
ethtool_get_sg
(
dev
,
useraddr
);
return
ethtool_get_sg
(
dev
,
useraddr
);
case
ETHTOOL_SSG
:
case
ETHTOOL_SSG
:
return
ethtool_set_sg
(
dev
,
useraddr
);
return
ethtool_set_sg
(
dev
,
useraddr
);
case
ETHTOOL_GTSO
:
return
ethtool_get_tso
(
dev
,
useraddr
);
case
ETHTOOL_STSO
:
return
ethtool_set_tso
(
dev
,
useraddr
);
case
ETHTOOL_TEST
:
case
ETHTOOL_TEST
:
return
ethtool_self_test
(
dev
,
useraddr
);
return
ethtool_self_test
(
dev
,
useraddr
);
case
ETHTOOL_GSTRINGS
:
case
ETHTOOL_GSTRINGS
:
...
...
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