.. | .. |
---|
1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
---|
2 | 2 | /* Copyright(c) 2009 - 2018 Intel Corporation. */ |
---|
3 | 3 | |
---|
| 4 | +#include <linux/etherdevice.h> |
---|
| 5 | + |
---|
4 | 6 | #include "vf.h" |
---|
5 | 7 | |
---|
6 | 8 | static s32 e1000_check_for_link_vf(struct e1000_hw *hw); |
---|
.. | .. |
---|
131 | 133 | /* set our "perm_addr" based on info provided by PF */ |
---|
132 | 134 | ret_val = mbx->ops.read_posted(hw, msgbuf, 3); |
---|
133 | 135 | if (!ret_val) { |
---|
134 | | - if (msgbuf[0] == (E1000_VF_RESET | |
---|
135 | | - E1000_VT_MSGTYPE_ACK)) |
---|
| 136 | + switch (msgbuf[0]) { |
---|
| 137 | + case E1000_VF_RESET | E1000_VT_MSGTYPE_ACK: |
---|
136 | 138 | memcpy(hw->mac.perm_addr, addr, ETH_ALEN); |
---|
137 | | - else |
---|
| 139 | + break; |
---|
| 140 | + case E1000_VF_RESET | E1000_VT_MSGTYPE_NACK: |
---|
| 141 | + eth_zero_addr(hw->mac.perm_addr); |
---|
| 142 | + break; |
---|
| 143 | + default: |
---|
138 | 144 | ret_val = -E1000_ERR_MAC_INIT; |
---|
| 145 | + } |
---|
139 | 146 | } |
---|
140 | 147 | } |
---|
141 | 148 | |
---|