aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/e1000e/lib.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
index 56b59e4a6871..97649bf53b05 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)
2301 s32 ret_val, hdr_csum, csum; 2301 s32 ret_val, hdr_csum, csum;
2302 u8 i, len; 2302 u8 i, len;
2303 2303
2304 hw->mac.tx_pkt_filtering = true;
2305
2304 /* No manageability, no filtering */ 2306 /* No manageability, no filtering */
2305 if (!e1000e_check_mng_mode(hw)) { 2307 if (!e1000e_check_mng_mode(hw)) {
2306 hw->mac.tx_pkt_filtering = false; 2308 hw->mac.tx_pkt_filtering = false;
2307 return 0; 2309 goto out;
2308 } 2310 }
2309 2311
2310 /* 2312 /*
@@ -2312,9 +2314,9 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
2312 * reason, disable filtering. 2314 * reason, disable filtering.
2313 */ 2315 */
2314 ret_val = e1000_mng_enable_host_if(hw); 2316 ret_val = e1000_mng_enable_host_if(hw);
2315 if (ret_val != 0) { 2317 if (ret_val) {
2316 hw->mac.tx_pkt_filtering = false; 2318 hw->mac.tx_pkt_filtering = false;
2317 return ret_val; 2319 goto out;
2318 } 2320 }
2319 2321
2320 /* Read in the header. Length and offset are in dwords. */ 2322 /* Read in the header. Length and offset are in dwords. */
@@ -2333,17 +2335,17 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
2333 */ 2335 */
2334 if ((hdr_csum != csum) || (hdr->signature != E1000_IAMT_SIGNATURE)) { 2336 if ((hdr_csum != csum) || (hdr->signature != E1000_IAMT_SIGNATURE)) {
2335 hw->mac.tx_pkt_filtering = true; 2337 hw->mac.tx_pkt_filtering = true;
2336 return 1; 2338 goto out;
2337 } 2339 }
2338 2340
2339 /* Cookie area is valid, make the final check for filtering. */ 2341 /* Cookie area is valid, make the final check for filtering. */
2340 if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING)) { 2342 if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING)) {
2341 hw->mac.tx_pkt_filtering = false; 2343 hw->mac.tx_pkt_filtering = false;
2342 return 0; 2344 goto out;
2343 } 2345 }
2344 2346
2345 hw->mac.tx_pkt_filtering = true; 2347out:
2346 return 1; 2348 return hw->mac.tx_pkt_filtering;
2347} 2349}
2348 2350
2349/** 2351/**