From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, gospo@redhat.com,
Bruce Allan <bruce.w.allan@intel.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-2.6 PATCH 4/5] e1000e: e1000e_enable_tx_pkt_filtering() returns wrong value
Date: Thu, 07 Jan 2010 18:31:54 -0800 [thread overview]
Message-ID: <20100108023153.31476.89128.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100108023033.31476.4034.stgit@localhost.localdomain>
From: Bruce Allan <bruce.w.allan@intel.com>
e1000e_enable_tx_pkt_filtering() will return a non-zero value if the
driver fails to enable the manageability interface on the host for
any reason; instead it should retun zero to indicate filtering has been
disabled. Also provide a single exit point for the function.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000e/lib.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
index 56b59e4..97649bf 100644
--- a/drivers/net/e1000e/lib.c
+++ b/drivers/net/e1000e/lib.c
@@ -2301,10 +2301,12 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
s32 ret_val, hdr_csum, csum;
u8 i, len;
+ hw->mac.tx_pkt_filtering = true;
+
/* No manageability, no filtering */
if (!e1000e_check_mng_mode(hw)) {
hw->mac.tx_pkt_filtering = false;
- return 0;
+ goto out;
}
/*
@@ -2312,9 +2314,9 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
* reason, disable filtering.
*/
ret_val = e1000_mng_enable_host_if(hw);
- if (ret_val != 0) {
+ if (ret_val) {
hw->mac.tx_pkt_filtering = false;
- return ret_val;
+ goto out;
}
/* Read in the header. Length and offset are in dwords. */
@@ -2333,17 +2335,17 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
*/
if ((hdr_csum != csum) || (hdr->signature != E1000_IAMT_SIGNATURE)) {
hw->mac.tx_pkt_filtering = true;
- return 1;
+ goto out;
}
/* Cookie area is valid, make the final check for filtering. */
if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING)) {
hw->mac.tx_pkt_filtering = false;
- return 0;
+ goto out;
}
- hw->mac.tx_pkt_filtering = true;
- return 1;
+out:
+ return hw->mac.tx_pkt_filtering;
}
/**
next prev parent reply other threads:[~2010-01-08 2:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-08 2:30 [net-2.6 PATCH 1/5] e1000e: call pci_save_state() after pci_restore_state() Jeff Kirsher
2010-01-08 2:31 ` [net-2.6 PATCH 2/5] e1000e: don't accumulate PHY statistics on PHY read failure Jeff Kirsher
2010-01-08 8:39 ` David Miller
2010-01-08 2:31 ` [net-2.6 PATCH 3/5] e1000e: perform 10/100 adaptive IFS only on parts that support it Jeff Kirsher
2010-01-08 8:39 ` David Miller
2010-01-08 2:31 ` Jeff Kirsher [this message]
2010-01-08 8:39 ` [net-2.6 PATCH 4/5] e1000e: e1000e_enable_tx_pkt_filtering() returns wrong value David Miller
2010-01-08 2:32 ` [net-2.6 PATCH 5/5] e1000e: fix and commonize code for setting the receive address registers Jeff Kirsher
2010-01-08 8:39 ` David Miller
2010-01-08 7:52 ` [net-2.6 PATCH 1/5] e1000e: call pci_save_state() after pci_restore_state() David Miller
2010-01-08 7:59 ` Jeff Kirsher
2010-01-08 8:39 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100108023153.31476.89128.stgit@localhost.localdomain \
--to=jeffrey.t.kirsher@intel.com \
--cc=bruce.w.allan@intel.com \
--cc=davem@davemloft.net \
--cc=gospo@redhat.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).