blob: 7171029856006c241fb4689f76b4f4fc82c02c0b [file] [log] [blame]
Shradha Shah7fa8d542015-05-06 00:55:13 +01001/****************************************************************************
2 * Driver for Solarflare network controllers and boards
3 * Copyright 2015 Solarflare Communications Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation, incorporated herein by reference.
8 */
9
10#ifndef EF10_SRIOV_H
11#define EF10_SRIOV_H
12
13#include "net_driver.h"
14
Shradha Shah3c5eb872015-05-06 00:58:31 +010015/**
16 * struct ef10_vf - PF's store of VF data
Shradha Shahf1122a32015-05-20 11:09:46 +010017 * @efx: efx_nic struct for the current VF
Shradha Shah3c5eb872015-05-06 00:58:31 +010018 * @vport_id: vport ID for the VF
19 * @vport_assigned: record whether the vport is currently assigned to the VF
20 * @mac: MAC address for the VF, zero when address is removed from the vport
Shradha Shah2d432f22015-05-20 11:11:54 +010021 * @vlan: Default VLAN for the VF or #EFX_EF10_NO_VLAN
Shradha Shah3c5eb872015-05-06 00:58:31 +010022 */
23struct ef10_vf {
Shradha Shahf1122a32015-05-20 11:09:46 +010024 struct efx_nic *efx;
Shradha Shah3c5eb872015-05-06 00:58:31 +010025 unsigned int vport_id;
26 unsigned int vport_assigned;
27 u8 mac[ETH_ALEN];
Shradha Shah2d432f22015-05-20 11:11:54 +010028 u16 vlan;
29#define EFX_EF10_NO_VLAN 0
Shradha Shah3c5eb872015-05-06 00:58:31 +010030};
31
Shradha Shah7fa8d542015-05-06 00:55:13 +010032static inline bool efx_ef10_sriov_wanted(struct efx_nic *efx)
33{
34 return false;
35}
36
Shradha Shah834e23d2015-05-06 00:55:58 +010037int efx_ef10_sriov_configure(struct efx_nic *efx, int num_vfs);
Shradha Shah02246a72015-05-06 00:58:14 +010038int efx_ef10_sriov_init(struct efx_nic *efx);
Shradha Shahcfc77c22015-05-20 11:09:30 +010039static inline int efx_ef10_sriov_mac_address_changed(struct efx_nic *efx)
40{
41 return -EOPNOTSUPP;
42}
Shradha Shah7fa8d542015-05-06 00:55:13 +010043static inline void efx_ef10_sriov_reset(struct efx_nic *efx) {}
Shradha Shah02246a72015-05-06 00:58:14 +010044void efx_ef10_sriov_fini(struct efx_nic *efx);
Shradha Shah7fa8d542015-05-06 00:55:13 +010045static inline void efx_ef10_sriov_flr(struct efx_nic *efx, unsigned vf_i) {}
46
Shradha Shahe340be92015-05-20 11:11:03 +010047int efx_ef10_sriov_set_vf_mac(struct efx_nic *efx, int vf, u8 *mac);
Shradha Shah7fa8d542015-05-06 00:55:13 +010048
Shradha Shah2d432f22015-05-20 11:11:54 +010049int efx_ef10_sriov_set_vf_vlan(struct efx_nic *efx, int vf_i,
50 u16 vlan, u8 qos);
Shradha Shah7fa8d542015-05-06 00:55:13 +010051
Shradha Shah860d2ff2015-05-20 11:12:30 +010052int efx_ef10_sriov_set_vf_spoofchk(struct efx_nic *efx, int vf,
53 bool spoofchk);
Shradha Shah7fa8d542015-05-06 00:55:13 +010054
Shradha Shahb9af9042015-05-20 11:11:18 +010055int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf_i,
56 struct ifla_vf_info *ivf);
Shradha Shah7fa8d542015-05-06 00:55:13 +010057
Edward Cree4392dc62015-05-20 11:12:13 +010058int efx_ef10_sriov_set_vf_link_state(struct efx_nic *efx, int vf_i,
59 int link_state);
60
Shradha Shah7b8c7b52015-05-06 00:58:54 +010061int efx_ef10_vswitching_probe_pf(struct efx_nic *efx);
62int efx_ef10_vswitching_probe_vf(struct efx_nic *efx);
63int efx_ef10_vswitching_restore_pf(struct efx_nic *efx);
64int efx_ef10_vswitching_restore_vf(struct efx_nic *efx);
65void efx_ef10_vswitching_remove_pf(struct efx_nic *efx);
66void efx_ef10_vswitching_remove_vf(struct efx_nic *efx);
Daniel Pieczko6d8aaaf2015-05-06 00:57:34 +010067
Shradha Shah7fa8d542015-05-06 00:55:13 +010068#endif /* EF10_SRIOV_H */