diff options
| -rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c index 834f044be4c3..f1365fef4ed2 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | |||
| @@ -3344,7 +3344,7 @@ static u8 ixgbe_calculate_checksum(u8 *buffer, u32 length) | |||
| 3344 | static s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer, | 3344 | static s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer, |
| 3345 | u32 length) | 3345 | u32 length) |
| 3346 | { | 3346 | { |
| 3347 | u32 hicr, i; | 3347 | u32 hicr, i, bi; |
| 3348 | u32 hdr_size = sizeof(struct ixgbe_hic_hdr); | 3348 | u32 hdr_size = sizeof(struct ixgbe_hic_hdr); |
| 3349 | u8 buf_len, dword_len; | 3349 | u8 buf_len, dword_len; |
| 3350 | 3350 | ||
| @@ -3398,9 +3398,9 @@ static s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer, | |||
| 3398 | dword_len = hdr_size >> 2; | 3398 | dword_len = hdr_size >> 2; |
| 3399 | 3399 | ||
| 3400 | /* first pull in the header so we know the buffer length */ | 3400 | /* first pull in the header so we know the buffer length */ |
| 3401 | for (i = 0; i < dword_len; i++) { | 3401 | for (bi = 0; bi < dword_len; bi++) { |
| 3402 | buffer[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, i); | 3402 | buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi); |
| 3403 | le32_to_cpus(&buffer[i]); | 3403 | le32_to_cpus(&buffer[bi]); |
| 3404 | } | 3404 | } |
| 3405 | 3405 | ||
| 3406 | /* If there is any thing in data position pull it in */ | 3406 | /* If there is any thing in data position pull it in */ |
| @@ -3414,12 +3414,14 @@ static s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer, | |||
| 3414 | goto out; | 3414 | goto out; |
| 3415 | } | 3415 | } |
| 3416 | 3416 | ||
| 3417 | /* Calculate length in DWORDs, add one for odd lengths */ | 3417 | /* Calculate length in DWORDs, add 3 for odd lengths */ |
| 3418 | dword_len = (buf_len + 1) >> 2; | 3418 | dword_len = (buf_len + 3) >> 2; |
| 3419 | 3419 | ||
| 3420 | /* Pull in the rest of the buffer (i is where we left off)*/ | 3420 | /* Pull in the rest of the buffer (bi is where we left off)*/ |
| 3421 | for (; i < buf_len; i++) | 3421 | for (; bi <= dword_len; bi++) { |
| 3422 | buffer[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, i); | 3422 | buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi); |
| 3423 | le32_to_cpus(&buffer[bi]); | ||
| 3424 | } | ||
| 3423 | 3425 | ||
| 3424 | out: | 3426 | out: |
| 3425 | return ret_val; | 3427 | return ret_val; |
