aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>2006-01-12 19:51:12 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-01-17 07:48:03 -0500
commitce7393b93502f52e2ef7259e9e9bc3b1a1fd6799 (patch)
tree16f6e2b774929766aafe834f1749a5c9805fd774
parentff14701350eef6df9b7fc0ae118e1689e141a54c (diff)
[PATCH] e1000: Fixed frame size logic
Simplified the logic used to assign the frame_size. Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: John Ronciak <john.ronciak@intel.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r--drivers/net/e1000/e1000_ethtool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index ad9ca2ac25fa..8363d8d86318 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -1401,7 +1401,7 @@ static void
1401e1000_create_lbtest_frame(struct sk_buff *skb, unsigned int frame_size) 1401e1000_create_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
1402{ 1402{
1403 memset(skb->data, 0xFF, frame_size); 1403 memset(skb->data, 0xFF, frame_size);
1404 frame_size = (frame_size % 2) ? (frame_size - 1) : frame_size; 1404 frame_size &= ~1;
1405 memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1); 1405 memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1);
1406 memset(&skb->data[frame_size / 2 + 10], 0xBE, 1); 1406 memset(&skb->data[frame_size / 2 + 10], 0xBE, 1);
1407 memset(&skb->data[frame_size / 2 + 12], 0xAF, 1); 1407 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)
1410static int 1410static int
1411e1000_check_lbtest_frame(struct sk_buff *skb, unsigned int frame_size) 1411e1000_check_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
1412{ 1412{
1413 frame_size = (frame_size % 2) ? (frame_size - 1) : frame_size; 1413 frame_size &= ~1;
1414 if(*(skb->data + 3) == 0xFF) { 1414 if(*(skb->data + 3) == 0xFF) {
1415 if((*(skb->data + frame_size / 2 + 10) == 0xBE) && 1415 if((*(skb->data + frame_size / 2 + 10) == 0xBE) &&
1416 (*(skb->data + frame_size / 2 + 12) == 0xAF)) { 1416 (*(skb->data + frame_size / 2 + 12) == 0xAF)) {