Skip to content

Commit 2da244a

Browse files
Sudarsana Reddy Kallurudavem330
authored andcommitted
qed: Fix Config attribute frame format.
MFW associates the entity id to a config attribute instead of assigning one entity id for all the config attributes. This patch incorporates driver changes to link entity id to a config id attribute. Fixes: 0dabbe1 ("qed: Add driver API for flashing the config attributes.") Signed-off-by: Sudarsana Reddy Kalluru <[email protected]> Signed-off-by: Ariel Elior <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9e54ba7 commit 2da244a

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

drivers/net/ethernet/qlogic/qed/qed_main.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2240,12 +2240,13 @@ static int qed_nvm_flash_image_validate(struct qed_dev *cdev,
22402240
/* Binary file format -
22412241
* /----------------------------------------------------------------------\
22422242
* 0B | 0x5 [command index] |
2243-
* 4B | Entity ID | Reserved | Number of config attributes |
2244-
* 8B | Config ID | Length | Value |
2243+
* 4B | Number of config attributes | Reserved |
2244+
* 4B | Config ID | Entity ID | Length |
2245+
* 4B | Value |
22452246
* | |
22462247
* \----------------------------------------------------------------------/
2247-
* There can be several cfg_id-Length-Value sets as specified by 'Number of...'.
2248-
* Entity ID - A non zero entity value for which the config need to be updated.
2248+
* There can be several cfg_id-entity_id-Length-Value sets as specified by
2249+
* 'Number of config attributes'.
22492250
*
22502251
* The API parses config attributes from the user provided buffer and flashes
22512252
* them to the respective NVM path using Management FW inerface.
@@ -2265,18 +2266,17 @@ static int qed_nvm_flash_cfg_write(struct qed_dev *cdev, const u8 **data)
22652266

22662267
/* NVM CFG ID attribute header */
22672268
*data += 4;
2268-
entity_id = **data;
2269-
*data += 2;
22702269
count = *((u16 *)*data);
2271-
*data += 2;
2270+
*data += 4;
22722271

22732272
DP_VERBOSE(cdev, NETIF_MSG_DRV,
2274-
"Read config ids: entity id %02x num _attrs = %0d\n",
2275-
entity_id, count);
2273+
"Read config ids: num_attrs = %0d\n", count);
22762274
/* NVM CFG ID attributes */
22772275
for (i = 0; i < count; i++) {
22782276
cfg_id = *((u16 *)*data);
22792277
*data += 2;
2278+
entity_id = **data;
2279+
(*data)++;
22802280
len = **data;
22812281
(*data)++;
22822282
memcpy(buf, *data, len);
@@ -2286,7 +2286,8 @@ static int qed_nvm_flash_cfg_write(struct qed_dev *cdev, const u8 **data)
22862286
QED_NVM_CFG_SET_FLAGS;
22872287

22882288
DP_VERBOSE(cdev, NETIF_MSG_DRV,
2289-
"cfg_id = %d len = %d\n", cfg_id, len);
2289+
"cfg_id = %d entity = %d len = %d\n", cfg_id,
2290+
entity_id, len);
22902291
rc = qed_mcp_nvm_set_cfg(hwfn, ptt, cfg_id, entity_id, flags,
22912292
buf, len);
22922293
if (rc) {

0 commit comments

Comments
 (0)