Greg Rose | 1736727 | 2010-01-09 02:25:48 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | |
| 3 | Intel 10 Gigabit PCI Express Linux driver |
Don Skidmore | 434c5e3 | 2013-01-08 05:02:28 +0000 | [diff] [blame] | 4 | Copyright(c) 1999 - 2013 Intel Corporation. |
Greg Rose | 1736727 | 2010-01-09 02:25:48 +0000 | [diff] [blame] | 5 | |
| 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, |
| 8 | version 2, as published by the Free Software Foundation. |
| 9 | |
| 10 | This program is distributed in the hope it will be useful, but WITHOUT |
| 11 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 13 | more details. |
| 14 | |
| 15 | You should have received a copy of the GNU General Public License along with |
| 16 | this program; if not, write to the Free Software Foundation, Inc., |
| 17 | 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | |
| 19 | The full GNU General Public License is included in this distribution in |
| 20 | the file called "COPYING". |
| 21 | |
| 22 | Contact Information: |
Jacob Keller | b89aae7 | 2014-02-22 01:23:50 +0000 | [diff] [blame] | 23 | Linux NICS <linux.nics@intel.com> |
Greg Rose | 1736727 | 2010-01-09 02:25:48 +0000 | [diff] [blame] | 24 | e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> |
| 25 | Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
| 26 | |
| 27 | *******************************************************************************/ |
| 28 | |
| 29 | #ifndef _IXGBE_SRIOV_H_ |
| 30 | #define _IXGBE_SRIOV_H_ |
| 31 | |
ethan.zhao | dcc23e3 | 2014-01-16 19:41:04 -0800 | [diff] [blame] | 32 | /* ixgbe driver limit the max number of VFs could be enabled to |
| 33 | * 63 (IXGBE_MAX_VF_FUNCTIONS - 1) |
| 34 | */ |
| 35 | #define IXGBE_MAX_VFS_DRV_LIMIT (IXGBE_MAX_VF_FUNCTIONS - 1) |
| 36 | |
Jacob Keller | b335e75 | 2014-03-25 07:45:27 +0000 | [diff] [blame] | 37 | #ifdef CONFIG_PCI_IOV |
Greg Rose | 1736727 | 2010-01-09 02:25:48 +0000 | [diff] [blame] | 38 | void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter); |
Jacob Keller | b335e75 | 2014-03-25 07:45:27 +0000 | [diff] [blame] | 39 | #endif |
Greg Rose | 1736727 | 2010-01-09 02:25:48 +0000 | [diff] [blame] | 40 | void ixgbe_msg_task(struct ixgbe_adapter *adapter); |
Greg Rose | 1736727 | 2010-01-09 02:25:48 +0000 | [diff] [blame] | 41 | int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask); |
Greg Rose | 767081a | 2010-01-22 22:46:40 +0000 | [diff] [blame] | 42 | void ixgbe_disable_tx_rx(struct ixgbe_adapter *adapter); |
| 43 | void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter); |
Greg Rose | 7f01648 | 2010-05-04 22:12:06 +0000 | [diff] [blame] | 44 | int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int queue, u8 *mac); |
| 45 | int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int queue, u16 vlan, |
| 46 | u8 qos); |
Sucheta Chakraborty | ed61668 | 2014-05-22 09:59:05 -0400 | [diff] [blame] | 47 | int ixgbe_ndo_set_vf_bw(struct net_device *netdev, int vf, int min_tx_rate, |
| 48 | int max_tx_rate); |
Greg Rose | de4c7f6 | 2011-09-29 05:57:33 +0000 | [diff] [blame] | 49 | int ixgbe_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting); |
Vlad Zolotarov | e65ce0d | 2015-03-30 21:35:24 +0300 | [diff] [blame] | 50 | int ixgbe_ndo_set_vf_rss_query_en(struct net_device *netdev, int vf, |
| 51 | bool setting); |
Greg Rose | 7f01648 | 2010-05-04 22:12:06 +0000 | [diff] [blame] | 52 | int ixgbe_ndo_get_vf_config(struct net_device *netdev, |
| 53 | int vf, struct ifla_vf_info *ivi); |
Lior Levy | ff4ab20 | 2011-03-11 02:03:07 +0000 | [diff] [blame] | 54 | void ixgbe_check_vf_rate_limit(struct ixgbe_adapter *adapter); |
Greg Rose | da36b64 | 2012-12-11 08:26:43 +0000 | [diff] [blame] | 55 | int ixgbe_disable_sriov(struct ixgbe_adapter *adapter); |
Rose, Gregory V | 0126410 | 2011-11-07 07:44:17 +0000 | [diff] [blame] | 56 | #ifdef CONFIG_PCI_IOV |
Greg Rose | 60a1a68 | 2012-12-11 08:26:33 +0000 | [diff] [blame] | 57 | void ixgbe_enable_sriov(struct ixgbe_adapter *adapter); |
Greg Rose | 9487dc8 | 2011-10-21 07:55:15 +0000 | [diff] [blame] | 58 | #endif |
Greg Rose | da36b64 | 2012-12-11 08:26:43 +0000 | [diff] [blame] | 59 | int ixgbe_pci_sriov_configure(struct pci_dev *dev, int num_vfs); |
Greg Rose | c6bda30 | 2011-08-24 02:37:55 +0000 | [diff] [blame] | 60 | |
John Fastabend | 610a63f | 2012-10-19 02:34:34 +0000 | [diff] [blame] | 61 | static inline void ixgbe_set_vmvir(struct ixgbe_adapter *adapter, |
| 62 | u16 vid, u16 qos, u32 vf) |
| 63 | { |
| 64 | struct ixgbe_hw *hw = &adapter->hw; |
| 65 | u32 vmvir = vid | (qos << VLAN_PRIO_SHIFT) | IXGBE_VMVIR_VLANA_DEFAULT; |
| 66 | |
| 67 | IXGBE_WRITE_REG(hw, IXGBE_VMVIR(vf), vmvir); |
| 68 | } |
Greg Rose | 1736727 | 2010-01-09 02:25:48 +0000 | [diff] [blame] | 69 | |
| 70 | #endif /* _IXGBE_SRIOV_H_ */ |
| 71 | |