Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369355
b: refs/heads/master
c: 30c20b6
h: refs/heads/master
i:
  369353: 1c4b1ad
  369351: 7a7a892
v: v3
  • Loading branch information
Dmitry Kravkov authored and David S. Miller committed Apr 22, 2013
1 parent 9c2fb60 commit f7ea734
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 85640952c5d76553a7ed543b355527e2b2b57b29
refs/heads/master: 30c20b67abf42b79b204820cc610caf368670feb
15 changes: 7 additions & 8 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1569,9 +1569,8 @@ static int bnx2x_nvram_write1(struct bnx2x *bp, u32 offset, u8 *data_buf,
int buf_size)
{
int rc;
u32 cmd_flags;
u32 align_offset;
__be32 val;
u32 cmd_flags, align_offset, val;
__be32 val_be;

if (offset + buf_size > bp->common.flash_size) {
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
Expand All @@ -1590,16 +1589,16 @@ static int bnx2x_nvram_write1(struct bnx2x *bp, u32 offset, u8 *data_buf,

cmd_flags = (MCPR_NVM_COMMAND_FIRST | MCPR_NVM_COMMAND_LAST);
align_offset = (offset & ~0x03);
rc = bnx2x_nvram_read_dword(bp, align_offset, &val, cmd_flags);
rc = bnx2x_nvram_read_dword(bp, align_offset, &val_be, cmd_flags);

if (rc == 0) {
val &= ~(0xff << BYTE_OFFSET(offset));
val |= (*data_buf << BYTE_OFFSET(offset));

/* nvram data is returned as an array of bytes
* convert it back to cpu order
*/
val = be32_to_cpu(val);
val = be32_to_cpu(val_be);

val &= ~le32_to_cpu(0xff << BYTE_OFFSET(offset));
val |= le32_to_cpu(*data_buf << BYTE_OFFSET(offset));

rc = bnx2x_nvram_write_dword(bp, align_offset, val,
cmd_flags);
Expand Down

0 comments on commit f7ea734

Please sign in to comment.