mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-11 11:09:13 +00:00
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: 0dabbe1bb3
("qed: Add driver API for flashing the config attributes.")
Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9e54ba7c37
commit
2da244a5c4
1 changed files with 11 additions and 10 deletions
|
@ -2240,12 +2240,13 @@ static int qed_nvm_flash_image_validate(struct qed_dev *cdev,
|
||||||
/* Binary file format -
|
/* Binary file format -
|
||||||
* /----------------------------------------------------------------------\
|
* /----------------------------------------------------------------------\
|
||||||
* 0B | 0x5 [command index] |
|
* 0B | 0x5 [command index] |
|
||||||
* 4B | Entity ID | Reserved | Number of config attributes |
|
* 4B | Number of config attributes | Reserved |
|
||||||
* 8B | Config ID | Length | Value |
|
* 4B | Config ID | Entity ID | Length |
|
||||||
|
* 4B | Value |
|
||||||
* | |
|
* | |
|
||||||
* \----------------------------------------------------------------------/
|
* \----------------------------------------------------------------------/
|
||||||
* There can be several cfg_id-Length-Value sets as specified by 'Number of...'.
|
* There can be several cfg_id-entity_id-Length-Value sets as specified by
|
||||||
* Entity ID - A non zero entity value for which the config need to be updated.
|
* 'Number of config attributes'.
|
||||||
*
|
*
|
||||||
* The API parses config attributes from the user provided buffer and flashes
|
* The API parses config attributes from the user provided buffer and flashes
|
||||||
* them to the respective NVM path using Management FW inerface.
|
* 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)
|
||||||
|
|
||||||
/* NVM CFG ID attribute header */
|
/* NVM CFG ID attribute header */
|
||||||
*data += 4;
|
*data += 4;
|
||||||
entity_id = **data;
|
|
||||||
*data += 2;
|
|
||||||
count = *((u16 *)*data);
|
count = *((u16 *)*data);
|
||||||
*data += 2;
|
*data += 4;
|
||||||
|
|
||||||
DP_VERBOSE(cdev, NETIF_MSG_DRV,
|
DP_VERBOSE(cdev, NETIF_MSG_DRV,
|
||||||
"Read config ids: entity id %02x num _attrs = %0d\n",
|
"Read config ids: num_attrs = %0d\n", count);
|
||||||
entity_id, count);
|
|
||||||
/* NVM CFG ID attributes */
|
/* NVM CFG ID attributes */
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
cfg_id = *((u16 *)*data);
|
cfg_id = *((u16 *)*data);
|
||||||
*data += 2;
|
*data += 2;
|
||||||
|
entity_id = **data;
|
||||||
|
(*data)++;
|
||||||
len = **data;
|
len = **data;
|
||||||
(*data)++;
|
(*data)++;
|
||||||
memcpy(buf, *data, len);
|
memcpy(buf, *data, len);
|
||||||
|
@ -2286,7 +2286,8 @@ static int qed_nvm_flash_cfg_write(struct qed_dev *cdev, const u8 **data)
|
||||||
QED_NVM_CFG_SET_FLAGS;
|
QED_NVM_CFG_SET_FLAGS;
|
||||||
|
|
||||||
DP_VERBOSE(cdev, NETIF_MSG_DRV,
|
DP_VERBOSE(cdev, NETIF_MSG_DRV,
|
||||||
"cfg_id = %d len = %d\n", cfg_id, len);
|
"cfg_id = %d entity = %d len = %d\n", cfg_id,
|
||||||
|
entity_id, len);
|
||||||
rc = qed_mcp_nvm_set_cfg(hwfn, ptt, cfg_id, entity_id, flags,
|
rc = qed_mcp_nvm_set_cfg(hwfn, ptt, cfg_id, entity_id, flags,
|
||||||
buf, len);
|
buf, len);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
|
|
Loading…
Reference in a new issue