Add 'pages on|off' to the bash completion for ethtool -m and the ethtool man page. The man page documents that 'pages on' requires 'hex on', describes the per-page header format, and notes that it cannot be combined with offset, length, page, bank or i2c parameters. Assisted-by: Claude:claude-sonnet-4.6 Reviewed-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: Danielle Ratson --- Notes: v3: * Drop "length" from the documented JSON field list; add a note that the "data" array length equals the memory block length. v2: * Document the JSON output format. ethtool.8.in | 19 +++++++++++++++++++ shell-completion/bash/ethtool | 2 ++ 2 files changed, 21 insertions(+) diff --git a/ethtool.8.in b/ethtool.8.in index 32b971a..3173287 100644 --- a/ethtool.8.in +++ b/ethtool.8.in @@ -403,6 +403,7 @@ ethtool \- query or control network driver and hardware settings .I devname .B2 raw on off .B2 hex on off +.B2 pages on off .BN offset .BN length .BN page @@ -1431,6 +1432,24 @@ allowed. In such a case and .I length parameters are treated relatively to EEPROM page boundaries. +When +.B hex on pages on +is specified, dumps all relevant EEPROM pages in hex, organized by page. +Each page is preceded by a header identifying the page number. For banked pages, +the bank number is also shown, and for SFP modules, the I2C address is also +shown, as different parts of the EEPROM memory map are accessible via different +I2C addresses. The set of pages dumped matches what the pretty-printer reads for +each module type. This option cannot be combined with +.I offset, length, page, bank +or +.I i2c +parameters. When combined with +.BI \-\-json , +the output is a JSON object with a "pages" array. Each element is an +object with the fields "bank", "page", "offset", "i2c_address" and "data", +emitted unconditionally regardless of module type. "data" is an array of +lowercase hex strings, one per byte; its length is the length of the +memory block. .TP .B \-\-show\-priv\-flags Queries the specified network device for its private flags. The diff --git a/shell-completion/bash/ethtool b/shell-completion/bash/ethtool index 57c39c4..7a319a9 100644 --- a/shell-completion/bash/ethtool +++ b/shell-completion/bash/ethtool @@ -671,11 +671,13 @@ _ethtool_module_info() [hex]=1 [length]=1 [offset]=1 + [pages]=1 [raw]=1 ) case "$prev" in hex|\ + pages|\ raw) COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) return ;; -- 2.51.0