blob: 8c92a8df508533eb7acaa06e05fe6557dc8c2395 [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
21 */
22struct ef10_vf {
Shradha Shahf1122a32015-05-20 11:09:46 +010023 struct efx_nic *efx;
Shradha Shah3c5eb872015-05-06 00:58:31 +010024 unsigned int vport_id;
25 unsigned int vport_assigned;
26 u8 mac[ETH_ALEN];
27};
28
Shradha Shah7fa8d542015-05-06 00:55:13 +010029static inline bool efx_ef10_sriov_wanted(struct efx_nic *efx)
30{
31 return false;
32}
33
Shradha Shah834e23d2015-05-06 00:55:58 +010034int efx_ef10_sriov_configure(struct efx_nic *efx, int num_vfs);
Shradha Shah02246a72015-05-06 00:58:14 +010035int efx_ef10_sriov_init(struct efx_nic *efx);
Shradha Shahcfc77c22015-05-20 11:09:30 +010036static inline int efx_ef10_sriov_mac_address_changed(struct efx_nic *efx)
37{
38 return -EOPNOTSUPP;
39}
Shradha Shah7fa8d542015-05-06 00:55:13 +010040static inline void efx_ef10_sriov_reset(struct efx_nic *efx) {}
Shradha Shah02246a72015-05-06 00:58:14 +010041void efx_ef10_sriov_fini(struct efx_nic *efx);
Shradha Shah7fa8d542015-05-06 00:55:13 +010042static inline void efx_ef10_sriov_flr(struct efx_nic *efx, unsigned vf_i) {}
43
Shradha Shahe340be92015-05-20 11:11:03 +010044int efx_ef10_sriov_set_vf_mac(struct efx_nic *efx, int vf, u8 *mac);
Shradha Shah7fa8d542015-05-06 00:55:13 +010045
46static inline int efx_ef10_sriov_set_vf_vlan(struct efx_nic *efx, int vf,
47 u16 vlan, u8 qos)
48{
49 return -EOPNOTSUPP;
50}
51
52static inline int efx_ef10_sriov_set_vf_spoofchk(struct efx_nic *efx, int vf,
53 bool spoofchk)
54{
55 return -EOPNOTSUPP;
56}
57
Shradha Shahb9af9042015-05-20 11:11:18 +010058int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf_i,
59 struct ifla_vf_info *ivf);
Shradha Shah7fa8d542015-05-06 00:55:13 +010060
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 */