diff options
author | Sarveshwar Bandi <sarveshwarb@serverengines.com> | 2009-11-20 14:23:47 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-20 14:23:47 -0800 |
commit | fa9a6fed87df1b50804405e700f8d30251d3aaf1 (patch) | |
tree | 6ff36c19f7fb6f68084f5c7d6f737d7a14c9bd16 /drivers/net/benet/be_cmds.c | |
parent | eb6d02133cf5451fece3a37ccccf2ce7c09a09c1 (diff) | |
download | op-kernel-dev-fa9a6fed87df1b50804405e700f8d30251d3aaf1.zip op-kernel-dev-fa9a6fed87df1b50804405e700f8d30251d3aaf1.tar.gz |
be2net: Patch to flash redboot section while firmware update.
Please apply patch to update redboot section while firmware update. Code
checks if section needs to be updated before actually doing it.
Signed-off-by: Sarveshwar Bandi <sarveshwarb@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_cmds.c')
-rw-r--r-- | drivers/net/benet/be_cmds.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index cc75dd0..808ad0d 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c @@ -1251,3 +1251,32 @@ int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd, spin_unlock_bh(&adapter->mcc_lock); return status; } + +int be_cmd_get_flash_crc(struct be_adapter *adapter, u8 *flashed_crc) +{ + struct be_mcc_wrb *wrb; + struct be_cmd_write_flashrom *req; + int status; + + spin_lock_bh(&adapter->mcc_lock); + + wrb = wrb_from_mccq(adapter); + req = embedded_payload(wrb); + + be_wrb_hdr_prepare(wrb, sizeof(*req)+4, true, 0); + + be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, + OPCODE_COMMON_READ_FLASHROM, sizeof(*req)+4); + + req->params.op_type = cpu_to_le32(FLASHROM_TYPE_REDBOOT); + req->params.op_code = cpu_to_le32(FLASHROM_OPER_REPORT); + req->params.offset = 0x3FFFC; + req->params.data_buf_size = 0x4; + + status = be_mcc_notify_wait(adapter); + if (!status) + memcpy(flashed_crc, req->params.data_buf, 4); + + spin_unlock_bh(&adapter->mcc_lock); + return status; +} |