ethtool: Add support for writing firmware
Subsystems (3)
cover ethtool: Add support for writing firmware
In the CMIS specification for pluggable modules, LPL (Local Payload) and EPL (Extended Payload) are two types of data payloads used for managing various functions and features of the module.
EPL payloads are used for more complex and extensive management functions that require a larger amount of data, so writing firmware blocks using EPL is much more efficient.
Currently, only LPL payload is supported for writing firmware blocks to the module.
Add support for writing firmware block using EPL payload, both to support modules that support only EPL write mechanism, and to optimize the flashing process of modules that support LPL and EPL.
Running the flashing command on the same sample module using EPL vs. LPL showed an improvement of 84%.
Patchset overview:
Patch #1: preparations
Patch #2: Add EPL support
Danielle Ratson (2):
net: ethtool: Add new parameters and a function to support EPL
net: ethtool: Add support for writing firmware blocks using EPL
payload
net/ethtool/cmis.h | 16 ++++-- net/ethtool/cmis_cdb.c | 94 +++++++++++++++++++++++++----- net/ethtool/cmis_fw_update.c | 108 +++++++++++++++++++++++++++++------ 3 files changed, 184 insertions(+), 34 deletions(-)
Signature · 1 line
2.45.0
PATCH 1/2 net: ethtool: Add new parameters and a function to support EPL
In the CMIS specification for pluggable modules, LPL (Low-Priority Payload) and EPL (Extended Payload Length) are two types of data payloads used for managing various functions and features of the module.
EPL payloads are used for more complex and extensive management functions that require a larger amount of data, so writing firmware blocks using EPL is much more efficient.
Currently, only LPL payload is supported for writing firmware blocks to the module.
Add EPL related parameters to the function ethtool_cmis_cdb_compose_args() and add a specific function for calculating the maximum allowable length extension for EPL. Both will be used in the next patch to add support for writing firmware blocks using EPL.
--- net/ethtool/cmis.h | 12 +++++++----- net/ethtool/cmis_cdb.c | 32 +++++++++++++++++++++----------- net/ethtool/cmis_fw_update.c | 17 ++++++++++------- 3 files changed, 38 insertions(+), 23 deletions(-)
net/ethtool/cmis.h +7 -5
@@ -96,13 +96,15 @@ struct ethtool_cmis_cdb_rpl {u8 payload[ETHTOOL_CMIS_CDB_LPL_MAX_PL_LENGTH ]; }; -u32 ethtool_cmis_get_max_payload_size (u8 num_of_byte_octs); +u32 ethtool_cmis_get_max_lpl_size (u8 num_of_byte_octs); +u32 ethtool_cmis_get_max_epl_size (u8 num_of_byte_octs);void ethtool_cmis_cdb_compose_args (struct ethtool_cmis_cdb_cmd_args *args, -enum ethtool_cmis_cdb_cmd_id cmd,u8 *pl, -u8 lpl_len,u16 max_duration, -u8 read_write_len_ext,u16 msleep_pre_rpl, -u8 rpl_exp_len,u8 flags); +enum ethtool_cmis_cdb_cmd_id cmd,u8 *lpl, +u8 lpl_len,u8 *epl,u16 epl_len, +u16 max_duration,u8 read_write_len_ext, +u16 msleep_pre_rpl,u8 rpl_exp_len, +u8 flags);void ethtool_cmis_cdb_check_completion_flag (u8 cmis_rev,u8 *flags);
net/ethtool/cmis_cdb.c +21 -11
@@ -11,25 +11,34 @@* min(i, 15) byte octets where i specifies the allowable additional number of * byte octets in a READ or a WRITE. */ -u32 ethtool_cmis_get_max_payload_size (u8 num_of_byte_octs) +u32 ethtool_cmis_get_max_lpl_size (u8 num_of_byte_octs) {return 8 * (1 +min_t (u8, num_of_byte_octs,15 )); } +/* For accessing the EPL field on page 9Fh, the allowable length extension is +* min(i, 255) byte octets where i specifies the allowable additional number of +* byte octets in a READ or a WRITE. +*/ +u32 ethtool_cmis_get_max_epl_size (u8 num_of_byte_octs) +{ +return 8 * (1 +min_t (u8, num_of_byte_octs,255 )); +} +void ethtool_cmis_cdb_compose_args (struct ethtool_cmis_cdb_cmd_args *args, -enum ethtool_cmis_cdb_cmd_id cmd,u8 *pl, -u8 lpl_len,u16 max_duration, -u8 read_write_len_ext,u16 msleep_pre_rpl, -u8 rpl_exp_len,u8 flags) +enum ethtool_cmis_cdb_cmd_id cmd,u8 *lpl, +u8 lpl_len,u8 *epl,u16 epl_len, +u16 max_duration,u8 read_write_len_ext, +u16 msleep_pre_rpl,u8 rpl_exp_len,u8 flags) { args->req.id =cpu_to_be16 (cmd); args->req.lpl_len = lpl_len; -if (pl) -memcpy (args->req.payload, pl, args->req.lpl_len); +if (lpl) +memcpy (args->req.payload, lpl, args->req.lpl_len); args->max_duration = max_duration; args->read_write_len_ext = -ethtool_cmis_get_max_payload_size (read_write_len_ext); +ethtool_cmis_get_max_lpl_size (read_write_len_ext); args->msleep_pre_rpl = msleep_pre_rpl; args->rpl_exp_len = rpl_exp_len; args->flags = flags;
@@ -178,7 +187,7 @@ cmis_cdb_validate_password(struct ethtool_cmis_cdb *cdb, }ethtool_cmis_cdb_compose_args (&args,ETHTOOL_CMIS_CDB_CMD_QUERY_STATUS , - (u8 *)&qs_pl,sizeof (qs_pl),0 , + (u8 *)&qs_pl,sizeof (qs_pl),NULL ,0 ,0 , cdb->read_write_len_ext,1000 ,sizeof (*rpl),CDB_F_COMPLETION_VALID |CDB_F_STATUS_VALID );
@@ -240,8 +249,9 @@ static int cmis_cdb_module_features_get(struct ethtool_cmis_cdb *cdb,ethtool_cmis_cdb_check_completion_flag (cdb->cmis_rev, &flags);ethtool_cmis_cdb_compose_args (&args,ETHTOOL_CMIS_CDB_CMD_MODULE_FEATURES , -NULL ,0 ,0 , cdb->read_write_len_ext, -1000 ,sizeof (*rpl), flags); +NULL ,0 ,NULL ,0 ,0 , + cdb->read_write_len_ext,1000 , +sizeof (*rpl), flags); err =ethtool_cmis_cdb_execute_cmd (dev, &args);if (err <0 ) {
net/ethtool/cmis_fw_update.c +10 -7
@@ -54,7 +54,8 @@ cmis_fw_update_fw_mng_features_get(struct ethtool_cmis_cdb *cdb,ethtool_cmis_cdb_check_completion_flag (cdb->cmis_rev, &flags);ethtool_cmis_cdb_compose_args (&args,ETHTOOL_CMIS_CDB_CMD_FW_MANAGMENT_FEATURES , -NULL ,0 , cdb->max_completion_time, +NULL ,0 ,NULL ,0 , + cdb->max_completion_time, cdb->read_write_len_ext,1000 ,sizeof (*rpl), flags);
@@ -122,7 +123,7 @@ cmis_fw_update_start_download(struct ethtool_cmis_cdb *cdb,ethtool_cmis_cdb_compose_args (&args,ETHTOOL_CMIS_CDB_CMD_START_FW_DOWNLOAD , - (u8 *)&pl, lpl_len, + (u8 *)&pl, lpl_len,NULL ,0 , fw_mng->max_duration_start, cdb->read_write_len_ext,1000 ,0 ,CDB_F_COMPLETION_VALID |CDB_F_STATUS_VALID );
@@ -158,7 +159,7 @@ cmis_fw_update_write_image(struct ethtool_cmis_cdb *cdb,int err; max_lpl_len =min_t (u32, -ethtool_cmis_get_max_payload_size (cdb->read_write_len_ext), +ethtool_cmis_get_max_lpl_size (cdb->read_write_len_ext),ETHTOOL_CMIS_CDB_LPL_MAX_PL_LENGTH ); max_block_size = max_lpl_len - sizeof_field(struct cmis_cdb_write_fw_block_lpl_pl,
@@ -183,7 +184,7 @@ cmis_fw_update_write_image(struct ethtool_cmis_cdb *cdb,ethtool_cmis_cdb_compose_args (&args,ETHTOOL_CMIS_CDB_CMD_WRITE_FW_BLOCK_LPL , - (u8 *)&pl, lpl_len, + (u8 *)&pl, lpl_len,NULL ,0 , fw_mng->max_duration_write, cdb->read_write_len_ext,1 ,0 ,CDB_F_COMPLETION_VALID |CDB_F_STATUS_VALID );
@@ -212,7 +213,8 @@ cmis_fw_update_complete_download(struct ethtool_cmis_cdb *cdb,ethtool_cmis_cdb_compose_args (&args,ETHTOOL_CMIS_CDB_CMD_COMPLETE_FW_DOWNLOAD , -NULL ,0 , fw_mng->max_duration_complete, +NULL ,0 ,NULL ,0 , + fw_mng->max_duration_complete, cdb->read_write_len_ext,1000 ,0 ,CDB_F_COMPLETION_VALID |CDB_F_STATUS_VALID );
@@ -294,7 +296,7 @@ cmis_fw_update_run_image(struct ethtool_cmis_cdb *cdb, struct net_device *dev,int err;ethtool_cmis_cdb_compose_args (&args,ETHTOOL_CMIS_CDB_CMD_RUN_FW_IMAGE , - (u8 *)&pl,sizeof (pl), + (u8 *)&pl,sizeof (pl),NULL ,0 , cdb->max_completion_time, cdb->read_write_len_ext,1000 ,0 ,CDB_F_MODULE_STATE_VALID );
@@ -326,7 +328,8 @@ cmis_fw_update_commit_image(struct ethtool_cmis_cdb *cdb,ethtool_cmis_cdb_compose_args (&args,ETHTOOL_CMIS_CDB_CMD_COMMIT_FW_IMAGE , -NULL ,0 , cdb->max_completion_time, +NULL ,0 ,NULL ,0 , + cdb->max_completion_time, cdb->read_write_len_ext,1000 ,0 ,CDB_F_COMPLETION_VALID |CDB_F_STATUS_VALID );
Signature · 1 line
2.45.0
PATCH 2/2 net: ethtool: Add support for writing firmware blocks using EPL payload
In reply to Danielle RatsonIn the CMIS specification for pluggable modules, LPL (Low-Priority Payload) and EPL (Extended Payload Length) are two types of data payloads used for managing various functions and features of the module.
EPL payloads are used for more complex and extensive management functions that require a larger amount of data, so writing firmware blocks using EPL is much more efficient.
Currently, only LPL payload is supported for writing firmware blocks to the module.
Add support for writing firmware block using EPL payload, both to support modules that supports only EPL write mechanism, and to optimize the flashing process of modules that support LPL and EPL.
--- net/ethtool/cmis.h | 4 ++ net/ethtool/cmis_cdb.c | 66 ++++++++++++++++++++++++-- net/ethtool/cmis_fw_update.c | 91 ++++++++++++++++++++++++++++++++---- 3 files changed, 148 insertions(+), 13 deletions(-)
net/ethtool/cmis.h +4 -0
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: GPL-2.0-only */ #define ETHTOOL_CMIS_CDB_LPL_MAX_PL_LENGTH 120 +#define ETHTOOL_CMIS_CDB_EPL_MAX_PL_LENGTH 2048#define ETHTOOL_CMIS_CDB_CMD_PAGE 0x9F#define ETHTOOL_CMIS_CDB_PAGE_I2C_ADDR 0x50
@@ -23,6 +24,7 @@ enum ethtool_cmis_cdb_cmd_id {ETHTOOL_CMIS_CDB_CMD_FW_MANAGMENT_FEATURES =0x0041 ,ETHTOOL_CMIS_CDB_CMD_START_FW_DOWNLOAD =0x0101 ,ETHTOOL_CMIS_CDB_CMD_WRITE_FW_BLOCK_LPL =0x0103 , +ETHTOOL_CMIS_CDB_CMD_WRITE_FW_BLOCK_EPL =0x0104 ,ETHTOOL_CMIS_CDB_CMD_COMPLETE_FW_DOWNLOAD =0x0107 ,ETHTOOL_CMIS_CDB_CMD_RUN_FW_IMAGE =0x0109 , ETHTOOL_CMIS_CDB_CMD_COMMIT_FW_IMAGE = 0x010A,
@@ -38,6 +40,7 @@ enum ethtool_cmis_cdb_cmd_id {* @resv1: Added to match the CMIS standard request continuity. * @resv2: Added to match the CMIS standard request continuity. * @payload: Payload for the CDB commands. +* @epl: Extended payload for the CDB commands. */ struct ethtool_cmis_cdb_request {__be16 id;
@@ -49,6 +52,7 @@ struct ethtool_cmis_cdb_request {u8 resv2;u8 payload[ETHTOOL_CMIS_CDB_LPL_MAX_PL_LENGTH ]; ); +u8 *epl;/* Everything above this field checksummed. */ };#define CDB_F_COMPLETION_VALID BIT(0)
net/ethtool/cmis_cdb.c +62 -4
93 lines not on this page · raw message
net/ethtool/cmis_fw_update.c +82 -9
135 lines not on this page · raw message
Signature · 1 line
2.45.0
Andrew Lunn
maintainerRe: [PATCH net-next 1/2] net: ethtool: Add new parameters and a function to support EPL
In reply to Danielle Ratsonnet/ethtool/cmis_cdb.c line 26
Quoted 8 lines
net/ethtool/cmis_cdb.c +8
-0+/* For accessing the EPL field on page 9Fh, the allowable length extension is +* min(i, 255) byte octets where i specifies the allowable additional number of +* byte octets in a READ or a WRITE. +*/ +u32 ethtool_cmis_get_max_epl_size (u8 num_of_byte_octs) +{ +return 8 * (1 +min_t (u8, num_of_byte_octs,255 )); +}
Does this get mapped to a 255 byte I2C bus transfer?
https://elixir.bootlin.com/linux/v6.11-rc6/source/drivers/net/phy/sfp.c#L218
/* SFP_EEPROM_BLOCK_SIZE is the size of data chunk to read the EEPROM
* at a time. Some SFP modules and also some Linux I2C drivers do not like
* reads longer than 16 bytes.
*/
#define SFP_EEPROM_BLOCK_SIZE 16
If an SMBUS is being used, rather than I2C, there is a hard limit of 32 bytes in a message transfer.
I've not looked in details at these patches, but maybe you need a mechanism to ask the hardware or I2C driver what it can actually do? Is it possible to say LPL is the only choice?
Andrew
Simon Horman
reviewerRe: [PATCH net-next 2/2] net: ethtool: Add support for writing firmware blocks using EPL payload
In reply to Danielle RatsonQuoted 17 lines · Danielle Ratson
In the CMIS specification for pluggable modules, LPL (Low-Priority Payload) and EPL (Extended Payload Length) are two types of data payloads used for managing various functions and features of the module.
EPL payloads are used for more complex and extensive management functions that require a larger amount of data, so writing firmware blocks using EPL is much more efficient.
Currently, only LPL payload is supported for writing firmware blocks to the module.
Add support for writing firmware block using EPL payload, both to support modules that supports only EPL write mechanism, and to optimize the flashing process of modules that support LPL and EPL.
Signed-off-by Danielle Ratson <[email protected]>Reviewed-by Petr Machata <[email protected]>
...
Quoted 1 line
net/ethtool/cmis_cdb.c +0
-0
...
Quoted 8 lines
net/ethtool/cmis_cdb.c +4
-0@@ -548,6 +555,49 @@ __ethtool_cmis_cdb_execute_cmd(struct net_device *dev,return err; } +#define CMIS_CDB_EPL_PAGE_START 0xA0 +#define CMIS_CDB_EPL_PAGE_END 0xAF +#define CMIS_CDB_EPL_FW_BLOCK_OFFSET_START 128 +#define CMIS_CDB_EPL_FW_BLOCK_OFFSET_END 255
net/ethtool/cmis_cdb.c __ethtool_cmis_cdb_execute_cmd(struct net_device *dev, · line 571
Quoted 10 lines
net/ethtool/cmis_cdb.c +10
-0+ +static int +ethtool_cmis_cdb_execute_epl_cmd (struct net_device *dev, +struct ethtool_cmis_cdb_cmd_args *args, +struct ethtool_module_eeprom *page_data) +{ +u16 epl_len =be16_to_cpu (args->req.epl_len); +u32 bytes_written; +u8 page; +int err;
Hi Danielle,
A minor issue from my side:
In the first iteration of the loop below bytes_written is used uninitialised.
Flagged by W=1 builds using clang-18 and gcc-14.
Quoted 32 lines
net/ethtool/cmis_cdb.c +29
-0+ +for (page =CMIS_CDB_EPL_PAGE_START ; + page <=CMIS_CDB_EPL_PAGE_END && bytes_written < epl_len; page++) { +u16 offset =CMIS_CDB_EPL_FW_BLOCK_OFFSET_START ; + +while (offset <=CMIS_CDB_EPL_FW_BLOCK_OFFSET_END && + bytes_written < epl_len) { +u32 bytes_left = epl_len - bytes_written; +u16 space_left, bytes_to_write; + + space_left =CMIS_CDB_EPL_FW_BLOCK_OFFSET_END - offset +1 ; + bytes_to_write =min_t (u16, bytes_left, +min_t (u16, space_left, + args->read_write_len_ext)); + + err =__ethtool_cmis_cdb_execute_cmd (dev, page_data, + page, offset, + bytes_to_write, + args->req.epl + bytes_written); +if (err <0 ) +return err; + + offset += bytes_to_write; + bytes_written += bytes_to_write; + } + } +return 0 ; +} +static u8 cmis_cdb_calc_checksum (const void *data,size_t size) {const u8 *bytes = (const u8 *)data;
Signature · 1 line
pw-bot: cr
RE: [PATCH net-next 1/2] net: ethtool: Add new parameters and a function to support EPL
In reply to Andrew LunnQuoted 28 lines
From: Andrew Lunn <[email protected]>
Sent: Friday, 6 September 2024 18:36
To: Danielle Ratson <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; Petr Machata <[email protected]>
Subject: Re: [PATCH net-next 1/2] net: ethtool: Add new parameters and a function to support EPLReview
Quoted 8 lines
(quoted diff) +8
-0+/* For accessing the EPL field on page 9Fh, the allowable length +extension is + * min(i, 255) byte octets where i specifies the allowable additional +number of + * byte octets in a READ or a WRITE. + */ +u32 ethtool_cmis_get_max_epl_size(u8 num_of_byte_octs) { + return 8 * (1 + min_t(u8, num_of_byte_octs, 255)); }Does this get mapped to a 255 byte I2C bus transfer?
https://elixir.bootlin.com/linux/v6.11-rc6/source/drivers/net/phy/sfp.c#L218
/*
SFP_EEPROM_BLOCK_SIZEis the size of data chunk to read the EEPROM
* at a time. Some SFP modules and also some Linux I2C drivers do not like
* reads longer than 16 bytes.
*/
#defineSFP_EEPROM_BLOCK_SIZE16
Quoted 8 lines
If an SMBUS is being used, rather than I2C, there is a hard limit of 32 bytes in a message transfer.
I've not looked in details at these patches, but maybe you need a mechanism to ask the hardware or I2C driver what it can actually do?
Is it possible to say LPL is the only choice?Andrew
Hi Andrew,
Thanks for your reply.
As I wrote in the commit message, the EPL is an extended type of data payload in which you can send the firmware image, for example, in blocks.
The LPL contains ap to 128 bytes, and the EPL up to 2048. The exact allowed extension can be derived from the 'readWriteLengthExt' and the two functions (ethtool_cmis_get_max_lpl/epl_size ()) that calculates the specific value of the module from it.
The obligations on the chunks that are related to the bus type limit, should be referred to in the driver itself.
The driver should be the responsible for bus that cannot read/write larger chunks and then split it to the supported size chunks accordingly.
Hope it makes more sense now.
Thanks,
Danielle
RE: [PATCH net-next 2/2] net: ethtool: Add support for writing firmware blocks using EPL payload
In reply to Simon HormanQuoted 58 lines
-----Original Message-----
From: Simon Horman <[email protected]>
Sent: Saturday, 7 September 2024 17:11
To: Danielle Ratson <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; Petr Machata <[email protected]>
Subject: Re: [PATCH net-next 2/2] net: ethtool: Add support for writing firmware blocks using EPL payloadQuoted 17 lines · Danielle Ratson
In the CMIS specification for pluggable modules, LPL (Low-Priority Payload) and EPL (Extended Payload Length) are two types of data payloads used for managing various functions and features of the module.
EPL payloads are used for more complex and extensive management functions that require a larger amount of data, so writing firmware blocks using EPL is much more efficient.
Currently, only LPL payload is supported for writing firmware blocks to the module.
Add support for writing firmware block using EPL payload, both to support modules that supports only EPL write mechanism, and to optimize the flashing process of modules that support LPL and EPL.
Signed-off-by Danielle Ratson <[email protected]>Reviewed-by Petr Machata <[email protected]>...
Quoted 1 line
net/ethtool/cmis_cdb.c +0
-0...
net/ethtool/cmis_cdb.c __ethtool_cmis_cdb_execute_cmd(struct
Quoted 1 line
net/ethtool/cmis_cdb.c +0
-0@@ -548,6 +555,49 @@ __ethtool_cmis_cdb_execute_cmd(struct
net_device*dev,Quoted 6 lines
net/ethtool/cmis_cdb.c +3
-0return err; } +#define CMIS_CDB_EPL_PAGE_START 0xA0 +#define CMIS_CDB_EPL_PAGE_END 0xAF +#define CMIS_CDB_EPL_FW_BLOCK_OFFSET_START 128net/ethtool/cmis_cdb.c __ethtool_cmis_cdb_execute_cmd(struct net_device *dev, · line 571
Quoted 10 lines
net/ethtool/cmis_cdb.c +10
-0+#define CMIS_CDB_EPL_FW_BLOCK_OFFSET_END 255 + +static int +ethtool_cmis_cdb_execute_epl_cmd (struct net_device *dev, +struct ethtool_cmis_cdb_cmd_args *args, +struct ethtool_module_eeprom *page_data) { +u16 epl_len =be16_to_cpu (args->req.epl_len); +u32 bytes_written; +u8 page; +int err;Hi Danielle,
Quoted 4 lines
A minor issue from my side:
In the first iteration of the loop belowbytes_writtenis used uninitialised.Flagged by W=1 builds using clang-18 and gcc-14.
Hi,
Will fix thanks!
Danielle
Quoted 39 lines
net/ethtool/cmis_cdb.c __ethtool_cmis_cdb_execute_cmd(struct net_device *dev,
Quoted 4 lines
net/ethtool/cmis_cdb.c +3
-0+ + for (page = CMIS_CDB_EPL_PAGE_START; + page <= CMIS_CDB_EPL_PAGE_END && bytes_written < epl_len;page++) {
net/ethtool/cmis_cdb.c __ethtool_cmis_cdb_execute_cmd(struct net_device *dev,
Quoted 8 lines
net/ethtool/cmis_cdb.c +8
-0+u16 offset =CMIS_CDB_EPL_FW_BLOCK_OFFSET_START ; + +while (offset <=CMIS_CDB_EPL_FW_BLOCK_OFFSET_END && + bytes_written < epl_len) { +u32 bytes_left = epl_len - bytes_written; +u16 space_left, bytes_to_write; + + space_left =CMIS_CDB_EPL_FW_BLOCK_OFFSET_END - offset + 1;
net/ethtool/cmis_cdb.c __ethtool_cmis_cdb_execute_cmd(struct net_device *dev,
Quoted 5 lines
net/ethtool/cmis_cdb.c +5
-0+ bytes_to_write =min_t (u16, bytes_left, +min_t (u16, space_left, + args->read_write_len_ext)); + + err = __ethtool_cmis_cdb_execute_cmd(dev,
page_data,net/ethtool/cmis_cdb.c __ethtool_cmis_cdb_execute_cmd(struct net_device *dev,
Quoted 3 lines
net/ethtool/cmis_cdb.c +3
-0+ page, offset, + bytes_to_write, + args->req.epl +
bytes_written);net/ethtool/cmis_cdb.c __ethtool_cmis_cdb_execute_cmd(struct net_device *dev, · line 603
Quoted 12 lines
net/ethtool/cmis_cdb.c +10
-0+if (err <0 ) +return err; + + offset += bytes_to_write; + bytes_written += bytes_to_write; + } + } +return 0 ; +} +static u8 cmis_cdb_calc_checksum (const void *data,size_t size) {const u8 *bytes = (const u8 *)data;--
pw-bot: cr