Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 273531
b: refs/heads/master
c: 331bcf4
h: refs/heads/master
i:
  273529: ec79372
  273527: 4e5cbe1
v: v3
  • Loading branch information
Emil Tantilov authored and Jeff Kirsher committed Nov 2, 2011
1 parent cbb57e5 commit 478b4af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 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: 9487dc844054e1fc691fb82f4e19da337e2ca35e
refs/heads/master: 331bcf45feb76d507a769d9d3b26ff5626804117
20 changes: 11 additions & 9 deletions trunk/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -3344,7 +3344,7 @@ static u8 ixgbe_calculate_checksum(u8 *buffer, u32 length)
static s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
u32 length)
{
u32 hicr, i;
u32 hicr, i, bi;
u32 hdr_size = sizeof(struct ixgbe_hic_hdr);
u8 buf_len, dword_len;

Expand Down Expand Up @@ -3398,9 +3398,9 @@ static s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
dword_len = hdr_size >> 2;

/* first pull in the header so we know the buffer length */
for (i = 0; i < dword_len; i++) {
buffer[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, i);
le32_to_cpus(&buffer[i]);
for (bi = 0; bi < dword_len; bi++) {
buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);
le32_to_cpus(&buffer[bi]);
}

/* If there is any thing in data position pull it in */
Expand All @@ -3414,12 +3414,14 @@ static s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
goto out;
}

/* Calculate length in DWORDs, add one for odd lengths */
dword_len = (buf_len + 1) >> 2;
/* Calculate length in DWORDs, add 3 for odd lengths */
dword_len = (buf_len + 3) >> 2;

/* Pull in the rest of the buffer (i is where we left off)*/
for (; i < buf_len; i++)
buffer[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, i);
/* Pull in the rest of the buffer (bi is where we left off)*/
for (; bi <= dword_len; bi++) {
buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);
le32_to_cpus(&buffer[bi]);
}

out:
return ret_val;
Expand Down

0 comments on commit 478b4af

Please sign in to comment.