Shradha Shah | 7fa8d54 | 2015-05-06 00:55:13 +0100 | [diff] [blame] | 1 | /**************************************************************************** |
| 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 Shah | 3c5eb87 | 2015-05-06 00:58:31 +0100 | [diff] [blame] | 15 | /** |
| 16 | * struct ef10_vf - PF's store of VF data |
Shradha Shah | f1122a3 | 2015-05-20 11:09:46 +0100 | [diff] [blame] | 17 | * @efx: efx_nic struct for the current VF |
Shradha Shah | 3c5eb87 | 2015-05-06 00:58:31 +0100 | [diff] [blame] | 18 | * @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 Shah | 2d432f2 | 2015-05-20 11:11:54 +0100 | [diff] [blame] | 21 | * @vlan: Default VLAN for the VF or #EFX_EF10_NO_VLAN |
Shradha Shah | 3c5eb87 | 2015-05-06 00:58:31 +0100 | [diff] [blame] | 22 | */ |
| 23 | struct ef10_vf { |
Shradha Shah | f1122a3 | 2015-05-20 11:09:46 +0100 | [diff] [blame] | 24 | struct efx_nic *efx; |
Shradha Shah | 3c5eb87 | 2015-05-06 00:58:31 +0100 | [diff] [blame] | 25 | unsigned int vport_id; |
| 26 | unsigned int vport_assigned; |
| 27 | u8 mac[ETH_ALEN]; |
Shradha Shah | 2d432f2 | 2015-05-20 11:11:54 +0100 | [diff] [blame] | 28 | u16 vlan; |
| 29 | #define EFX_EF10_NO_VLAN 0 |
Shradha Shah | 3c5eb87 | 2015-05-06 00:58:31 +0100 | [diff] [blame] | 30 | }; |
| 31 | |
Shradha Shah | 7fa8d54 | 2015-05-06 00:55:13 +0100 | [diff] [blame] | 32 | static inline bool efx_ef10_sriov_wanted(struct efx_nic *efx) |
| 33 | { |
| 34 | return false; |
| 35 | } |
| 36 | |
Shradha Shah | 834e23d | 2015-05-06 00:55:58 +0100 | [diff] [blame] | 37 | int efx_ef10_sriov_configure(struct efx_nic *efx, int num_vfs); |
Shradha Shah | 02246a7 | 2015-05-06 00:58:14 +0100 | [diff] [blame] | 38 | int efx_ef10_sriov_init(struct efx_nic *efx); |
Shradha Shah | cfc77c2 | 2015-05-20 11:09:30 +0100 | [diff] [blame] | 39 | static inline int efx_ef10_sriov_mac_address_changed(struct efx_nic *efx) |
| 40 | { |
| 41 | return -EOPNOTSUPP; |
| 42 | } |
Shradha Shah | 7fa8d54 | 2015-05-06 00:55:13 +0100 | [diff] [blame] | 43 | static inline void efx_ef10_sriov_reset(struct efx_nic *efx) {} |
Shradha Shah | 02246a7 | 2015-05-06 00:58:14 +0100 | [diff] [blame] | 44 | void efx_ef10_sriov_fini(struct efx_nic *efx); |
Shradha Shah | 7fa8d54 | 2015-05-06 00:55:13 +0100 | [diff] [blame] | 45 | static inline void efx_ef10_sriov_flr(struct efx_nic *efx, unsigned vf_i) {} |
| 46 | |
Shradha Shah | e340be9 | 2015-05-20 11:11:03 +0100 | [diff] [blame] | 47 | int efx_ef10_sriov_set_vf_mac(struct efx_nic *efx, int vf, u8 *mac); |
Shradha Shah | 7fa8d54 | 2015-05-06 00:55:13 +0100 | [diff] [blame] | 48 | |
Shradha Shah | 2d432f2 | 2015-05-20 11:11:54 +0100 | [diff] [blame] | 49 | int efx_ef10_sriov_set_vf_vlan(struct efx_nic *efx, int vf_i, |
| 50 | u16 vlan, u8 qos); |
Shradha Shah | 7fa8d54 | 2015-05-06 00:55:13 +0100 | [diff] [blame] | 51 | |
Shradha Shah | 860d2ff | 2015-05-20 11:12:30 +0100 | [diff] [blame^] | 52 | int efx_ef10_sriov_set_vf_spoofchk(struct efx_nic *efx, int vf, |
| 53 | bool spoofchk); |
Shradha Shah | 7fa8d54 | 2015-05-06 00:55:13 +0100 | [diff] [blame] | 54 | |
Shradha Shah | b9af904 | 2015-05-20 11:11:18 +0100 | [diff] [blame] | 55 | int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf_i, |
| 56 | struct ifla_vf_info *ivf); |
Shradha Shah | 7fa8d54 | 2015-05-06 00:55:13 +0100 | [diff] [blame] | 57 | |
Edward Cree | 4392dc6 | 2015-05-20 11:12:13 +0100 | [diff] [blame] | 58 | int efx_ef10_sriov_set_vf_link_state(struct efx_nic *efx, int vf_i, |
| 59 | int link_state); |
| 60 | |
Shradha Shah | 7b8c7b5 | 2015-05-06 00:58:54 +0100 | [diff] [blame] | 61 | int efx_ef10_vswitching_probe_pf(struct efx_nic *efx); |
| 62 | int efx_ef10_vswitching_probe_vf(struct efx_nic *efx); |
| 63 | int efx_ef10_vswitching_restore_pf(struct efx_nic *efx); |
| 64 | int efx_ef10_vswitching_restore_vf(struct efx_nic *efx); |
| 65 | void efx_ef10_vswitching_remove_pf(struct efx_nic *efx); |
| 66 | void efx_ef10_vswitching_remove_vf(struct efx_nic *efx); |
Daniel Pieczko | 6d8aaaf | 2015-05-06 00:57:34 +0100 | [diff] [blame] | 67 | |
Shradha Shah | 7fa8d54 | 2015-05-06 00:55:13 +0100 | [diff] [blame] | 68 | #endif /* EF10_SRIOV_H */ |