Age | Commit message (Collapse) | Author | Files | Lines |
|
This is partly preparation for use of the new net device features API,
but is useful in its own right.
Replace repetitive code for getting/setting offload flags with data-
driven loops.
This changes error messages to use the same long names for offload
flags as in dump_offload(), and changes various exit codes to 1.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
test_ioctl() verifies an ethtool ioctl structure and either returns a
canned response (if it was as expected) or aborts the test.
Adjust the file redirection in test_cmdline() so that test_ioctl() can
always print error messages.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
Wrap main(), exit(), and resource management so that ethtool commands
can be tested without starting a new process and without leaking.
This will allow deeper teesting that covers ioctl requests and
responses.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
The -m option now allows for retrieval of EEPROM
information form a plug in module such as SFP+. This
shows specific information about the type and
capabilities of the module in use The format can be
easily extended to support other modules types such as
QSFP in future. Raw data dump is also supported.
Signed-off-by: Stuart Hodgson <smhodgson@solarflare.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
[bwh: Rename the long option to '--show-time-stamping']
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
The macro RX_CLS_LOC_ANY is now defined in ethtool(-copy).h with the
same intended semantics and same value as RX_CLS_LOC_UNSPEC.
Change some equality tests to check for the flag RX_CLS_LOC_SPECIAL,
to allow for future support of other special location value.
Remove the special case for RX_CLS_LOC_UNSPEC in
rxclass_print_nfc_rule(), since it is dead code.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
Instead of doing most of the argument parsing in parse_cmdline(),
find the sub-command and (if required) the device name in main()
and do the rest in the sub-command handler function. Pass argc
and argp around in struct cmd_context.
This also tightens up argument parsing slightly: extraneous or missing
arguments will now result in an error in a few cases where they were
previously ignored. All test cases now pass.
Replace sub-command dispatch in doit() with a function pointer
in struct option.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
Preparation for refactoring command-line parsing.
All these test cases pass.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
Replace the fd and ifr arguments to each sub-command handler with
struct cmd_context. Change send_ioctl() to take a pointer to
this context and a pointer to the ethtool_cmd or other structure.
Use send_ioctl() consistently.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
The index must not be negative, so the parameter does not need to be
signed. Division and modulus on signed operands generally cannot be
optimised to right-shift and bitwise-and.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
ethtool-util.h contains all kinds of declarations, not just utility
functions or macros.
ethtool-bitops.h contains just a few extra definitions, and its only
user also includes ethtool-util.h.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|