summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2015-10-23 19:06:19 (GMT)
committerDavid S. Miller <davem@davemloft.net>2015-10-24 00:34:34 (GMT)
commit379a80a1d048dcacfc2011d5d32e16d5c804b9f4 (patch)
tree1fee3bb597596654e2b3613b3cc1c5e0488f1967 /drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
parentbf7958607d0b792e0c43482c0c78786023a69832 (diff)
downloadlinux-379a80a1d048dcacfc2011d5d32e16d5c804b9f4.tar.xz
bnxt_en: Fix compile errors when CONFIG_BNXT_SRIOV is not set.
struct bnxt_pf_info needs to be always defined. Move bnxt_update_vf_mac() to bnxt_sriov.c and add some missing #ifdef CONFIG_BNXT_SRIOV. Reported-by: Jim Hull <jim.hull@hpe.com> Tested-by: Jim Hull <jim.hull@hpe.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
index 3422147..60989e7 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
@@ -774,6 +774,31 @@ void bnxt_hwrm_exec_fwd_req(struct bnxt *bp)
i = vf_id + 1;
}
}
+
+void bnxt_update_vf_mac(struct bnxt *bp)
+{
+ struct hwrm_func_qcaps_input req = {0};
+ struct hwrm_func_qcaps_output *resp = bp->hwrm_cmd_resp_addr;
+
+ bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_QCAPS, -1, -1);
+ req.fid = cpu_to_le16(0xffff);
+
+ mutex_lock(&bp->hwrm_cmd_lock);
+ if (_hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT))
+ goto update_vf_mac_exit;
+
+ if (!is_valid_ether_addr(resp->perm_mac_address))
+ goto update_vf_mac_exit;
+
+ if (ether_addr_equal(resp->perm_mac_address, bp->vf.mac_addr))
+ goto update_vf_mac_exit;
+
+ memcpy(bp->vf.mac_addr, resp->perm_mac_address, ETH_ALEN);
+ memcpy(bp->dev->dev_addr, bp->vf.mac_addr, ETH_ALEN);
+update_vf_mac_exit:
+ mutex_unlock(&bp->hwrm_cmd_lock);
+}
+
#else
void bnxt_sriov_disable(struct bnxt *bp)
@@ -782,6 +807,10 @@ void bnxt_sriov_disable(struct bnxt *bp)
void bnxt_hwrm_exec_fwd_req(struct bnxt *bp)
{
- netdev_err(dev, "Invalid VF message received when SRIOV is not enable\n");
+ netdev_err(bp->dev, "Invalid VF message received when SRIOV is not enable\n");
+}
+
+void bnxt_update_vf_mac(struct bnxt *bp)
+{
}
#endif