path: root/internal.h
AgeCommit message (Collapse)AuthorFilesLines
2012-12-03Implemented basic optics diagnostics for SFF-8472Aurelien Guillaume1-0/+3
The current output of -m has been modified so that everything lines up correctly. The --module-info option alias has been added. Signed-off-by: Aurelien Guillaume <> Signed-off-by: Ben Hutchings <>
2012-11-08ethtool: Support et131x registers in -dMark Einon1-0/+3
The et131x register set contains useful details of RX/TX queues for the device. This dumps them with the -d option. Signed-off-by: Mark Einon <> Signed-off-by: Ben Hutchings <>
2012-06-02Regularise offload feature settingsBen Hutchings1-0/+18
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 <>
2012-06-01test: Add test_ioctl() function to support a mock send_ioctl()Ben Hutchings1-0/+10
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 <>
2012-06-01Add output file parameter to dump_hex() and make it externBen Hutchings1-0/+2
Signed-off-by: Ben Hutchings <>
2012-05-23Run tests in-processBen Hutchings1-0/+42
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 <>
2012-05-23ethtool: Addition of -m option to dump module eepromStuart Hodgson1-0/+3
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 <> Signed-off-by: Ben Hutchings <>
2012-05-23Add the command to show the time stamping capabilities.Richard Cochran1-0/+1
Signed-off-by: Richard Cochran <> [bwh: Rename the long option to '--show-time-stamping'] Signed-off-by: Ben Hutchings <>
2012-01-12rxclass: Use RX_CLS_LOC_{ANY,SPECIAL} in place of RX_CLS_LOC_UNSPECBen Hutchings1-2/+0
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 <>
2011-11-03Replace global devname variable with a field in struct cmd_contextBen Hutchings1-0/+1
Signed-off-by: Ben Hutchings <>
2011-11-03Move argument parsing to sub-command functionsBen Hutchings1-1/+3
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 <>
2011-11-03Add test cases for command-line parsingBen Hutchings1-0/+4
Preparation for refactoring command-line parsing. All these test cases pass. Signed-off-by: Ben Hutchings <>
2011-11-01Encapsulate command context in a structureBen Hutchings1-4/+12
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 <>
2011-11-01Fix type of bit-number parameter to set_bit() and clear_bit()Ben Hutchings1-2/+2
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 <>
2011-11-01Combine ethtool-{bitops,util}.h into internal.hBen Hutchings1-0/+164
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 <>