Commit ce7393b9 authored by Jeff Kirsher's avatar Jeff Kirsher Committed by Jeff Garzik

[PATCH] e1000: Fixed frame size logic

Simplified the logic used to assign the frame_size.
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: default avatarJohn Ronciak <john.ronciak@intel.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent ff147013
...@@ -1401,7 +1401,7 @@ static void ...@@ -1401,7 +1401,7 @@ static void
e1000_create_lbtest_frame(struct sk_buff *skb, unsigned int frame_size) e1000_create_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
{ {
memset(skb->data, 0xFF, frame_size); memset(skb->data, 0xFF, frame_size);
frame_size = (frame_size % 2) ? (frame_size - 1) : frame_size; frame_size &= ~1;
memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1); memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1);
memset(&skb->data[frame_size / 2 + 10], 0xBE, 1); memset(&skb->data[frame_size / 2 + 10], 0xBE, 1);
memset(&skb->data[frame_size / 2 + 12], 0xAF, 1); memset(&skb->data[frame_size / 2 + 12], 0xAF, 1);
...@@ -1410,7 +1410,7 @@ e1000_create_lbtest_frame(struct sk_buff *skb, unsigned int frame_size) ...@@ -1410,7 +1410,7 @@ e1000_create_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
static int static int
e1000_check_lbtest_frame(struct sk_buff *skb, unsigned int frame_size) e1000_check_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
{ {
frame_size = (frame_size % 2) ? (frame_size - 1) : frame_size; frame_size &= ~1;
if(*(skb->data + 3) == 0xFF) { if(*(skb->data + 3) == 0xFF) {
if((*(skb->data + frame_size / 2 + 10) == 0xBE) && if((*(skb->data + frame_size / 2 + 10) == 0xBE) &&
(*(skb->data + frame_size / 2 + 12) == 0xAF)) { (*(skb->data + frame_size / 2 + 12) == 0xAF)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment